Skillnad mellan versioner av "MediaWiki:Common.js"
Från Polkagriswiki
Kurtake (Diskussion | bidrag) m (Ny 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 =...) |
Kurtake (Diskussion | bidrag) 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 isMainPage = (document.title.substr(0, document.title.lastIndexOf(" - ")) == "Main Page"); |
| − | var isDiff = (document.location.search && | + | var isDiff = (document.location.search && |
(document.location.search.indexOf("diff=") != -1 || | (document.location.search.indexOf("diff=") != -1 || | ||
document.location.search.indexOf("oldid=") != -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[*/ h1.firstHeading { display: none !important; } /*]]>*/</style>'); | ||
| − | } | + | } |
Versionen från 22 juni 2008 kl. 14.58
/* 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 &&
(document.location.search.indexOf("diff=") != -1 ||
document.location.search.indexOf("oldid=") != -1
)
);
if (isMainPage && !isDiff) {
document.write('<style type="text/css">/*<![CDATA[*/ h1.firstHeading { display: none !important; } /*]]>*/</style>');
}