Make importScriptURI() use a <link> in all cases.
authorAlex Z <mrzman@users.mediawiki.org>
Wed, 8 Jul 2009 04:52:22 +0000 (04:52 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Wed, 8 Jul 2009 04:52:22 +0000 (04:52 +0000)
Previously it used document.createStyleSheet for IE (which appears to be the only browser that supports it) or @import for everything else

includes/DefaultSettings.php
skins/common/wikibits.js

index 59ca34e..7890a53 100644 (file)
@@ -1523,7 +1523,7 @@ $wgCacheEpoch = '20030516000000';
  * to ensure that client-side caches do not keep obsolete copies of global
  * styles.
  */
-$wgStyleVersion = '228';
+$wgStyleVersion = '229';
 
 
 # Server-side caching:
index b81196f..ce61ca8 100644 (file)
@@ -73,8 +73,14 @@ function importStylesheet(page) {
        return importStylesheetURI(wgScript + '?action=raw&ctype=text/css&title=' + encodeURIComponent(page.replace(/ /g,'_')));
 }
  
-function importStylesheetURI(url) {
-       return document.createStyleSheet ? document.createStyleSheet(url) : appendCSS('@import "' + url + '";');
+function importStylesheetURI(url,media) {
+       var l = document.createElement('link');
+       l.type = 'text/css';
+       l.rel = 'stylesheet';
+       l.href = url;
+       if(media) l.media = media
+       document.getElementsByTagName('head')[0].appendChild(l);
+       return l;
 }
  
 function appendCSS(text) {