Expand all

mw.echo.dm.CrossWikiNotificationItem

Extends

Constructor

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

Cross-wiki notification item model. Contains a list of sources, that each contain a list of notification items from that source.

Parameters:

Name Type Attributes Description
id number

Notification id

config Object optional

Configuration object

Source:
Cross-wiki notification item model.

Methods

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

Get the all ids contained in this notification

Inherited from:
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

getItemBySource(sourceName) → {mw.echo.dm.NotificationGroupsList} #

Get a specific item from the list by its source name

Parameters:

Name Type Description
sourceName string

Source name

Source:

Returns:

Source item

Type
mw.echo.dm.NotificationGroupsList
Get a specific item from the list by its source name

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

Get all items in the cross wiki notification bundle

Source:

Returns:

All items across all sources

Type
Array.<mw.echo.dm.NotificationItem>
Get all items in the cross wiki notification bundle

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

Get the list of sources

Source:

Returns:

List of sources

Type
mw.echo.dm.NotificationGroupsList
Get the list of sources

getModelName() → {string} #

Get the notification's model name

Inherited from:
Source:

Returns:

Notification model name

Type
string
Get the notification's 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

getSourceNames() → {Array.<string>} #

Get an array of source names that are in the cross-wiki list

Source:

Returns:

Source names

Type
Array.<string>
Get an array of source names that are in the cross-wiki list

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} #

Check whether this notification item is read

Inherited from:
Source:

Returns:

Notification item is read

Type
boolean
Check whether this notification item is read

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

onListDiscard(sourceModel) #

Respond to list being removed from the cross-wiki bundle.

Parameters:

Name Type Description
sourceModel mw.echo.dm.NotificationGroupsList

The source model that was removed

Source:

Fires:

Respond to list being removed from the cross-wiki bundle.

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 in all groups to seen

Parameters:

Name Type Description
timestamp number

New seen timestamp

Source:
Set all notifications in all groups to seen

Events

discard(name) #

A sub list has been discarded

Parameters:

Name Type Description
name string

The symbolic name for the list model that was discarded

Source:
A sub list has been discarded

update() #

Item details have changed or were updated

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