User:PC-XT/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)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
PCXT={
	oldid:(location.search.match(/[?&]oldid=([^&]*)(&|$)/)||['',''])[1],
	curid:mw.config.get("wgRevisionId")||mw.config.get("wgCurRevisionId")+"|cur"
};if(PCXT.oldid)if(PCXT.oldid==parseInt(PCXT.curid))PCXT.oldid='';else PCXT.oldid+='/';
(function(){
	//[[Special:Diff/PermaLink]]
	var p=mw.config.get("wgPageName"),t=document.createElement("span");
	t.style.fontSize="8pt";
	t.style.display="inline-block";
	t.appendChild(document.createTextNode("[[Special:Diff/"+PCXT.oldid+PCXT.curid+"]]"));
	t.appendChild(document.createElement("br"));
	t.appendChild(document.createTextNode("[[Special:PermaLink/"+PCXT.curid+"]]"));
	document.getElementById('firstHeading').appendChild(t);
	mw.util.addPortletLink('p-tb','/wiki/Special:PrefixIndex/'+p,'PrefixIndex','Special-PrefixIndex');
	t=p.split('/');t.length--;
	if(t.length)mw.util.addPortletLink('p-tb','/wiki/Special:PrefixIndex/'+t.join('/')+'/','PrefixIndex/../','Special-PrefixIndex2');
	t=location.host.split('.');
	mw.util.addPortletLink('p-tb','http://wikipedia.ramselehof.de/wikiblame.php?user_lang=en&lang='+t[0]+'&project='+t[1]+'&article='+p,'WikiBlame','WikiBlame');
})();

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