Commit 0a1c30ef authored by Stefan Galinski's avatar Stefan Galinski 🎮

[BUGFIX] editor not loaded in IE11

Fixes: #65567
parent c8feee41
......@@ -52,7 +52,7 @@ class Loader {
*
* @var array
*/
protected $tinymceConfiguration = array();
protected $tinymceConfiguration = [];
/**
* Initialization flag
......@@ -166,6 +166,9 @@ class Loader {
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/tinymce/tinymce.min.js';
$output = '<script type="text/javascript" src="' . $script . '"></script>';
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/WeakMap/WeakMap.js';
$output .= '<script type="text/javascript" src="' . $script . '"></script>';
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/MutationObserver/MutationObserver.js';
$output .= '<script type="text/javascript" src="' . $script . '"></script>';
......@@ -200,6 +203,9 @@ class Loader {
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/MutationObserver/MutationObserver.js';
$pageRenderer->addJsLibrary('MutationObserver', $script, 'text/javascript', FALSE, TRUE, '', TRUE);
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Contrib/WeakMap/WeakMap.js';
$pageRenderer->addJsLibrary('WeakMap', $script, 'text/javascript', FALSE, TRUE, '', TRUE);
$script = $GLOBALS['BACK_PATH'] . $pathToTinyMceExtension . 'Resources/Public/JavaScript/Loader.js';
$pageRenderer->addJsFile($script, 'text/javascript', FALSE, TRUE, '', TRUE);
......@@ -214,7 +220,7 @@ class Loader {
* @return array
*/
protected function prepareTinyMCEConfiguration($configuration) {
$configurationArray = array();
$configurationArray = [];
// try to resolve a potential TYPO3 file path
$configurationFile = GeneralUtility::getFileAbsFileName($configuration);
......
/*
* Copyright 2012 The Polymer Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
if (typeof WeakMap === 'undefined') {
(function() {
var defineProperty = Object.defineProperty;
var counter = Date.now() % 1e9;
var WeakMap = function() {
this.name = '__st' + (Math.random() * 1e9 >>> 0) + (counter++ + '__');
};
WeakMap.prototype = {
set: function(key, value) {
var entry = key[this.name];
if (entry && entry[0] === key)
entry[1] = value;
else
defineProperty(key, this.name, {value: [key, value], writable: true});
return this;
},
get: function(key) {
var entry;
return (entry = key[this.name]) && entry[0] === key ?
entry[1] : undefined;
},
delete: function(key) {
var entry = key[this.name];
if (!entry) return false;
var hasValue = entry[0] === key;
entry[0] = entry[1] = undefined;
return hasValue;
},
has: function(key) {
var entry = key[this.name];
if (!entry) return false;
return entry[0] === key;
}
};
window.WeakMap = WeakMap;
})();
}
......@@ -32,7 +32,7 @@ SG.TinyMceLoader = function(tinymce, options) {
return console.error('Couldn\'t load dependency tinyMCE, break here.');
}
if (!MutationObserver) {
if (!window.MutationObserver) {
return console.error('Couldn\'t load dependency MutationObserver, break here.')
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment