Class: Notification

Notification()

new Notification()

Regularly fetches notifications and decides which to show.
Source:

Methods

(static) _getDownloadables()

Yields a Downloadable instances for the notifications download.
Source:

(static) _getNextToShow(urlopt, nullable) → {Object}

Determines which notification is to be shown next.
Parameters:
Name Type Attributes Description
url URL | URLInfo <optional>
<nullable>
URL to match notifications to (optional)
Source:
Returns:
notification to be shown, or null if there is none
Type
Object

(static) addNotification(notification)

Adds a local notification.
Parameters:
Name Type Description
notification Object notification to add
Source:

(static) addQuestionListener(id, listener)

Adds a listener for question-type notifications
Parameters:
Name Type Description
id string
listener QuestionListener
Source:

(static) addShowListener(listener)

Adds a listener for notifications to be shown.
Parameters:
Name Type Description
listener function Listener to be invoked when a notification is to be shown
Source:

(static) getLocalizedTexts(notification) → {Object}

Localizes the texts of the supplied notification.
Parameters:
Name Type Description
notification Object notification to translate
Source:
Returns:
the translated texts
Type
Object

(static) init()

Called on module startup.
Source:

(static) markAsShown(id)

Marks a notification as shown.
Parameters:
Name Type Description
id string ID of the notification to be marked as shown
Source:

(static) removeNotification(notification)

Removes an existing local notification.
Parameters:
Name Type Description
notification Object notification to remove
Source:

(static) removeQuestionListener(id, listener)

Removes a listener that was previously added via addQuestionListener
Parameters:
Name Type Description
id string
listener QuestionListener
Source:

(static) removeShowListener(listener)

Removes the supplied listener.
Parameters:
Name Type Description
listener function Listener that was added via addShowListener()
Source:

(static) showNext(urlopt, nullable)

Invokes the listeners added via addShowListener() with the next notification to be shown.
Parameters:
Name Type Attributes Description
url URL | URLInfo <optional>
<nullable>
URL to match notifications to (optional)
Source:

(static) toggleIgnoreCategory(category, forceValueopt)

Toggles whether notifications of a specific category should be ignored
Parameters:
Name Type Attributes Description
category string notification category identifier
forceValue boolean <optional>
force specified value
Source:

(static) triggerQuestionListeners(id, approved)

Notifies question listeners about interactions with a notification
Parameters:
Name Type Description
id string notification ID
approved boolean indicator whether notification has been approved
Source: