User:Dromlexer/monobook.js

init;

var debug = true;

function init {	var t1 = 'globalWrapper'; var n = document.getElementById(t1); var nc = n.firstChild;

var t2 = 'column-one'; var c = document.getElementById(t2);

var a = document.createElement('div'); var b = 'jssidemenu'; a.setAttribute('id',b); n.appendChild(a); n.insertBefore(a, nc); var node = c.children; var ic = node.length; for (i = (ic - 1); i >= 0; i--) {		try {			if (node[i].id == "p-cactions" || node[i].id == "p-personal") {				if (debug) {					console.log("Ignore:", node[i].className, node[i].id, i, ic); }			}			else {				if (debug) {					console.log("Move:", node[i].className, node[i].id, a.id, i, ic); }				a.appendChild(node[i]); }		}		catch (e) {			console.log(e); }	}

// Due to the previous loop (above "for"). The order of the sidebar elements are reservered. Hence this loop and its' purpose is to correct it.// node = a.children; var ii= node.length; for (i = 0; i < 3; i++) {		if (node[i].id != "p-logo") {			a.insertBefore(node[i], node[ii]); ii--; }	} }