From e4cb5d4be79be785c5f70ed9bdc2bef23d995dbe Mon Sep 17 00:00:00 2001 From: Alex Z Date: Wed, 8 Jul 2009 04:52:22 +0000 Subject: [PATCH] Make importScriptURI() use a in all cases. 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 | 2 +- skins/common/wikibits.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 59ca34e9c7..7890a533f7 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -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: diff --git a/skins/common/wikibits.js b/skins/common/wikibits.js index b81196f33e..ce61ca88a9 100644 --- a/skins/common/wikibits.js +++ b/skins/common/wikibits.js @@ -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) { -- 2.20.1