Expand all

mw.echo.dm.BundleNotificationItem

Extends

Constructor

new mw.echo.dm.BundleNotificationItem(id, bundledNotificationModels, [config]) #

Bundle notification item model. Contains a list of bundled notifications. Is expandable.

Parameters:

Name Type Attributes Description
id number

Notification id

bundledNotificationModels Array.<mw.echo.dm.NotificationItem>
config Object optional

Configuration object

Source:
Bundle notification item model.

Methods

findByIds(ids) → {Array.<mw.echo.dm.NotificationItem>} #

Find all items that match the given IDs.

Parameters:

Name Type Description
ids Array.<number>

An array of item IDs

Source:

Returns:

An array of matching items

Type
Array.<mw.echo.dm.NotificationItem>
Find all items that match the given IDs.

getAllIds() → {Array.<number>} #

Get the all ids contained in this notification

Overrides:
Source:

Returns:

Type
Array.<number>
Get the all ids contained in this notification

getCategory() → {string} #

Get NotificationItem category

Inherited from:
Source:

Returns:

NotificationItem category

Type
string
Get NotificationItem category

getContentBody() → {string} #

Get NotificationItem content body

Inherited from:
Source:

Returns:

NotificationItem content body

Type
string
Get NotificationItem content body

getContentHeader() → {string} #

Get NotificationItem content header

Inherited from:
Source:

Returns:

NotificationItem content

Type
string
Get NotificationItem content header

getCount() → {number} #

Get expected item count from all sources

Source:

Returns:

Item count

Type
number
Get expected item count from all sources

getIconType() → {string} #

Get the notification icon type

Inherited from:
Source:

Returns:

Notification icon type

Type
string
Get the notification icon type

getIconURL() → {string} #

Get the notification icon URL

Inherited from:
Source:

Returns:

Notification icon URL

Type
string
Get the notification icon URL

getId() → {string} #

Get NotificationItem id

Inherited from:
Source:

Returns:

NotificationItem Id

Type
string
Get NotificationItem id

getItems() → {Array.<mw.echo.dm.NotificationItem>} #

Get bundled notifications

Source:

Returns:

bundled notifications

Type
Array.<mw.echo.dm.NotificationItem>
Get bundled notifications

getList() → {mw.echo.dm.NotificationsList} #

Get the list of bundled notifications

Source:

Returns:

List of bundled notifications

Type
mw.echo.dm.NotificationsList
Get the list of bundled notifications

getModelName() → {string} #

Get the notification's model name

Inherited from:
Source:

Returns:

Notification model name

Type
string
Get the notification's model name

getName() → {string} #

Get model name

Source:

Returns:

model name

Type
string
Get model name

getPrimaryUrl() → {string} #

Get the notification link

Inherited from:
Source:

Returns:

Notification url

Type
string
Get the notification link

getSecondaryUrls() → {Array.<Object>} #

Get the notification's secondary links

Inherited from:
Source:

Returns:

Secondary url definitions

Type
Array.<Object>
Get the notification's secondary links

getSource() → {string} #

Get the notification's source

Inherited from:
Source:

Returns:

Notification source

Type
string
Get the notification's source

getTimestamp() → {number} #

Get the notification timestamp

Inherited from:
Source:

Returns:

Notification timestamp in MediaWiki timestamp format

Type
number
Get the notification timestamp

getType() → {string} #

Get NotificationItem type

Inherited from:
Source:

Returns:

NotificationItem type

Type
string
Get NotificationItem type

hasUnseen() → {boolean} #

Check if there are unseen items in any of the cross wiki source lists. This method is required for all models that are managed by the mw.echo.dm.ModelManager.

Source:

Returns:

There are unseen items

Type
boolean
Check if there are unseen items in any of the cross wiki source lists.

isBundled() → {boolean} #

Check whether this notification item is part of a bundle

Inherited from:
Source:

Returns:

Notification item is part of a bundle

Type
boolean
Check whether this notification item is part of a bundle

isForeign() → {boolean} #

Check whether this notification item is foreign

Inherited from:
Source:

Returns:

Notification item is foreign

Type
boolean
Check whether this notification item is foreign

isGroup() → {boolean} #

This item is a group. This method is required for all models that are managed by the mw.echo.dm.ModelManager.

Source:

Returns:

This item is a group

Type
boolean
This item is a group.

isRead() → {boolean} #

Overrides:
Source:

Returns:

Whether this bundle is completely read

Type
boolean

isSeen() → {boolean} #

Check whether this notification item is seen

Inherited from:
Source:

Returns:

Notification item is seen

Type
boolean
Check whether this notification item is seen

onItemUpdate() #

Whenever a bundled notification changes, update the read status of the parent.

Source:
Whenever a bundled notification changes, update the read status of the parent.

setForeign(isForeign) #

Set this notification item as foreign

Parameters:

Name Type Description
isForeign boolean

Notification item is foreign

Inherited from:
Source:
Set this notification item as foreign

setPrimaryUrl(link) #

Set the notification link

Parameters:

Name Type Description
link string

Notification url

Inherited from:
Source:
Set the notification link

setSecondaryUrls(links) #

Set the notification's secondary links See constructor documentation for the structure of these links objects.

Parameters:

Name Type Description
links Array.<Object>

Secondary url definitions

Inherited from:
Source:

Set the notification's secondary links See constructor documentation for the structure of these links objects.

toggleRead([read]) #

Toggle the read state of the widget

Parameters:

Name Type Attributes Description
read boolean optional

The current read state. If not given, the state will become the opposite of its current state.

Inherited from:
Source:

Fires:

Toggle the read state of the widget

toggleSeen([seen]) #

Toggle the seen state of the widget

Parameters:

Name Type Attributes Description
seen boolean optional

The current seen state. If not given, the state will become the opposite of its current state.

Inherited from:
Source:

Fires:

Toggle the seen state of the widget

updateSeenState(timestamp) #

Set all notifications to seen

Parameters:

Name Type Description
timestamp number

New seen timestamp

Source:
Set all notifications to seen

Events

update() #

Item details have changed or were updated

Inherited from:
Source:
Item details have changed or were updated