User:Anton/CA.js

/* * Script that adds a "CentralAuth" or "GlobalBlock" link on the top of Special:Contributions and in the Sidebar. * If loaded through Special:MyPage/global.js, gives to Stewards access to the meta's CentralAuth page * in order to Lock/Hide the account. * Requested on T169463 * Author: Linedwell */

$(document).ready(function ca_gbLinkContribs {	if( mw.config.get('wgCanonicalSpecialPageName') == 'Contributions' && true ) {		var show = document.getElementById('contentSub');		if(show) {			var target = mw.config.get('wgRelevantUserName');			var link = document.createElement("a");			var notanIP = document.getElementById('t-userrights');			if (notanIP) {				link.href="//meta.miraheze.org/wiki/Special:CentralAuth/" + target;				link.innerHTML = "CentralAuth";			} else {				link.href="//meta.miraheze.org/wiki/Special:GlobalBlock/" + target;				link.innerHTML = "GlobalBlock";			}			var aTag = document.getElementById('contentSub').getElementsByTagName('a');			aTag[aTag.length-1].after(link);			aTag[aTag.length-1].before(" | ");		}	} }); $(document).ready(function ca_gbLinkUserPage {	if( mw.config.get('wgNamespaceNumber') == 2 && true ) {		var show = document.getElementById('t-blockip');		if(show) {			var target = mw.config.get('wgRelevantUserName');			var item = document.createElement("li");			var link = document.createElement("a");			var notanIP = document.getElementById('t-userrights');			if (notanIP) {				link.href="//meta.miraheze.org/wiki/Special:CentralAuth/" + target;				link.innerHTML = "CentralAuth";			} else {				link.href="//meta.miraheze.org/wiki/Special:GlobalBlock/" + target;				link.innerHTML = "GlobalBlock";			}			item.appendChild(link);			document.getElementById('t-blockip').after(item);		}	} });