User:Sktbrd341/monobook.js

/**** Guild Wars Wiki Tools * (c) 2007 by Patrick Westerhoff [poke] */ var head = document.getElementsByTagName( 'head' )[0]; head.appendChild( document.createElement( 'script' ) ); head.lastChild.src = '/index.php?title=User:Poke/GuildWarsWikiTools.js&action=raw&ctype=text/javascript'; head.lastChild.type = 'text/javascript';

//This script is being used with permission from Ale_jrb. //Function addPortleteLink written by Ale_jrb.

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); }

// addPortletLink can't be imported either :( function addPortletLink(portlet, href, text, id, tooltip, accesskey, nextnode) {   var node = document.getElementById(portlet);    if ( !node ) return null;        node = node.getElementsByTagName( "ul" )[0];    if ( !node ) return null;        var link = document.createElement( "a" );        link.appendChild( document.createTextNode( text ) );        link.href = href;        var item = document.createElement( "li" );        item.appendChild( link );    if ( id ) item.id = id;    if ( accesskey ) {        link.setAttribute( "accesskey", accesskey );        tooltip += " ["+accesskey+"]";    }    if ( tooltip ) {        link.setAttribute( "title", tooltip );    }    if ( accesskey && tooltip ) {        updateTooltipAccessKeys( new Array( link ) );    }    if ( nextnode && nextnode.parentNode == node )        node.insertBefore( item, nextnode ); else node.appendChild( item ); // IE compatibility (?) return item; }

// This function handles adding the extra protlet to the sidebar. function addBar { document.getElementById('p-navigation').innerHTML += ' '+   ' '+    ' Quick Links '+ ' '+ 'Quest Project' + 'Prophecies' + 'Factions' + 'Nightfall</li>' + '<a href=\"/wiki/Guild_Wars_Wiki:Projects/Quests/Eye of the North">GW:EN</a></li>' + '</ul> '; }

addOnloadHook(addBar);