User:Y2K/monobook.js

From Homestar Runner Wiki

< User:Y2K(Difference between revisions)
Jump to: navigation, search
(Removed random logo, as the new logo discussion seems to have ended.)
 
(includes 2 intermediate revisions)
Line 1: Line 1:
-
// Adds a purge tab. Found this on Lapper's JS.
+
// import [[wikipedia:User:Year2000Prob/monobook.js]]
-
function addPurgeButton()
+
document.write('<script type="text/javascript" src="'
-
{
+
+ 'http://en.wikipedia.org/w/index.php?title=User:Year2000Prob/monobook.js'
-
  var href = document.location.href;
+
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
-
  {
+
-
    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 );
+

Current revision as of 08:49, 5 August 2008

// import [[wikipedia:User:Year2000Prob/monobook.js]]
document.write('<script type="text/javascript" src="'
+ 'http://en.wikipedia.org/w/index.php?title=User:Year2000Prob/monobook.js'
+ '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
Personal tools