Extends
Properties
fetchNotifications
#
Fetch notifications from the API.
- Inherited from:
- Source:
markAllRead
#
Mark all notifications as read
- Inherited from:
- Source:
markItemsRead
#
Mark multiple notification items as read using specific IDs
- Inherited from:
- Source:
updateSeenTime
#
Update the seen timestamp
- Inherited from:
- Source:
Methods
createNewFetchNotificationPromise(type, [sources], [overrideParams]) → {jQuery.Promise}
#
Create a new fetchNotifications promise that queries the API and overrides the cached promise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | Notification type |
|
sources |
Array.<string> |
optional |
An array of sources to query |
overrideParams |
Object |
optional |
An object defining parameters to override in the API fetching call. |
- Inherited from:
- Source:
Returns:
Promise that is resolved when notifications are fetched from the API.
- Type
- jQuery.Promise
Create a new fetchNotifications promise that queries the API and overrides the cached promise.
fetchUnreadCount(type, [ignoreCrossWiki]) → {jQuery.Promise}
#
Fetch the number of unread notifications.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | Notification type, 'alert', 'message' or 'all' |
|
ignoreCrossWiki |
boolean |
optional |
Ignore cross-wiki notifications when fetching the count. If set to false (by default) it counts notifications across all wikis. |
- Inherited from:
- Source:
Returns:
Promise which resolves with the unread count
- Type
- jQuery.Promise
fetchUnreadNotificationPages([sources]) → {jQuery.Promise}
#
Fetch all pages with unread notifications in them per wiki
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
sources |
string | Array.<string> |
optional |
* | Requested sources. If not given or if a '*' is given, all available sources will be queried |
- Inherited from:
- Source:
Returns:
Promise that is resolved with an object of pages with the number of unread notifications per wiki
- Type
- jQuery.Promise
getFetchNotificationPromise(type, [sources], [overrideParams]) → {jQuery.Promise}
#
Return the fetch notifications promise
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
string | Notification type, 'alert', 'message' or 'all' |
|
sources |
string | Array.<string> |
optional |
A name of a source or an array of sources to query |
overrideParams |
Object |
optional |
An object defining parameters to override in the API fetching call. |
- Inherited from:
- Source:
Returns:
Promise that is resolved when notifications are fetched from the API.
- Type
- jQuery.Promise
getTypeParams(type) → {Object}
#
Get the extra parameters for fetching notifications for a given notification type.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Notification type |
- Overrides:
- Source:
Returns:
Extra API parameters for fetch notifications
- Type
- Object
Get the extra parameters for fetching notifications for a given notification type.
isFetchingErrorState(type, sources) → {boolean}
#
Check whether the model has an API error state flagged
Parameters:
Name | Type | Description |
---|---|---|
type |
string | Notification type, 'alert', 'message' or 'all' |
sources |
string | Array.<string> | Source names |
- Inherited from:
- Source:
Returns:
The model is in API error state
- Type
- boolean
isSourceLocal(sources) → {boolean}
#
Check if the given source is local
Parameters:
Name | Type | Description |
---|---|---|
sources |
string | Array.<string> | Source names |
- Inherited from:
- Source:
Returns:
Source is local
- Type
- boolean
markItemRead(itemId, [isRead]) → {jQuery.Promise}
#
Update the read status of a notification item in the API
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
itemId |
string | Item id |
|
isRead |
boolean |
optional |
Item's new read state; true for marking the item as read, false for marking the item as unread |
- Inherited from:
- Source:
Returns:
A promise that resolves when the notifications are marked as read.
- Type
- jQuery.Promise
queryAPI(data) → {jQuery.Promise}
#
Send a general query to the API. This is mostly for dynamic actions where other extensions may set up API actions that are unique and unanticipated.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object | Data object about the operation. Properties:
|
- Inherited from:
- Source:
Returns:
Promise that is resolved when the action is complete
- Type
- jQuery.Promise