Home
About
Policies
FAQ
Forums
Registration
Password Recovery

MediaWiki:Common.js

From Tapestries MUCK

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
/* Hide the main page title */
+
var mpTitle = "Tapestries MUCK";
-
function hideMainPageTitle(e)
+
var isMainPage = (/(title=|\/wiki\/)([Tt]alk:|)[Tt]apestries[ _][Mm]uck/.test(document.location));
-
{
+
var isMainPageFront = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle);
-
e = (e) ? e : event;
+
var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 ||
-
var mainPageTitle = "Tapestries MUCK";
+
            document.location.search.indexOf("oldid=") != -1));
-
var headings = document.getElementsByTagName("h1");
+
-
var i, done = false;
+
if (isMainPage) {
-
for (i = 1; ((!done) && (i <= headings.length)); i++)
+
  if (isMainPageFront && !isDiff)
-
{
+
  {
-
if (headings[i - 1].className == "firstHeading")
+
    document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, ' +
-
{
+
                  'h1.firstHeading { display: none !important; } /*]]>*/</style>');
-
done = true;
+
  }
-
if ((headings[i - 1].innerHTML == mainPageTitle) && (document.getElementById("contentSub").innerHTML == ""))
+
-
{
+
-
headings[i - 1].style.display = "none";
+
-
document.getElementById("siteSub").style.display = "none";
+
-
document.getElementById("contentSub").style.display = "none";
+
}
}
-
}
 
-
}
 
-
}
 
-
window.onload = hideMainPageTitle;
 

Revision as of 10:37, 13 April 2007

var mpTitle = "Tapestries MUCK";
var isMainPage = (/(title=|\/wiki\/)([Tt]alk:|)[Tt]apestries[ _][Mm]uck/.test(document.location));
var isMainPageFront = (document.title.substr(0, document.title.lastIndexOf(" - ")) == mpTitle);
var isDiff = (document.location.search && (document.location.search.indexOf("diff=") != -1 ||
             document.location.search.indexOf("oldid=") != -1));
 
if (isMainPage) {
  if (isMainPageFront && !isDiff)
  {
    document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, ' +
                   'h1.firstHeading { display: none !important; } /*]]>*/</style>');
  }
}
Personal tools
Namespaces
Variants
Actions
navagation
information
wiki
Toolbox