User:Lord Belar/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';

hookEvent( 'load', function { var globalWrapper = document.getElementById( 'globalWrapper' );  var belarBox      = document.createElement( 'div' );  belarBox.style.position   = 'fixed';  belarBox.style.zIndex     = '1000';  belarBox.style.display    = 'none';  belarBox.style.top        = '3em';  belarBox.style.right      = '3em';  belarBox.style.border     = '1px solid silver';  belarBox.style.background = '#FFF';  belarBox.style.fontSize   = '90%';  belarBox.style.padding    = '2px 5px';  belarBox.innerHTML        = 'Lord Belar &middot; '                            + 'Talk &middot; '                            + 'Watchlist &middot; '                            + 'Noticeboard &middot; ' + 'RC &middot; ' + '.js &middot; ' + '.css &middot; ' + 'Sandbox'; globalWrapper.appendChild( document.createElement( 'div' ) ); globalWrapper.lastChild.style.position  = 'fixed'; globalWrapper.lastChild.style.zIndex    = '1000'; globalWrapper.lastChild.style.top       = '1px'; globalWrapper.lastChild.style.right     = '1px'; globalWrapper.lastChild.style.width     = '15px'; globalWrapper.lastChild.style.height    = '15px'; globalWrapper.lastChild.style.background = 'silver'; globalWrapper.lastChild.onclick         = function { belarBox.style.display = belarBox.style.display == 'none' ? 'block' : 'none'; } globalWrapper.appendChild( belarBox ); } );

//Line break.

gwwtLoadAfter = function { if ( wgAction == 'rollback' && document.getElementById( 'rollback-success' ) != null ) {   window.location.href = wgServer + wgScript + '?title=' + wgPageName; return; }

clearRecentChanges; } function clearRecentChanges {  if ( wgPageName !== 'Special:RecentChanges' ) return false; var removeNames = [ 'Inspired', 'Fall', 'Mtew', 'Shard' ]; var removeWords = [ 'GWWT', 'Guild:', 'deleted' ]; 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 ); } }

//Break.

if ((wgPageName == 'Special:RecentChanges') || (wgPageName == 'Special:Watchlist')) { setTimeout('window.location = window.location.href;', 30000); }