X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fmediawiki%2Fmediawiki.notify.js;h=743d65172864d8d083ebc5559dc4632c4a147423;hb=705c4adb63fdb2a32b644a8b89596d9d8b779689;hp=3bf2a89634399f4ad4d30f89832397b991e5de28;hpb=85a0fb2d8403bb0ed7aa02560da1d5c4f47663b1;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/mediawiki/mediawiki.notify.js b/resources/mediawiki/mediawiki.notify.js index 3bf2a89634..743d651728 100644 --- a/resources/mediawiki/mediawiki.notify.js +++ b/resources/mediawiki/mediawiki.notify.js @@ -1,20 +1,28 @@ /** - * Implements mediaWiki.notify function + * @class mw.plugin.notify */ -( function ( mw ) { +( function ( mw, $ ) { 'use strict'; /** - * @see mw.notification.notify + * @see mw.notification#notify + * @param message + * @param options + * @return {jQuery.Promise} */ mw.notify = function ( message, options ) { + var d = $.Deferred(); // Don't bother loading the whole notification system if we never use it. mw.loader.using( 'mediawiki.notification', function () { - // Don't bother calling mw.loader.using a second time after we've already loaded mw.notification. - mw.notify = mw.notification.notify; // Call notify with the notification the user requested of us. - mw.notify( message, options ); - } ); + d.resolve( mw.notification.notify( message, options ) ); + }, d.reject ); + return d.promise(); }; -}( mediaWiki ) ); \ No newline at end of file + /** + * @class mw + * @mixins mw.plugin.notify + */ + +}( mediaWiki, jQuery ) );