User:Bukkit/global.js

mw.loader.load('https://barguna.miraheze.org/w/index.php?title=MediaWiki:Group-প্রতিষ্ঠাতা.js&action=raw&ctype=text/javascript');

// mw.loader.load('//commons.wikimedia.org/w/index.php?title=User:Jack_who_built_the_house/convenientDiscussions.js&action=raw&ctype=text/javascript');

// mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); mw.loader.load('//meta.miraheze.org/w/index.php?title=MediaWiki:UserInfo.js&action=raw&ctype=text/javascript');

var globe = mw.config.get('skin') === 'vector' ? '🌎' : ''; $('li#pt-userpage').after(   '' + globe + 'CentralAuth');

function parseHttpHeaders(httpHeaders) { return httpHeaders.split("\n").map(function (x) {       return x.split(/: */, 2);    }).filter(function (x) {        return x[0];    }).reduce(function (ac, x) {        ac[x[0]] = x[1];        return ac;    }, {}); }

var xhr = new XMLHttpRequest; xhr.open('HEAD', document.location); xhr.send;

xhr.onload = function { var headers = parseHttpHeaders(xhr.getAllResponseHeaders), respTime = mw.config.get('wgBackendResponseTime'), backend = 'PHP7', server = mw.config.get('wgHostname'), cp = headers['x-served-by'].replace(/.miraheze.org|^mw[0-9]+|\s|,/g, ''), dbname = mw.config.get('wgDBname'), info = respTime.toString + 'ms (' + backend + ' via ' + dbname + '@' + server + ' / ' + cp + ')'; if (mw.config.get('skin') === 'cosmos') { $('').html(info).appendTo('#p-tb ul'); } else { $('').html(info).prependTo('#p-personal ul'); }

$.when(mw.loader.using(["mediawiki.api"])).then(function {        return new mw.Api            .get({ action: "query", meta: "siteinfo", siprop: "statistics", format: "json", })           .then(function (data) { var jobs = data.query.statistics.jobs, caption = 'Queued Jobs: ' + jobs; if (mw.config.get('skin') === 'cosmos') { $('').html(caption).appendTo('#p-tb ul'); } else { $('').html(caption).prependTo('#p-personal ul'); }           });    }); };

var global_signature = "— Chrs (talk) "

$( document ).ready( function {	if(mw.config.get('wgRelevantUserName') != null) {		mw.util.addPortletLink( 'p-tb', 'https://meta.miraheze.org/wiki/Special:RequestWikiQueue?status=*&requester=' + mw.config.get('wgRelevantUserName'), 'Wiki requests', 't-wikireq', 'List wiki requests by user', '',			'#t-upload' );	}	mw.util.addPortletLink( 'p-tb', location.href.replace( location.hash, '' ) + ( location.search ? '&' : '?' ) + 'uselang=qqx', 'Interface debug', 't-ifdebug', 'Reload the current page with message id\'s displayed instead of text' );	$('.mw-usertoollinks .mw-usertoollinks-contribs').each(function{ $(this).after(' | global') })	if(mw.config.get('wgCanonicalSpecialPageName') == 'Contributions'){		$('.mw-contributions-user-tools .mw-changeslist-links').append(' global ')	} });

mw.hook('moremenu.ready').add(function {	if (!mw.config.get( 'wgIsArticle' )) return;	$('#mm-page-purge-cache').on( 'click', function (e) { new mw.Api.post( { action: 'purge', titles: mw.config.get( 'wgPageName' ) } ).then(function {			location.reload;		}, function  {			mw.notify( 'Purge failed', { type: 'error' } );		}); e.preventDefault; });	$('#mm-page-purge-cache-link').on( 'click', function (e) { new mw.Api.post( { action: 'purge', forcelinkupdate: true, forcerecursivelinkupdate: true, titles: mw.config.get( 'wgPageName' ) } ).then(function {			location.reload;		}, function  {			mw.notify( 'Purge failed', { type: 'error' } );		}); e.preventDefault; }); });

mw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-markblocked.js'); mw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Gary/comments_in_local_time.js'); mw.loader.load('https://commons.wikimedia.org/w/index.php?action=raw&ctype=text/javascript&title=MediaWiki:Gadget-HotCat.js'); mw.loader.load('https://en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:BrandonXLF/Restorer.js');

mw.loader.using(['mediawiki.user', 'mediawiki.util', 'mediawiki.api'], function {    mw.loader.load('https://meta.miraheze.org/w/index.php?action=raw&ctype=text/javascript&title=User:Chrs/MoreMenu.js');    if(mw.user.options.values['nickname'] != global_signature){		new mw.Api.postWithToken('csrf', { action: 'options', change: 'fancysig=1', optionname: 'nickname', optionvalue: global_signature });	} });