Jump to content

User:Juliancolton/global.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Erwin/xwikirollback.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Mike.lifeguard/modrollback.js&action=raw&ctype=text/javascript');
mw.loader.load('//meta.wikimedia.org/w/index.php?title=Mediawiki:Gadget-UTCLiveClock.js&action=raw&ctype=text/javascript');

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

//Mike.lifeguard's Spam script for [[User:COIBot/Xwiki]]
function importAnyScript(lang,family,script) {
	mw.loader.load('//' + lang + '.' + family + '.org/w/index.php?title=' + script + '&action=raw&ctype=text/javascript');
}

function userIsInGroup(group) {
	return $.inArray(group, mw.config.get('wgUserGroups')) != -1;
}

if (userIsInGroup('sysop')||userIsInGroup('rollbacker')||userIsInGlobalGroup('Global_rollback')||userIsInGlobalGroup('steward')){
	//Only if I'm a sysop. rollbacker, Global rollbacker, or a Steward
	importAnyScript('meta','wikimedia','User:Erwin/xwikirollback.js');
	importAnyScript('meta','wikimedia','User:Mike.lifeguard/modRollback.js');
}