User:Vili/monobook.js

/**** Guild Wars Wiki Tools * (c) 2007 by Patrick Westerhoff [poke] */ addScript( 'User:Poke/GuildWarsWikiTools.js' );

/* correct the favicon */ 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/64/Favicon.ico' ); }

addOnloadHook(LoadAfter);

gwwtLoadAfter = function { // navigation pCommandCenter = new PortletArea( 'p-commandcenter', 'Command Center', document.getElementById( 'p-navigation' ).nextSibling ); pCommandCenter.addItem( null, 'Deletion', '/wiki/Category:Candidates_for_deletion' ); pCommandCenter.addItem( null, 'Master Log', '/wiki/Special:Log' ); pCommandCenter.addItem( null, 'New Pages', '/wiki/Special:Newpages' ); pCommandCenter.addItem( null, 'New Images', '/wiki/Special:Newimages' ); pCommandCenter.addItem( null, 'Feedback Fail', '/wiki/Category:Malformed feedback pages' ); pCommandCenter.addItem( null, 'Block User', '/wiki/Special:Blockip' ); pCommandCenter.addItem( null, 'Prefix Index', '/wiki/Special:Prefixindex' ); pCommandCenter.addItem( null, 'User Rights', '/wiki/Special:Userrights' ); // tabs pCactions = new PortletArea( 'p-cactions' ); pCactions.addItem( null, 'purge', '/wiki/' + wgPageName + '?action=purge', 'Purge server cache' ) pCactions.addItem( null, 'credits', '/wiki/' + wgPageName + '?action=credits', 'Display article credits' ) pCactions.addItem( null, 'Gwiki', 'http://guildwars.wikia.com/wiki/Special:RecentChanges', 'Go to GuildWiki' ); pCactions.addItem( null, 'GW2W', 'http://wiki.guildwars2.com/wiki/Special:RecentChanges', 'Go to Guild Wars 2 Wiki' ); pCactions.addItem( null, 'PvX', 'http://pvx.wikia.com/wiki/Special:RecentChanges', 'Go to PvX Wiki' ); pCactions.addItem( null, 'YouTube', 'http://www.youtube.com/', 'Go to YouTube' );

// personal pPersonal = new PortletArea( 'p-personal' ); pPersonal.addItem( null, 'my feedback', '/wiki/Feedback:User/' +wgUserName, 'My feedback', null, document.getElementById( 'pt-preferences' ) );

// RC censorship clearRecentChanges; }

function clearRecentChanges {  if ( wgPageName !== 'Special:RecentChanges' ) return false; var removeNames = [ 'Example', ]; var removeWords = [ 'Feedback', ]; var i, li, lis, xpath, remove = new Array; xpath = '//div[@id="bodyContent"]//li[ '; xpath += 'contains( a[4]/@title, "' + removeNames.join( '" ) or contains( a[4]/@title, "' ) + '" ) or '; xpath += 'contains( a[1]/@title, "' + removeWords.join( '" ) or contains( a[1]/@title, "' ) + '" ) or '; xpath += 'contains( span[@class="comment"], "' + removeWords.join( '" ) or contains( span[@class="comment"], "' ) + '" ) ]'; lis   = document.evaluate( xpath, document, null, 4, null ); while( ( li = lis.iterateNext ) ) {    remove.push( li ); }  while( ( li = remove.pop ) ) {    li.parentNode.removeChild( li ); } }