MediaWiki:Gadget-afchelper.js

From Wikipedia, the free encyclopedia

Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: hold down the Ctrl key and click the Refresh or Reload button. Firefox: hold down the Shift key while clicking Reload (or press Ctrl-Shift-R). Google Chrome and Safari users can just click the Reload button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

///////////////////////////////////////////////
//////// Yet Another AfC Helper Script ////////
//// https://en.wikipedia.org/wiki/WP:AFCH ////
//// https://github.com/WPAFC/afch-rewrite ////
///////////////////////////////////////////////
 
( function ( mw, importScript ) {
	if ( /^(?:User:|Draft:|Wikipedia(?:_talk)?:Articles_for_creation)/.test( mw.config.get( 'wgPageName' ) ) ) {
		// These dependencies are also enforced by the gadget definition, this is a fallback
		// in case people ure using the gadget indirectly .
		mw.loader.using( ['mediawiki.api', 'mediawiki.util', 'mediawiki.user', 'jquery.chosen'] ).done( function() {
			importScript( 'MediaWiki:afch-master.js' );
		});
	}
}( mediaWiki, importScript ) );