User:Revi/global.js

/** If some methods in this page is deprecated and needs to be changed, feel free to do so.

If you're asked by me for help, feel free to edit.

Otherwise, come to my talk page and ask for an edit.

// Display users rights (Temporary, might work on my own rewrite of this or find another one) mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Splarka/sysopdectector.js&action=raw&ctype=text/javascript');

// No MediaViewer mw.config.set("wgMediaViewerOnClick", false);

// No VisualEditor, for OPT-OUT wikis. mw.hook('BeforePageDisplay').remove('ext.visualEditor.viewPageTarget.init'); mw.user.options.set('visualeditor-enable',0);

/** * Ajax sysop * @see https://meta.wikimedia.org/wiki/Ajax_sysop * @update-token */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.ajaxsysop.js');

/* Mark blocked user as such. */ mw.loader.load('//ru.wikipedia.org/w/index.php?title=MediaWiki:Gadget-markblocked.js&action=raw&ctype=text/javascript');

/* Change language to English if it is not */ mw.loader.using("mediawiki.user", function {	if ( mw.user.options.get('language') !== 'en' ) {		mw.loader.load("mediawiki.notify");		( new mw.Api ).postWithToken( 'options', { action: "options", change: "language=en" } ).done( function { mw.loader.using("mediawiki.notify", function{				mw.notify( "Language has been changed to English. Please refresh the page." );			} );		} );	} else {		console.log('Language already set to English!');	} } );

/** * StewardScript extends the user interface for Wikimedia stewards' convenience. * @see https://meta.wikimedia.org/wiki/StewardScript * @update-token */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.stewardscript.js');

/** * Forces left-to-right layout and editing on RTL wikis. * @see https://meta.wikimedia.org/wiki/Force_ltr * @update-token */ mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.forceltr.js');

// enwiki purgetab mw.loader.load('//en.wikipedia.org/w/index.php?title=MediaWiki:Gadget-purgetab.js&action=raw&ctype=text/javascript');