Expand all

mw.echo.dm.NotificationItem

Constructor

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

Parameters:

Name Type Attributes Description
id number

Notification id,

config Object optional

Configuration object

Mixes in:
Source:
Notification item data structure.

Methods

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

Get the all ids contained in this notification

Source:

Returns:

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

getCategory() → {string} #

Get NotificationItem category

Source:

Returns:

NotificationItem category

Type
string
Get NotificationItem category

getContentBody() → {string} #

Get NotificationItem content body

Source:

Returns:

NotificationItem content body

Type
string
Get NotificationItem content body

getContentHeader() → {string} #

Get NotificationItem content header

Source:

Returns:

NotificationItem content

Type
string
Get NotificationItem content header

getIconType() → {string} #

Get the notification icon type

Source:

Returns:

Notification icon type

Type
string
Get the notification icon type

getIconURL() → {string} #

Get the notification icon URL

Source:

Returns:

Notification icon URL

Type
string
Get the notification icon URL

getId() → {string} #

Get NotificationItem id

Source:

Returns:

NotificationItem Id

Type
string
Get NotificationItem id

getModelName() → {string} #

Get the notification's model name

Source:

Returns:

Notification model name

Type
string
Get the notification's model name

getPrimaryUrl() → {string} #

Get the notification link

Source:

Returns:

Notification url

Type
string
Get the notification link

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

Get the notification's secondary links

Source:

Returns:

Secondary url definitions

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

getSource() → {string} #

Get the notification's source

Source:

Returns:

Notification source

Type
string
Get the notification's source

getTimestamp() → {number} #

Get the notification timestamp

Source:

Returns:

Notification timestamp in MediaWiki timestamp format

Type
number
Get the notification timestamp

getType() → {string} #

Get NotificationItem type

Source:

Returns:

NotificationItem type

Type
string
Get NotificationItem type

isBundled() → {boolean} #

Check whether this notification item is part of a bundle

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

Source:

Returns:

Notification item is foreign

Type
boolean
Check whether this notification item is foreign

isRead() → {boolean} #

Check whether this notification item is read

Source:

Returns:

Notification item is read

Type
boolean
Check whether this notification item is read

isSeen() → {boolean} #

Check whether this notification item is seen

Source:

Returns:

Notification item is seen

Type
boolean
Check whether this notification item is seen

setForeign(isForeign) #

Set this notification item as foreign

Parameters:

Name Type Description
isForeign boolean

Notification item is foreign

Source:
Set this notification item as foreign

setPrimaryUrl(link) #

Set the notification link

Parameters:

Name Type Description
link string

Notification url

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

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.

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.

Source:

Fires:

Toggle the seen state of the widget

Events

update() #

Item details have changed or were updated

Source:
Item details have changed or were updated