Difference between revisions of "MediaWiki:Common.js"

From CSLabsWiki
(Changed the Main Page title removal script. The old one seemed to have stopped working.)
m (;-D)
Line 3: Line 3:
   
 
function clearMainPage(){
 
function clearMainPage(){
if (wgTitle == 'Main Page') {
+
if (wgTitle == 'Main Page' || wgTitle == 'User:Lewisrj') {
 
var h1tags = document.getElementsByTagName("h1");
 
var h1tags = document.getElementsByTagName("h1");
 
var h = h1tags[0];
 
var h = h1tags[0];

Revision as of 15:29, 8 July 2009

/* Any JavaScript here will be loaded for all users on every page load. */
//BEGIN remove Main Page title

function clearMainPage(){
     if (wgTitle == 'Main Page' || wgTitle == 'User:Lewisrj') {
          var h1tags = document.getElementsByTagName("h1");
          var h = h1tags[0];
          var parent = h.parentNode;

          parent.removeChild(h);
     }
}

addOnloadHook(clearMainPage);

//END remove Main Page title