MediaWiki:Gadget-WatchlistNotice.js

From Wikimedia Commons, the free media repository
Jump to: navigation, search
/**
 * WatchlistNotice
 * This is just a loader-gadget:
 * Only works at [[Special:Watchlist]]
 *
 * @rev 1 (2013-05-23)
 * @author Rillke, 2013
 */
// List the global variables for jsHint-Validation. Please make sure that it passes http://jshint.com/
// Scheme: globalVariable:allowOverwriting[, globalVariable:allowOverwriting][, globalVariable:allowOverwriting]
/*global jQuery:false, mediaWiki:false*/

// Load the heavy code only on pages where it is really required; Userlogin only loads site-JS after logging-in not at the login-form itself

if ($.inArray(mw.config.get('wgCanonicalSpecialPageName'), ['Watchlist', 'Userlogin']) > -1 ||
	/^Commons:Community_portal/.test(mw.config.get('wgPageName'))) {
	mw.loader.load('ext.gadget.WatchlistNotice.core');
}