notifications ⇒ WeavyWidget.plugins.notifications

Displays notifications in the context window. The notifications are placed in the widget.nodes.overlay.

Kind: global mixin

Instance members

widget.nodes ⇐ nodes

The nodes placeholder in WeavyWidget

Kind: instance property of notifications
Extends: nodes

widget.nodes.notifications : Element

Container for notifications

Kind: instance property of nodes

widget.nodes.notificationSound : HTMLAudioElement

The sound for notifications.

Kind: instance property of nodes

Events

"notification-inserted" ⇒ Notification

Triggered when a new notification is received from the server.

Kind: event emitted by notifications
Category: events

"notification-updated" ⇒ Notification

Triggered when a notification update is received from the server.

Kind: event emitted by notifications
Category: events

"notifications-all-read" ⇒ Object

Triggered when all notifications have been read.

Kind: event emitted by notifications
Category: events
Properties
NameTypeDescription
userIdint

The id of the user


Static members

notifications.defaults : Object

Default plugin options

Kind: static property of notifications
Properties
NameTypeDefaultDescription
sound.preloadstring "none"

Preload setting for the notificationSound

srcurl

Url to the notification sound

Example
WeavyWidget.plugins.notifications.defaults = {
    sound: {
        preload: "none",
        src: "/media/notification.mp3"
    }
};

Inner members

notifications~User : Object

Kind: inner typedef of notifications
Properties
NameTypeDescription
idint

The id of the user

namestring

The name of the user

thumbUrlurl

Url to the user avatar

typestring

"user"

urlurl

Url to the user profile

usernamestring

The username used for mentions etc.


notifications~Notification : Object

Kind: inner typedef of notifications
Properties
NameTypeDescription
idint

The id of the notification

typestring

"notification"

textstring

The text for the notification

htmlhtml

The notification text as HTML

isReadboolean

Has the notification been read?

createdAtISODateTime

The time the notification was created.

createdByUser

The user that created the notification, may be a system user.

iconObject

A Material Design Icon that is suitable for display of the notification.

icon.namestring

The name of the icon.

icon.colorstring

The icon color name.

kindstring

"notification"

urlurl

The url to the notification. It will redirect to the origin of the notification.

thumbUrlurl

The url to the avatar for the notification.

permissionsArray.<string>

List of permissions on the notification for the current user.