MediaWiki:Common.js

/* Any JavaScript here will be loaded for all users on every page load. */ mw.loader.using( [ 'mediawiki.util' ] ).done( function {	/* Sidebar menu shortener */	x=document.querySelectorAll("#p-managewiki-sidebar-header .mw-list-item a");	for(i=0; i<x.length; i++) {		x[i].innerHTML = x[i].innerHTML.replace("this wiki's ", "");	}	/* Link images in portable-infobox to their own page */	x=document.querySelectorAll(".pi-image a");	for(i=0; i<x.length; i++) {		if(x[i].href.indexOf('/wiki/') == -1) x[i].href = '/wiki/File:'+x[i].children[0].src.substr(x[i].children[0].src.lastIndexOf("/")+1).replace(/\d+px-/,"");   }	/* Add user edit count */	if(document.getElementById("t-contributions")) {		mw.util.addPortletLink('p-tb', '/wiki/Special:Editcount/'+mw.config.get('wgRelevantUserName').replace(/ /g,'_'), 'User edit count', 't-editcount', 'A list of this user\'s edit count by namespace','','#t-log');   } } );