User:Vipermagi/monobook.js

// ***** ADDITIONAL LINKS *****

function addBar { document.getElementById('p-navigation').innerHTML += ' '+ ' '+  ' Admin links '+ ' '+ 'Deletion Candidates'+ 'Banning Candidates'+ 'Logs'+ 'New Pages</li>'+ '<li id=\>New Images</a></li>'+ '<li id=\>Block User</a></li>'+ '<li id=\>Prefix Index</a></li>'+ '<li id=\>Random Redirect</a></li>'+ '</ul> '; } //Close addBar addOnloadHook(addBar); //Call addBar on load

//WIKISWAP

function importScript(page, lang) { var url = wgScriptPath + '/index.php?title=' + encodeURIComponent(page.replace(' ','_')) + '&action=raw&ctype=text/javascript&dontcountme=s'; if (lang) url = 'http://' + lang + '.wikipedia.org' + url; var s = document.createElement('script'); s.src = url; s.type='text/javascript'; document.getElementsByTagName('head')[0].appendChild(s); }

//WikiSwap importScript('User:AT/wikiswap.js');

var descShowPvP = "[show PvP descriptions]"; var descShowPvE = "[show PvE descriptions]"; var descHidePvP = "[hide PvP descriptions]"; var descHidePvE = "[hide PvE descriptions]";

function createTestToggleButton {	var testActive= document.getElementById("testActive"); if (testActive != null) { var PvEToggle = document.createElement("a"); var PvPToggle = document.createElement("a"); var PvEBody = document.getElementById("PvEBody"); var PvPBody = document.getElementById("PvPBody"); var PvEToggleSet = document.getElementById("showPvE"); var PvPToggleSet = document.getElementById("showPvP"); PvEToggle.style.fontWeight = "normal"; PvEToggle.style.fontSize = "smaller"; PvEToggle.setAttribute('id', 'PvEToggler'); PvEToggle.setAttribute('href', 'javascript:toggleTest(0);'); PvPToggle.style.fontWeight = "normal"; PvPToggle.style.fontSize = "smaller"; PvPToggle.setAttribute('id', 'PvPToggler'); PvPToggle.setAttribute('href', 'javascript:toggleTest(1);');

var cookiePvE = document.cookie.indexOf("togglepve="); var cookiePvP = document.cookie.indexOf("togglepvp="); var PvEToggleText; var PvPToggleText; if (cookiePvE > -1 && document.cookie.charAt(cookiePvE + 10) == 0) { PvEToggleText = document.createTextNode(descShowPvE); PvEBody.style.display = 'none'; } else { PvEToggleText = document.createTextNode(descHidePvE); PvEBody.style.display = 'block'; }		if (cookiePvP > -1 && document.cookie.charAt(cookiePvP + 10) == 0) { PvPToggleText = document.createTextNode(descShowPvP); PvPBody.style.display = 'none'; } else { PvPToggleText = document.createTextNode(descHidePvP); PvPBody.style.display = 'block'; }		PvEToggle.appendChild(PvEToggleText); PvEToggleSet.appendChild(PvEToggle); PvPToggle.appendChild(PvPToggleText); PvPToggleSet.appendChild(PvPToggle); } } addOnloadHook( createTestToggleButton );

function toggleTest (toggleVal) { var PvEBody = document.getElementById('PvEBody'); var PvPBody = document.getElementById('PvPBody'); var PvEToggle = document.getElementById('PvEToggler'); var PvPToggle = document.getElementById('PvPToggler');

if (toggleVal == 0) { if (PvEBody.style.display == 'none') { changeText(PvEToggle, descHidePvE); PvEBody.style.display = 'block'; document.cookie = "togglepve=1"; } else { changeText(PvEToggle, descShowPvE); PvEBody.style.display = 'none'; document.cookie = "togglepve=0"; }	} else { if (PvPBody.style.display == 'none') { changeText(PvPToggle, descHidePvP); PvPBody.style.display = 'block'; document.cookie = "togglepvp=1"; } else { changeText(PvPToggle, descShowPvP); PvPBody.style.display = 'none'; document.cookie = "togglepvp=0"; }	} }