Page MenuHomePhabricator

Load ../wikibits.js before ../Monobook.js
Closed, ResolvedPublic

Description

Author: Wiki.Melancholie

Description:
Maybe there is a reason why wikibits.js is loaded after the Monobook.js is being
generated (see HTML source), but if not it would be good if the "global"
wikibits.js could be loaded before Monobook.js and User/monobook.js!

This would reduce redundancy, as this rendering order would offer us to use some
variables that are used in wikibits.js, and we especially could use the function
"hookEvent"; see the given URL.


Version: unspecified
Severity: normal
URL: http://als.wikipedia.org/w/index.php?title=MediaWiki%3AMonobook.js%2FArchiv-1&diff=36973&oldid=35902

Details

Reference
bz5236

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:07 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz5236.
bzimport added a subscriber: Unknown Object (MLST).

Ok, wikibits.js now loaded first.

Warning: previously cached pages have it the other way around, so be careful about
MediaWiki:Monobook.js. In your user JS you can be more wacky.

This is not good. The generated javascript file (/w/index.php?title=-&action=raw&gen=js) has to be
before wikibits.js: It generates the variables skin and stylepath, which are used in wikibits.js to
load browser specific css patches for Opera and KHTML - these are now not loaded.

By the way: Opera 9 supports the new CSS 3 selector ^=. So there should be a new Opera9Fixes.css, because
overwriting the normal stylesheet for external links results in having external.png behind every link
(also https, mailto etc.). In previous Opera versions this is fine, but for Opera 9 this is not good.

That would be a separate issue (eg, some variables being set in the wrong place).

Wiki.Melancholie wrote:

Christian Thiele is right.
At the top of http://en.wikipedia.org/w/index.php?title=-&action=raw&gen=js
there is var skin = 'monobook'; and var stylepath = '/skins-1.5';

Those variables are used in wikibits.js under "document.write special stylesheet
links"! Is there a better way of defining those two variables? Maybe directly in
the html source? Or could you separate the generated .js from Monobook.js in
some way?

Those definitely belong in the page source; putting them in a separate .js is unreliable,
and may be the cause of the bogus requests we see in logs, if one fails and the other
doesn't .

wiki.bugzilla wrote:

... just leaving a note here on a now separated bug:
Bug 5342 "Missing link icons in Opera"

Wiki.Melancholie wrote:

Bug 5355: "Put the JavaScript variables "skin" and "stylepath"
into the html page source"