User:Dacheatbot/monobook.js

From Homestar Runner Wiki

(Difference between revisions)
Jump to: navigation, search
(rv)
Line 39: Line 39:
  if ( window.addEventListener ) window.addEventListener( 'load', mysigLink, false );
  if ( window.addEventListener ) window.addEventListener( 'load', mysigLink, false );
  else if ( window.attachEvent ) window.attachEvent( 'onload', mysigLink );
  else if ( window.attachEvent ) window.attachEvent( 'onload', mysigLink );
-
 
-
monobook.jsInsertBefore = 'pt-logout';
 
-
function monobook.jsLink()
 
-
{
 
-
  var li = document.createElement( 'li' );
 
-
  li.id = 'pt-monobook.js';
 
-
  var a = document.createElement( 'a' );
 
-
  a.appendChild( document.createTextNode( 'monobook.js' ) );
 
-
  a.href = 'http://www.hrwiki.org/index.php/User:Dacheatbot/monobook.js'
 
-
  li.appendChild( a );
 
-
  if ( ! monobook.jsInsertBefore )
 
-
  {
 
-
      document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
 
-
  }
 
-
  else
 
-
  {
 
-
      var before = document.getElementById( monobook.jsInsertBefore );
 
-
      before.parentNode.insertBefore( li, before );
 
-
  }
 
-
}
 
-
if ( window.addEventListener ) window.addEventListener( 'load', monobook.jsLink, false );
 
-
else if ( window.attachEvent ) window.attachEvent( 'onload', monobook.jsLink );
 

Revision as of 02:47, 21 March 2006

 function addPurgeButton()
 {
     var href = document.location.href;
     {    
         var historyHref = document.getElementById( "ca-history" ).firstChild.href;
         var div = document.getElementById( "p-cactions" );
         var ul = div.getElementsByTagName( "ul" )[0];
         var newLi = document.createElement( "li" );
         var newA = document.createElement( "a" );
         newA.setAttribute( "href" , historyHref.replace( "=history" , "=purge" ) );
         var text = document.createTextNode( "purge" );
         newA.appendChild( text );
         newLi.appendChild( newA );
         ul.appendChild( newLi );
     }
 }
if ( window.addEventListener ) window.addEventListener( "load" , addPurgeButton , false );
else if ( window.attachEvent ) window.attachEvent( "onload", addPurgeButton );

 sigInsertBefore = 'pt-logout';
 function mysigLink()
 {
   var li = document.createElement( 'li' );
   li.id = 'pt-mysig';
   var a = document.createElement( 'a' );
   a.appendChild( document.createTextNode( 'my sig' ) );
   a.href = 'http://www.hrwiki.org/index.php/User:Dacheatbot/sig'
   li.appendChild( a );
   if ( ! sigInsertBefore )
   {
      document.getElementById( 'pt-logout' ).parentNode.appendChild( li );
   }
   else
   {
       var before = document.getElementById( sigInsertBefore );
       before.parentNode.insertBefore( li, before );
   }
 }
 if ( window.addEventListener ) window.addEventListener( 'load', mysigLink, false );
 else if ( window.attachEvent ) window.attachEvent( 'onload', mysigLink );
Personal tools