summaryrefslogtreecommitdiff
path: root/resources/mediawiki/mediawiki.notify.js
blob: 83d95b61b8a79eeda7f411be07d9e8e73f16c8fb (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
	 */
	mw.notify = function ( message, options ) {
		// 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 );
		} );
	};

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

}( mediaWiki ) );