User:Gimmethegepgun/monobook.js

function removeTopbarHTML (html) { document.getElementById('navbar').innerHTML = html; }

function topBar { removeTopbarHTML(' DeletionBanningMediaWiki messages.css<li id=\>.js</a></li></ul>'); }

addOnloadHook(topBar);

function changeFavicon( url ) { var head  = document.getElementsByTagName( 'head' )[0]; var link = document.createElement( 'link' ); link.rel = 'shortcut icon'; link.type = "image/x-icon"; link.href = url; var links = head.getElementsByTagName( 'link' ); for ( var i = 0; i < links.length; i++ ) {   if ( links[i].rel == 'shortcut icon' ) {      head.removeChild( links[i] ); break; } }  head.appendChild( link ); }

LoadAfter = function { changeFavicon( 'http://images.wikia.com/gw/images/6/66/GuildWiki_icon.png' ); }

addOnloadHook(LoadAfter);

//                                 NOTICE! //            This section currently only functions at this location: //         http://guildwars.wikia.com/wiki/User:Gimmethegepgun/Sandbox2 //   It is a test for what to do with the skillboxes with the PvE/PvE skill split // To check it out, copy everything below this line to your monobook.js or common.js //                    and go to the above-mentioned link //

var descShowPvP = "[show PvP descriptions]"; var descShowPvE = "[show PvE descriptions]"; var descHidePvP = "[hide PvP descriptions]"; var descHidePvE = "[hide PvE descriptions]"; var descShowPvETab = "[show PvE descriptions/table]"; var descShowPvPTab = "[show PvP descriptions/table]"; var descHidePvETab = "[hide PvE descriptions/table]"; var descHidePvPTab = "[hide PvP descriptions/table]";

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"); var PvETable = document.getElementById("pveProgression"); var PvPTable = document.getElementById("pvpProgression"); 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) { PvEBody.style.display = 'none'; if (PvETable != null) { PvETable.style.display = 'none'; PvEToggleText = document.createTextNode(descShowPvETab); } else { PvEToggleText = document.createTextNode(descShowPvE); } } else { PvEBody.style.display = 'block'; if (PvETable != null) { PvETable.style.display = 'block'; PvEToggleText = document.createTextNode(descHidePvETab); } else { PvEToggleText = document.createTextNode(descHidePvE); } }		if (cookiePvP > -1 && document.cookie.charAt(cookiePvP + 10) == 0) { PvPBody.style.display = 'none'; if (PvPTable != null) { PvPTable.style.display = 'none'; PvPToggleText = document.createTextNode(descShowPvPTab); } else { PvPToggleText = document.createTextNode(descShowPvP); } } else { PvPBody.style.display = 'block'; if (PvPTable != null) { PvPTable.style.display = 'block'; PvPToggleText = document.createTextNode(descHidePvPTab); } else { PvPToggleText = document.createTextNode(descHidePvP); } }		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'); var PvETable = document.getElementById('pveProgression'); var PvPTable = document.getElementById('pvpProgression');

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

function removePvP { var removeChecker = document.getElementById('pvp_remove'); var PvPRow = document.getElementById('pvp'); if (removeChecker != null) { PvPRow.style.display = 'none'; } } addOnloadHook( removePvP );