summaryrefslogtreecommitdiff
path: root/resources/src/mediawiki/mediawiki.notify.js
blob: c1e1dabfc77569c3b5575c6222a431710b01b391 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
 * @class mw.plugin.notify
 */
( function ( mw ) {
	'use strict';

	/**
	 * @see mw.notification#notify
	 * @param message
	 * @param options
	 * @return {jQuery.Promise}
	 */
	mw.notify = function ( message, options ) {
		// Don't bother loading the whole notification system if we never use it.
		return mw.loader.using( 'mediawiki.notification' )
			.then( function () {
				// Call notify with the notification the user requested of us.
				return mw.notification.notify( message, options );
			} );
	};

	/**
	 * @class mw
	 * @mixins mw.plugin.notify
	 */

}( mediaWiki ) );