Last modified: 2011-04-06 22:06:51 UTC
Also, wikibits.js might be a useful js to include with action=render for things like custom mini static dumps, and such.
Created attachment 6384 [details]
Example patch of wikibits.js without global requirements
Here is an example patch to make wikibits.js not fail without globals.
The stylepath change is a bit concerning, but a null stylepath here shouldn't really cause problems (or rather, any /more/ problems than that of the JS being totally broken).
A better solution would be to replace cases of 'stylepath' calls in sorttable with a dummy variable assigned to the value of stylepth (or null if undefined), maybe.
Random note before I forget - the stylepath line should be either:
if (typeof stylepath == 'undefined') var stylepath = "";
or this shorter version (from Splarka):
var stylepath = stylepath || "";
* wikbits.js is already deprecated, up to be quarantined in 1.19 into mw.legacy
* global wg* variables are also deprecated and moved to mw.config, currently still shadowed to the global space as well for backwards compatibility. All usage in core is or soon will be replaced.
One of the advantages to mw.config is that it wont cause any 'undefined' errors (takes care of that internally through the mw.Map() constructor)