summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Flatz2014-12-10 16:58:02 +0100
committerDavid Flatz2014-12-10 16:58:02 +0100
commitd8990b87dba2105d4b772a45aaa8a3857dd0e509 (patch)
treee26e9892be9bf56c3ec28841df9a61f283b9f802
parent7c7ea13338e9a541fadd807c599eecadd6a962a7 (diff)
downloaditools-d8990b87dba2105d4b772a45aaa8a3857dd0e509.tar.gz
itools-d8990b87dba2105d4b772a45aaa8a3857dd0e509.tar.bz2
itools-d8990b87dba2105d4b772a45aaa8a3857dd0e509.zip
inject ie polyfils in css when browser is ie 8 or older
-rw-r--r--itjs.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/itjs.php b/itjs.php
index 6c8113d..83ea79a 100644
--- a/itjs.php
+++ b/itjs.php
@@ -59,6 +59,12 @@ else if (it::match('\.css', $file))
'([^/])\*(\w)' => '$1$2'),
$data
);
+ if ((($ie = it::match('MSIE (\d+)', $_SERVER['HTTP_USER_AGENT'])) && intval($ie) < 9) || EDC('iecompat'))
+ $data = it::replace(array(
+ '([;{]\s*)(background-size:[^;}])' => '\1behavior:url(/itjs/ie-backgroundsize-min.htc);\2',
+ '([;{]\s*)(border-radius:[^;}]*)' => '\1behavior:url(/itjs/ie-PIE.htc);\2'),
+ $data
+ );
}
else if (it::match('\.htc$', $file))
{