Skillnad mellan versioner av "MediaWiki:Common.js"

Från Polkagriswiki
Hoppa till: navigering, sök
m
Rad 1: Rad 1:
 
/* JavaScript som skrivs här körs varje gång en användare laddar en sida. */
 
/* JavaScript som skrivs här körs varje gång en användare laddar en sida. */
  
var isMainPage = (document.title.substr(0, document.title.lastIndexOf(" - ")) == "Main Page");
+
/**
var isDiff = (document.location.search &&
+
  * Dölja h1 på huvudsidan
                (document.location.search.indexOf("diff=") != -1 ||
+
  */
                    document.location.search.indexOf("oldid=") != -1
+
  var mpTitle = "Portal:Huvudsida";
                )
+
  var isMainPage = (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 && !isDiff) {
+
  if (isMainPage && !isDiff)
    document.write('<style type="text/css">/*<![CDATA[*/ h1.firstHeading { display: none !important; } /*]]>*/</style>');
+
  {
}
+
      document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
 +
  }

Versionen från 22 juni 2008 kl. 16.48

/* JavaScript som skrivs här körs varje gång en användare laddar en sida. */

/**
   * Dölja h1 på huvudsidan 
   */
   var mpTitle = "Portal:Huvudsida";
   var isMainPage = (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 && !isDiff)
   {
       document.write('<style type="text/css">/*<![CDATA[*/ #lastmod, #siteSub, #contentSub, h1.firstHeading { display: none !important; } /*]]>*/</style>');
   }