MediaWiki:Gadget-WatchlistNotice.js

From Wikimedia Commons, the free media repository
Jump to: navigation, search

Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload

/**
 * 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');
}