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

/**** 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://www.guildwiki.org/' + wgCanonicalNamespace + ':' + wgTitle; itemNode.lastChild.title = 'See this page on GuildWiki'; itemNode.lastChild.appendChild( document.createTextNode( 'GWiki' ) ); document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0].appendChild( itemNode ); } } hookEvent( 'load', gwwtGuildWikiSwitch );

function clearRecentChanges { if ( wgPageName !== 'Special:RecentChanges' ) return false; var rNames, rWords, xpath, snaps, snap; rNames = [ 'Manifold', 'J.P.' ]; rWords = [ 'Ursan', 'ursan' ]; xpath = '//div[@id="bodyContent"]//li/.. | //div[@id="bodyContent"]//li['; xpath += rNames.length > 0 ? './a[contains(@class,"mw-userlink")][contains(@title,"' + rNames.join( '") or contains(@title,"' ) + '")] or ' : ''; xpath += rWords.length > 0 ? 'contains(a[1]/@title,"' + rWords.join( '") or contains(a[1]/@title,"' ) + '") or ' : ''; xpath += rWords.length > 0 ? 'contains(span[@class="comment"],"' + rWords.join( '") or contains(span[@class="comment"],"' ) + '") or ' : ''; xpath += ' 0 ]'; snaps = document.evaluate( xpath, document, null, 6, null ); parent = snaps.snapshotItem( 0 ); for ( var i = 1; i < snaps.snapshotLength; i++ ) parent.removeChild( snaps.snapshotItem( i ) ); } hookEvent( 'load', clearRecentChanges);

/* function contribCount {  if ( wgNamespaceNumber < 100 ) {    var itemNode = document.createElement( 'li' ); itemNode.appendChild( document.createElement( 'a' ) ); itemNode.lastChild.href = 'javascript:addScript(\'User:Poke/GuildWarsWikiTools/ContributionCount.js\');void(0)'; itemNode.lastChild.title = 'See this page on GuildWiki'; itemNode.lastChild.appendChild( document.createTextNode( 'Cont' ) ); document.getElementById( 'p-cactions' ).getElementsByTagName( 'ul' )[0].appendChild( itemNode ); } } hookEvent( 'load', contribCount); var gwwtLoadAfter = function { ( new PortletArea( 'p-tb' ) ).addItem( null, 'contribution count', "javascript:addScript('User:Poke/GuildWarsWikiTools/ContributionCount.js');void(0);", null, null, document.getElementById( 'gwwt-del' ) ); }