diff --git a/application/layouts/scripts/external-logout.phtml b/application/layouts/scripts/external-logout.phtml index 19c35e4e2..19b7e32b9 100644 --- a/application/layouts/scripts/external-logout.phtml +++ b/application/layouts/scripts/external-logout.phtml @@ -16,7 +16,6 @@ $innerLayoutScript = $this->layout()->innerLayout . '.phtml'; - <?= $this->title ? $this->escape($this->title) : $this->defaultTitle ?> diff --git a/application/layouts/scripts/layout.phtml b/application/layouts/scripts/layout.phtml index 1800f2c15..880c2a9f1 100644 --- a/application/layouts/scripts/layout.phtml +++ b/application/layouts/scripts/layout.phtml @@ -28,7 +28,6 @@ $innerLayoutScript = $this->layout()->innerLayout . '.phtml'; - <?= $this->title ? $this->escape($this->title) . ' :: ' : '' ?><?= $this->defaultTitle ?> diff --git a/application/layouts/scripts/wrapped.phtml b/application/layouts/scripts/wrapped.phtml deleted file mode 100644 index 25a7cf2e4..000000000 --- a/application/layouts/scripts/wrapped.phtml +++ /dev/null @@ -1,10 +0,0 @@ - - - layout()->redirectUrl)): ?> - - - - - render('inline.phtml'); ?> - - \ No newline at end of file diff --git a/doc/02-Installation.md b/doc/02-Installation.md index c86bbfd19..5f75e4d6a 100644 --- a/doc/02-Installation.md +++ b/doc/02-Installation.md @@ -23,10 +23,6 @@ or sub-category here: If your desired browser and its version is showing up in green when visiting the respective link, it's probably okay to use it for Icinga Web 2. -!!! note - - Support for Internet Explorer will be completely dropped with version 2.11 - ## Upgrade In case you are upgrading from an older version of Icinga Web 2 diff --git a/doc/80-Upgrading.md b/doc/80-Upgrading.md index ca7490094..44dc60575 100644 --- a/doc/80-Upgrading.md +++ b/doc/80-Upgrading.md @@ -5,6 +5,7 @@ v2.6 to v2.8 requires to follow the instructions for v2.7 too. ## Upgrading to Icinga Web 2 2.11.x +* Support for Internet Explorer 11 has been removed. * The Vagrant file and all its assets have been removed. * The `IniStore` class has been removed due to the deprecation of the Preferences ini backend. * The `DbStore` class has been removed and its methods have been added to `PreferencesStore` class. diff --git a/library/Icinga/Application/webrouter.php b/library/Icinga/Application/webrouter.php index 9eb5bf6f8..d9ab30b4a 100644 --- a/library/Icinga/Application/webrouter.php +++ b/library/Icinga/Application/webrouter.php @@ -56,22 +56,18 @@ if (in_array($path, $special)) { switch ($path) { case 'css/icinga.css': - $forIe11 = (bool) preg_match('/Trident\/7.0;.*rv:11/', $_SERVER['HTTP_USER_AGENT']); - Stylesheet::send(false, $forIe11); + Stylesheet::send(); exit; case 'css/icinga.min.css': - $forIe11 = (bool) preg_match('/Trident\/7.0;.*rv:11/', $_SERVER['HTTP_USER_AGENT']); - Stylesheet::send(true, $forIe11); + Stylesheet::send(true); exit; case 'js/icinga.dev.js': - $forIe11 = (bool) preg_match('/Trident\/7.0;.*rv:11/', $_SERVER['HTTP_USER_AGENT']); - JavaScript::send(false, $forIe11); + JavaScript::send(); exit; case 'js/icinga.min.js': - $forIe11 = (bool) preg_match('/Trident\/7.0;.*rv:11/', $_SERVER['HTTP_USER_AGENT']); - JavaScript::sendMinified($forIe11); + JavaScript::sendMinified(); break; default: diff --git a/library/Icinga/Util/LessParser.php b/library/Icinga/Util/LessParser.php index 946b3f686..46aa061f5 100644 --- a/library/Icinga/Util/LessParser.php +++ b/library/Icinga/Util/LessParser.php @@ -10,14 +10,8 @@ require_once 'lessphp/lessc.inc.php'; class LessParser extends lessc { - /** - * @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject - * light mode calls - */ - public function __construct($disableModes = false) + public function __construct() { - if (! $disableModes) { - $this->setOption('plugins', [new Visitor()]); - } + $this->setOption('plugins', [new Visitor()]); } } diff --git a/library/Icinga/Web/Form.php b/library/Icinga/Web/Form.php index 079ec7947..b421849e6 100644 --- a/library/Icinga/Web/Form.php +++ b/library/Icinga/Web/Form.php @@ -1168,9 +1168,6 @@ class Form extends Zend_Form || $this->getUidDisabled() || $this->wasSent($formData) ) { - if (($frameUpload = (bool) $request->getUrl()->shift('_frameUpload', false))) { - $this->getView()->layout()->setLayout('wrapped'); - } $this->populate($formData); // Necessary to get isSubmitted() to work if (! $this->getSubmitLabel() || $this->isSubmitted()) { if ($this->isValid($formData) @@ -1192,10 +1189,8 @@ class Form extends Zend_Form $this->getResponse()->json() ->setSuccessData($message !== null ? array('message' => $message) : null) ->sendResponse(); - } elseif (! $frameUpload) { - $this->getResponse()->redirectAndExit($this->getRedirectUrl()); } else { - $this->getView()->layout()->redirectUrl = $this->getRedirectUrl()->getAbsoluteUrl(); + $this->getResponse()->redirectAndExit($this->getRedirectUrl()); } // TODO: Still bad. An api target must not behave as one if it's not an api request } elseif ($this->getIsApiTarget() || $this->getRequest()->isApiRequest()) { diff --git a/library/Icinga/Web/JavaScript.php b/library/Icinga/Web/JavaScript.php index 7d0eed8ec..1257ab73a 100644 --- a/library/Icinga/Web/JavaScript.php +++ b/library/Icinga/Web/JavaScript.php @@ -53,9 +53,9 @@ class JavaScript 'js/define.js' ]; - public static function sendMinified($forIe11 = false) + public static function sendMinified() { - self::send(true, $forIe11); + self::send(true); } /** @@ -65,7 +65,7 @@ class JavaScript * * @param bool $minified Whether to compress the client side script code */ - public static function send($minified = false, $forIe11 = false) + public static function send($minified = false) { header('Content-Type: application/javascript'); $basedir = Icinga::app()->getBootstrapDirectory(); @@ -91,11 +91,9 @@ class JavaScript $files[] = $filePath; } - if (! $forIe11) { - // Prepare library file list - foreach (Icinga::app()->getLibraries() as $library) { - $files = array_merge($files, $library->getJsAssets()); - } + // Prepare library file list + foreach (Icinga::app()->getLibraries() as $library) { + $files = array_merge($files, $library->getJsAssets()); } // Prepare core file list @@ -151,28 +149,26 @@ class JavaScript $baseJs .= file_get_contents($file) . "\n\n\n"; } - if (! $forIe11) { - // Library files need to be namespaced first before they can be included - foreach (Icinga::app()->getLibraries() as $library) { - foreach ($library->getJsAssets() as $file) { - $alreadyMinified = false; - if ($minified && file_exists(($minFile = substr($file, 0, -3) . '.min.js'))) { - $alreadyMinified = true; - $file = $minFile; - } + // Library files need to be namespaced first before they can be included + foreach (Icinga::app()->getLibraries() as $library) { + foreach ($library->getJsAssets() as $file) { + $alreadyMinified = false; + if ($minified && file_exists(($minFile = substr($file, 0, -3) . '.min.js'))) { + $alreadyMinified = true; + $file = $minFile; + } - $content = self::optimizeDefine( - file_get_contents($file), - $file, - $library->getJsAssetPath(), - $library->getName() - ); + $content = self::optimizeDefine( + file_get_contents($file), + $file, + $library->getJsAssetPath(), + $library->getName() + ); - if ($alreadyMinified) { - $out .= ';' . ltrim(trim($content), ';') . "\n"; - } else { - $js .= $content . "\n\n\n"; - } + if ($alreadyMinified) { + $out .= ';' . ltrim(trim($content), ';') . "\n"; + } else { + $js .= $content . "\n\n\n"; } } } diff --git a/library/Icinga/Web/LessCompiler.php b/library/Icinga/Web/LessCompiler.php index a47ca95af..1f72560bb 100644 --- a/library/Icinga/Web/LessCompiler.php +++ b/library/Icinga/Web/LessCompiler.php @@ -58,13 +58,10 @@ class LessCompiler /** * Create a new LESS compiler - * - * @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject - * light mode calls */ - public function __construct($disableModes = false) + public function __construct() { - $this->lessc = new LessParser($disableModes); + $this->lessc = new LessParser(); // Discourage usage of import because we're caching based on an explicit list of LESS files to compile $this->lessc->importDisabled = true; } diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index 02087302d..2b46b5d35 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -106,15 +106,12 @@ class StyleSheet /** * Create the StyleSheet - * - * @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject - * light mode calls */ - public function __construct($disableModes = false) + public function __construct() { $app = Icinga::app(); $this->app = $app; - $this->lessCompiler = new LessCompiler($disableModes); + $this->lessCompiler = new LessCompiler(); $this->pubPath = $app->getBaseDir('public'); $this->collect(); } @@ -224,13 +221,11 @@ class StyleSheet * * Does not cache the stylesheet if the HTTP header Cache-Control or Pragma is set to no-cache. * - * @param bool $minified Whether to compress the stylesheet - * @param bool $disableModes Disable replacing compiled Less colors with CSS var() function calls and don't inject - * light mode calls + * @param bool $minified Whether to compress the stylesheet */ - public static function send($minified = false, $disableModes = false) + public static function send($minified = false) { - $styleSheet = new self($disableModes); + $styleSheet = new self(); $request = $styleSheet->app->getRequest(); $response = $styleSheet->app->getResponse(); diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less index e2593b52c..b1ca8e65a 100644 --- a/public/css/icinga/layout-structure.less +++ b/public/css/icinga/layout-structure.less @@ -14,8 +14,6 @@ body { height: 100%; display: flex; flex-direction: column; - // Prevent nav-level-2 flyovers from being covered by #main - z-index: 0; } #content-wrapper { @@ -58,10 +56,6 @@ body { } } -#fileupload-frame-target { - display: none; -} - #responsive-debug { font-size: 0.9em; font-family: Courier new, monospace; diff --git a/public/css/icinga/main.less b/public/css/icinga/main.less index c6646151d..996ea33cf 100644 --- a/public/css/icinga/main.less +++ b/public/css/icinga/main.less @@ -340,13 +340,13 @@ a:hover > .icon-cancel { } > i.collapse-icon { - display: inline; + display: unset; } } .collapsible.collapsed + .collapsible-control button { > i.expand-icon { - display: inline; + display: unset; } > i.collapse-icon { diff --git a/public/css/icinga/menu.less b/public/css/icinga/menu.less index 7933b6358..98650a237 100644 --- a/public/css/icinga/menu.less +++ b/public/css/icinga/menu.less @@ -31,10 +31,6 @@ text-decoration: none; } } - - .nav-level-2 { - z-index: 1; - } } #layout:not(.sidebar-collapsed) #menu .nav-item > a:first-of-type { diff --git a/public/css/icinga/mixins.less b/public/css/icinga/mixins.less index e463c12f7..c6938d22b 100644 --- a/public/css/icinga/mixins.less +++ b/public/css/icinga/mixins.less @@ -86,12 +86,6 @@ to { opacity: 1; } } -/* IE */ -@-ms-keyframes fadein { - from { opacity: 0; } - to { opacity: 1; } -} - /* Opera < 12.1 */ @-o-keyframes fadein { from { opacity: 0; } diff --git a/public/js/helpers.js b/public/js/helpers.js index 306d02925..bcb273629 100644 --- a/public/js/helpers.js +++ b/public/js/helpers.js @@ -1,11 +1,5 @@ /*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */ -/* IE11 Polyfills */ - -if (window.NodeList && !NodeList.prototype.forEach) { - NodeList.prototype.forEach = Array.prototype.forEach; -} - /* jQuery Plugins */ (function ($) { diff --git a/public/js/icinga/behavior/actiontable.js b/public/js/icinga/behavior/actiontable.js index 0d4eee272..0f914f7d7 100644 --- a/public/js/icinga/behavior/actiontable.js +++ b/public/js/icinga/behavior/actiontable.js @@ -448,7 +448,6 @@ // the highest precedence before hrefs defined in the tr itself and regular links var $a = $('a[href].rowaction', el).first(); if ($a.length) { - // TODO: Find out whether we leak memory on IE with this: $(el).attr('href', $a.attr('href')); return; } @@ -461,11 +460,6 @@ } }); - // IE will not ignore user-select unless we cancel selectstart - $('table.action.multiselect tr, table.table-row-selectable.multiselect tr', container).each(function(idx, el) { - $(el).on('selectstart', false); - }); - // draw all active selections that have disappeared on reload _this.tables().each(function(i, el) { new Selection(el, _this.icinga).refresh(); diff --git a/public/js/icinga/behavior/collapsible.js b/public/js/icinga/behavior/collapsible.js index 498325fb2..6e4b4a371 100644 --- a/public/js/icinga/behavior/collapsible.js +++ b/public/js/icinga/behavior/collapsible.js @@ -67,7 +67,7 @@ var toCollapse = []; $.each(document.querySelectorAll('.collapsible'), function (_, collapsible) { - if ($(collapsible).is('.can-collapse')) { + if (collapsible.matches('.can-collapse')) { if (! _this.canCollapse(collapsible)) { var toggleSelector = collapsible.dataset.toggleElement; if (! toggleSelector) { @@ -98,7 +98,7 @@ Collapsible.prototype.onExpand = function(collapsiblePath) { var collapsible = $(collapsiblePath)[0]; - if (collapsible && $(collapsible).is('.can-collapse')) { + if (collapsible && collapsible.matches('.can-collapse')) { this.expand(collapsible); } }; @@ -134,7 +134,7 @@ _this.icinga.logger.error( '[Collapsible] Collapsible control has no associated .collapsible: ', $target[0]); } else if (typeof collapsible.dataset.noPersistence !== 'undefined') { - if ($(collapsible).is('.collapsed')) { + if (collapsible.matches('.collapsed')) { _this.expand(collapsible); } else { _this.collapse(collapsible, _this.calculateCollapsedHeight(collapsible)); @@ -200,9 +200,9 @@ return ''; } - if (collapsible.tagName === 'TABLE') { + if (collapsible.matches('table')) { return '> tbody > tr'; - } else if (collapsible.tagName === 'UL' || collapsible.tagName === 'OL') { + } else if (collapsible.matches('ul, ol')) { return '> li:not(.collapsible-control)'; } diff --git a/public/js/icinga/behavior/input-enrichment.js b/public/js/icinga/behavior/input-enrichment.js index 58df5e6c2..15409410a 100644 --- a/public/js/icinga/behavior/input-enrichment.js +++ b/public/js/icinga/behavior/input-enrichment.js @@ -24,7 +24,7 @@ * @param icinga * @constructor */ - var InputEnrichment = function (icinga) { + let InputEnrichment = function (icinga) { Icinga.EventListener.call(this, icinga); this.on('beforerender', '#main > .container, #modal-content', this.onBeforeRender, this); @@ -76,8 +76,8 @@ let inputs = event.target.querySelectorAll('[data-enrichment-type]'); // Remember current instances - inputs.forEach(function (input) { - var enrichment = _this._enrichments.get(input); + inputs.forEach((input) => { + let enrichment = _this._enrichments.get(input); if (enrichment) { _this._cachedEnrichments[_this.icinga.utils.getDomPath(input).join(' > ')] = enrichment; } @@ -95,9 +95,9 @@ if (autorefresh) { // Apply remembered instances - for (var inputPath in _this._cachedEnrichments) { - var enrichment = _this._cachedEnrichments[inputPath]; - var input = container.querySelector(inputPath); + for (let inputPath in _this._cachedEnrichments) { + let enrichment = _this._cachedEnrichments[inputPath]; + let input = container.querySelector(inputPath); if (input !== null) { enrichment.refresh(input); _this._enrichments.set(input, enrichment); @@ -110,9 +110,9 @@ } // Create new instances - var inputs = container.querySelectorAll('[data-enrichment-type]'); - inputs.forEach(function (input) { - var enrichment = _this._enrichments.get(input); + let inputs = container.querySelectorAll('[data-enrichment-type]'); + inputs.forEach((input) => { + let enrichment = _this._enrichments.get(input); if (! enrichment) { switch (input.dataset.enrichmentType) { case 'search-bar': diff --git a/public/js/icinga/storage.js b/public/js/icinga/storage.js index c48aea522..fa312d291 100644 --- a/public/js/icinga/storage.js +++ b/public/js/icinga/storage.js @@ -44,7 +44,7 @@ */ window.addEventListener('storage', function(event) { var url = icinga.utils.parseUrl(event.url); - if (! url.path.substring(0, icinga.config.baseUrl.length) === icinga.config.baseUrl) { + if (! url.path.startsWith(icinga.config.baseUrl)) { // A localStorage is shared between all paths on the same origin. // So we need to make sure it's us who made a change. return;