Update OOjs UI to v0.1.0-pre (7788dc6700)
[mediawiki.git] / resources / mediawiki / mediawiki.notify.js
blob743d65172864d8d083ebc5559dc4632c4a147423
1 /**
2  * @class mw.plugin.notify
3  */
4 ( function ( mw, $ ) {
5         'use strict';
7         /**
8          * @see mw.notification#notify
9          * @param message
10          * @param options
11          * @return {jQuery.Promise}
12          */
13         mw.notify = function ( message, options ) {
14                 var d = $.Deferred();
15                 // Don't bother loading the whole notification system if we never use it.
16                 mw.loader.using( 'mediawiki.notification', function () {
17                         // Call notify with the notification the user requested of us.
18                         d.resolve( mw.notification.notify( message, options ) );
19                 }, d.reject );
20                 return d.promise();
21         };
23         /**
24          * @class mw
25          * @mixins mw.plugin.notify
26          */
28 }( mediaWiki, jQuery ) );