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++) {		x[i].href = '/wiki/File:'+x[i].children[0].src.substr(x[i].children[0].src.lastIndexOf("/")+1).replace("300px-","");   }	/* Add user edit count */	if(document.getElementById("t-contributions")) {		mw.util.addPortletLink('p-tb', 'Special:Editcount/'+mw.config.get('wgRelevantUserName'), 'User edit count', 't-editcount','');    } } );