tab-indented plaintext of proposed functions, per http://test.wikipedia.org/w/index.php?title=MediaWiki_talk:Common.js&oldid=39798
This proposed version (5 functions with little redundancy, importScript(), importScriptURI(), importStylesheet(), importStylesheetURI(), and appendCSS() -- see attachment, sorry it isn't a patch) maintain full backward compatabilty with existing copies of importScript() and importStylesheet() (as used on the English Wikipedia), and fix a few bugs in IE and Safari as well. They have been tested on the following browsers:
- Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.5a) Gecko/20030728 Mozilla Firebird/0.6.1 (Windows 98)
- Mozilla/5.0 (X11; U; Linux i686; en-US; rv:188.8.131.52) Gecko/20080207 Ubuntu/7.10 (gutsy) Firefox/184.108.40.206 (Linux)
- Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008020507 Firefox/3.0b3pre (Linux)
- Mozilla/5.0 (X11; U; Linux i686; en-US; rv:220.127.116.11) Gecko/20071128 Iceweasel/18.104.22.168 (Debian-22.214.171.124-1) (Linux)
- Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:126.96.36.199) Gecko/20080201 Firefox/188.8.131.52 (Windows XP)
- Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; InfoPath.2) (Windows XP)
- Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.0.3705; .NET CLR 1.1.4322; rm ; .NET CLR 2.0.50727) (Win XP)
- Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-us) AppleWebKit/523.15.1 (KHTML, like Gecko) Version/3.0.4 Safari/523.15
- Opera/9.10 (Macintosh; Intel Mac OS X; U; en)
- Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:184.108.40.206) Gecko/20080201 Firefox/220.127.116.11
- Opera/8.5 (Macintosh; Intel Mac OS X; U; en)
The functions should be added near the top, but probably below function addOnloadHook() and function hookEvent().
The current attachment version is from http://test.wikipedia.org/w/index.php?title=MediaWiki_talk:Common.js&oldid=39798 (which differs from the tested version only in function names and appearance).