JS/IE8: deliver legacy jQuery for IE8

This patch makes IcingaWeb deliver a legacy jQuery version for IE8
as it is no longer supported in jQuery 2.x. JS for IE8 will not be
delivered minified to ease troubleshooting on that buggy platform.

fixes #5866
refs #6417
This commit is contained in:
Thomas Gelf 2014-06-12 17:33:28 +00:00
parent 0d15f24f05
commit 44a7aa6adb
3 changed files with 23 additions and 1 deletions

View File

@ -10,6 +10,8 @@ if (array_key_exists('_dev', $_GET)) {
$cssfile = 'css/icinga.min.css';
}
$ie8jsfile = 'js/icinga.ie8.js';
$isIframe = isset($_GET['_render']) && $_GET['_render'] === 'iframe';
$iframeClass = $isIframe ? ' iframe' : '';
@ -47,7 +49,12 @@ $iframeClass = $isIframe ? ' iframe' : '';
<div id="layout" class="default-layout">
<?= $this->render('body.phtml') ?>
</div>
<!--[if IE 8]>
<script type="text/javascript" src="<?= $this->href($ie8jsfile) ?>"></script>
<![endif]-->
<!--[if gt IE 8]><!-->
<script type="text/javascript" src="<?= $this->href($jsfile) ?>"></script>
<!--<![endif]-->
<script type="text/javascript">
var icinga = new Icinga({
baseUrl: '<?= $this->href('/') ?>'

View File

@ -47,6 +47,7 @@ $special = array(
'css/icinga.css',
'css/icinga.min.css',
'js/icinga.dev.js',
'js/icinga.ie8.js',
'js/icinga.min.js'
);
@ -72,6 +73,10 @@ if (in_array($path, $special)) {
JavaScript::sendMinified();
break;
case 'js/icinga.ie8.js':
JavaScript::sendForIe8();
break;
default:
return false;
}

View File

@ -22,11 +22,15 @@ class JavaScript
);
protected static $vendorFiles = array(
// 'js/vendor/jquery-1.11.0',
'js/vendor/jquery-2.1.0',
'js/vendor/jquery.sparkline'
);
protected static $ie8VendorFiles = array(
'js/vendor/jquery-1.11.0',
'js/vendor/jquery.sparkline'
);
public static function listModuleFiles()
{
$list = array();
@ -43,6 +47,12 @@ class JavaScript
return self::send(true);
}
public static function sendForIe8()
{
self::$vendorFiles = self::$ie8VendorFiles;
return self::send();
}
public static function send($minified = false)
{
header('Content-Type: application/javascript');