[Wylug-help] MediaWiki Title-Correcting JavaScript

Smylers Smylers at stripey.com
Wed Feb 21 16:46:05 GMT 2007


How can I configure a local MediaWiki installation to do the JavaScript
thing for fixing up the titles of pages that are otherwise displayed
wrongly?

MediaWiki treats the names of pages specially: the first character is
case-insensitive, displayed upper-case; and underscores are
interchangeable with spaces, displayed as spaces.  There's some
JavaScript which fixes this on displaying pages marked as such, for
example in:

  http://en.wikipedia.org/wiki/Mod_perl

there is this[*0, *1] in the HTML source::

  <div id="RealTitleBanner">
    The title of this article should be 
    <strong id="RealTitle">mod_perl</strong>.
    The initial letter is <a href="Majuscule">capitalized</a> and an
    <a href="Underscore">underscore</a> is substituted or omitted because of
    <a
    href="Wikipedia:Naming_conventions_%28technical_restrictions%29">technical
    restrictions</a>.
  </div>

Then some JavaScript runs which hides that message and tweaks the
contents of the <title> and <h1> elements to be the correct title.  The
JavaScript appears to be here in here -- search for "Technical
restrictions":

  http://en.wikipedia.org/w/index.php?title=-&action=raw&gen=js

The comments suggest that that is being included from a file called
Common.js.

Does anybody know where I can put that in a local installation to get
the same functionality?

Thanks.

Smylers

  [*0]  Actually the real mark-up is much worse than that, with lots of
  non-semantic style elements (and, even worse, <dd> elements being used
  for their presentational effects) which could trivially be performed
  by applying CSS to the elements that already have IDs and classes on
  them.  Given Wikipedia's prominence as a poster-child for the
  collective abilities of crowds I was surprised how bad this mark-up is.

  [*1]  But this has just taught me the word "majuscule", which is a
  nice bonus.



More information about the Wylug-help mailing list