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 |
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 |
Returns:
An array of matching items
- Type
- Array.<mw.echo.dm.NotificationItem>
getAllIds() → {Array.<number>}
#
getCategory() → {string}
#
Get NotificationItem category
- Inherited from:
- Source:
Returns:
NotificationItem category
- Type
- string
getContentBody() → {string}
#
Get NotificationItem content body
- Inherited from:
- Source:
Returns:
NotificationItem content body
- Type
- string
getContentHeader() → {string}
#
Get NotificationItem content header
- Inherited from:
- Source:
Returns:
NotificationItem content
- Type
- string
getCount() → {number}
#
Get expected item count from all sources
Returns:
Item count
- Type
- number
getIconType() → {string}
#
Get the notification icon type
- Inherited from:
- Source:
Returns:
Notification icon type
- Type
- string
getIconURL() → {string}
#
Get the notification icon URL
- Inherited from:
- Source:
Returns:
Notification icon URL
- Type
- string
getId() → {string}
#
Get NotificationItem id
- Inherited from:
- Source:
Returns:
NotificationItem Id
- Type
- string
getItems() → {Array.<mw.echo.dm.NotificationItem>}
#
getList() → {mw.echo.dm.NotificationsList}
#
Get the list of bundled notifications
Returns:
List of bundled notifications
getModelName() → {string}
#
Get the notification's model name
- Inherited from:
- Source:
Returns:
Notification model name
- Type
- string
getName() → {string}
#
Get model name
Returns:
model name
- Type
- string
getPrimaryUrl() → {string}
#
Get the notification link
- Inherited from:
- Source:
Returns:
Notification url
- Type
- string
getSecondaryUrls() → {Array.<Object>}
#
Get the notification's secondary links
- Inherited from:
- Source:
Returns:
Secondary url definitions
getSource() → {string}
#
Get the notification's source
- Inherited from:
- Source:
Returns:
Notification source
- Type
- string
getTimestamp() → {number}
#
Get the notification timestamp
- Inherited from:
- Source:
Returns:
Notification timestamp in MediaWiki timestamp format
- Type
- number
getType() → {string}
#
Get NotificationItem type
- Inherited from:
- Source:
Returns:
NotificationItem type
- Type
- string
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.
Returns:
There are unseen items
- Type
- boolean
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
isForeign() → {boolean}
#
Check whether this notification item is foreign
- Inherited from:
- Source:
Returns:
Notification item is foreign
- Type
- boolean
isGroup() → {boolean}
#
This item is a group.
This method is required for all models that are managed by the
mw.echo.dm
.ModelManager.
Returns:
This item is a group
- Type
- boolean
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
onItemUpdate()
#
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:
setPrimaryUrl(link)
#
Set the notification link
Parameters:
Name | Type | Description |
---|---|---|
link |
string | Notification url |
- Inherited from:
- Source:
setSecondaryUrls(links)
#
Set the notification's secondary links See constructor documentation for the structure of these links objects.
Parameters:
- 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:
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:
updateSeenState(timestamp)
#
Set all notifications to seen
Parameters:
Name | Type | Description |
---|---|---|
timestamp |
number | New seen timestamp |
Events
update()
#
Item details have changed or were updated
- Inherited from:
- Source: