User:Dr ishmael/monobook.js

// links for admins and bcrats

function addBar { document.getElementById('p-navigation').innerHTML += ' '+ ' '+  ' Command Center '+ ' '+ 'Deletion'+ 'Copyvio'+ 'Master Log'+ 'New Pages</li>'+ '<li id=\>New Images</a></li>'+ '<li id=\>Unused Images</a></li>'+ '<li id=\>Site Notice</a></li>'+ '</ul> '; }

addOnloadHook(addBar);

// add Purge

function addPurge {   var hist; var url; if (!(hist = document.getElementById('ca-history') )) return; if (!(url = hist.getElementsByTagName('a')[0] )) return; if (!(url = url.href )) return; addPortletLink('p-cactions', url.replace(/([?&]action=)history([&#]|$)/, '$1purge$2'),                  'purge', 'ca-purge', 'Purge server cache', '0'); }

addOnloadHook(addPurge);

/**** Guild Wars Wiki Tools - GuildWiki Switch * (c) 2007 by Patrick Westerhoff [poke] */ function gwwtGuildWikiSwitch {  if ( wgNamespaceNumber < 100 ) {    var itemNode = document.createElement( 'li' ); itemNode.appendChild( document.createElement( 'a' ) ); itemNode.lastChild.href = 'http://wiki.guildwars.com/wiki/' + wgCanonicalNamespace + ':' + encodeURIComponent( wgTitle ); itemNode.lastChild.title = 'See this page on Guild Wars Wiki'; itemNode.lastChild.appendChild( document.createTextNode( 'GWW' ) ); document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0].appendChild( itemNode ); } } hookEvent( 'load', gwwtGuildWikiSwitch );

var descShowFull = "[show full descriptions]"; var descShowCon = "[show concise descriptions]";

function createSkillDescToggleButton {	var descHead= document.getElementById("descHead"); // var descFull = document.getElementById('descFull'); // var descCon = document.getElementById('descCon');  // if (descHead && descFull && descCon) { var descToggle = document.createElement("a"); descToggle.style.textAlign= "right"; descToggle.style.fontWeight = "normal"; descToggle.style.fontSize = "smaller"; descToggle.setAttribute('id', 'descToggle'); descToggle.setAttribute('href', 'javascript:toggleSkillDesc;');

var cookiePos = document.cookie.indexOf("showconcise="); var descToggleText; if (cookiePos > -1 && document.cookie.charAt(cookiePos + 12) == 1) { // If showconcise is set, show the concise description... descToggleText = document.createTextNode(descShowFull); descFull.style.display = 'none'; descCon.style.display = 'block'; } else { // ...otherwise show the full description by default descToggleText = document.createTextNode(descShowCon); descFull.style.display = 'block'; descCon.style.display = 'none'; }		descToggle.appendChild(descToggleText); descHead.appendChild(descToggle); } } addOnloadHook( createSkillDescToggleButton );

function toggleSkillDesc { var descFull = document.getElementById('descFull'); // var descCon = document.getElementById('descCon');  // var toggleLink = document.getElementById('descToggle'); // 

if (descFull && descCon && toggleLink) { if (descFull.style.display == 'none') { changeText(toggleLink, "show concise descriptions"); descFull.style.display = 'block'; descCon.style.display = 'none'; document.cookie = "showconcise=0"; } else { changeText(toggleLink, "show full descriptions"); descFull.style.display = 'none'; descCon.style.display = 'block'; document.cookie = "showconcise=1"; }	} }