MediaWiki:Citizen.js

/* All JavaScript here will be loaded for users of the Citizen skin */ mw.loader.using( [ 'mediawiki.util' ] ).done( function {

/* Disable toggling sections when edit */ x=document.getElementsByClassName("mw-editsection"); for(i=0; i<x.length; i++) { x[i].getElementsByTagName("a")[0].onclick = function(e){ e.stopPropagation; }; }	/* Collapsible TOC */ x=document.querySelectorAll(".toc li .tocnumber"); for(i=0; i<x.length; i++) { x[i].onclick = function(e){ y = this.parentElement.parentElement.getElementsByTagName("ul"); if(y.length) { if(y[0].style.display == "block") { y[0].style.display = "none"; y[0].parentElement.classList.add("collapsed"); } else { y[0].style.display = "block"; y[0].parentElement.classList.remove("collapsed"); }			}		};	} } );