]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - resources/src/mediawiki/mediawiki.notify.js
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / resources / src / mediawiki / mediawiki.notify.js
1 /**
2  * @class mw.plugin.notify
3  */
4 ( function ( mw ) {
5         'use strict';
6
7         /**
8          * @see mw.notification#notify
9          * @see mw.notification#defaults
10          * @param {HTMLElement|HTMLElement[]|jQuery|mw.Message|string} message
11          * @param {Object} options See mw.notification#defaults for details.
12          * @return {jQuery.Promise}
13          */
14         mw.notify = function ( message, options ) {
15                 // Don't bother loading the whole notification system if we never use it.
16                 return mw.loader.using( 'mediawiki.notification' )
17                         .then( function () {
18                                 // Call notify with the notification the user requested of us.
19                                 return mw.notification.notify( message, options );
20                         } );
21         };
22
23         /**
24          * @class mw
25          * @mixins mw.plugin.notify
26          */
27
28 }( mediaWiki ) );