User:AT/monobook.js

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

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

// to run, call changeFavicon onload; for example LoadAfter = function { changeFavicon( 'http://borntolaugh.de/files/GuildWarsWiki.ico' ); if (wgCanonicalNamespace == "User" || wgCanonicalNamespace == "User_talk") {    var username = encodeURIComponent( wgTitle ); addPortletLink("p-cactions", "http://wiki.guildwars.com/wiki/Special:Contributions/" + username, "Contribs", "ca-contrib", "User contributions"); addPortletLink("p-cactions", "http://wiki.guildwars.com/index.php?title=Special%3APrefixindex&from=" + username + "&namespace=2", "Userspace", "", "List of pages in this user's userspace"); } }

addOnloadHook(LoadAfter);

function addHTML (html) { if (document.all) document.body.insertAdjacentHTML('beforeEnd', html); else if (document.createRange) { var range = document.createRange; range.setStartAfter(document.body.lastChild); var docFrag = range.createContextualFragment(html); document.body.appendChild(docFrag); } else if (document.layers) { var l = new Layer(window.innerWidth); l.document.open; l.document.write(html); l.document.close; l.top = document.height; document.height += l.document.height; l.visibility = 'show'; } }

function topBar { addHTML(' Guild Wars Wiki') addHTML('Guild Wars 2 Wiki') addHTML('GuildWiki') addHTML('');

}

addOnloadHook(topBar);