From 58b86ac762b9bd1de9376d96ffeb4f9b72062bea Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 17 Jun 2024 18:43:24 +0200 Subject: [PATCH] fix(editor)!: remove Internet Explorer polyfill IE support was removed in node-red v3. --- Gruntfile.js | 1 - .../editor-client/src/js/polyfills.js | 56 ------------------- .../editor-client/src/js/ui/clipboard.js | 24 +++----- 3 files changed, 7 insertions(+), 74 deletions(-) delete mode 100644 packages/node_modules/@node-red/editor-client/src/js/polyfills.js diff --git a/Gruntfile.js b/Gruntfile.js index 05be6a58a..e4b664fb5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -133,7 +133,6 @@ module.exports = function(grunt) { src: [ // Ensure editor source files are concatenated in // the right order - "packages/node_modules/@node-red/editor-client/src/js/polyfills.js", "packages/node_modules/@node-red/editor-client/src/js/jquery-addons.js", "packages/node_modules/@node-red/editor-client/src/js/red.js", "packages/node_modules/@node-red/editor-client/src/js/events.js", diff --git a/packages/node_modules/@node-red/editor-client/src/js/polyfills.js b/packages/node_modules/@node-red/editor-client/src/js/polyfills.js deleted file mode 100644 index 100cd4913..000000000 --- a/packages/node_modules/@node-red/editor-client/src/js/polyfills.js +++ /dev/null @@ -1,56 +0,0 @@ -(function() { - var isIE11 = !!window.MSInputMethodContext && !!document.documentMode; - - if (isIE11) { - // IE11 DOMTokenList.toggle does not support the two-argument variety - window.DOMTokenList.prototype.toggle = function(cl,bo) { - if (arguments.length === 1) { - bo = !this.contains(cl); - } - this[!!bo?"add":"remove"](cl); - } - - // IE11 does not provide classList on SVGElements - if (! ("classList" in SVGElement.prototype)) { - Object.defineProperty(SVGElement.prototype, 'classList', Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'classList')); - } - - // IE11 does not provide children on SVGElements - if (! ("children" in SVGElement.prototype)) { - Object.defineProperty(SVGElement.prototype, 'children', Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'children')); - } - - Array.from = function() { - if (arguments.length > 1) { - throw new Error("Node-RED's IE11 Array.from polyfill doesn't support multiple arguments"); - } - var arrayLike = arguments[0] - var result = []; - if (arrayLike.forEach) { - arrayLike.forEach(function(i) { - result.push(i); - }) - } else { - for (var i=0;i