chase wrote:
Walling wrote:
Steve the Pirate wrote:
It's not a great way of doing it, but it works...
It seems that user scripts are disabled.
If you want user javascipt and css enabled I can do that. I'd rather figure out how wikipedia is doing it and implement that so everyone gets the same thing for the main page title hiding.
I'd use another implementation than javascript as well. I found this, maybe it is useful:
http://bugzilla.wikimedia.org/show_bug.cgi?id=6129 There is a patch file attached. I don't know how to apply it. It will hide the main page title for all users, when enabled in the configuration file. I researched a bit on enwiki and they are using a different method, one using javascript, but not the one posted here. They insert this code in the generated site script (don't know where it is generated from). I stripped out the irrelevant parts:
Code:
var mpTitle = "Main Page";
var isMainPage = (/(title=|\/wiki\/)([Tt]alk:|)[Mm]ain[ _][Pp]age/.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>');
}
}
What it does is to locate the main page (excluding diff views and talk page) and then hides it using dynamically generated css code. It is some kind of a "hack". Look up the code on line 334 of
this url.