mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Merge 58b86ac762 into bb01f26f06
				
					
				
			This commit is contained in:
		@@ -133,7 +133,6 @@ module.exports = function(grunt) {
 | 
				
			|||||||
                src: [
 | 
					                src: [
 | 
				
			||||||
                    // Ensure editor source files are concatenated in
 | 
					                    // Ensure editor source files are concatenated in
 | 
				
			||||||
                    // the right order
 | 
					                    // 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/jquery-addons.js",
 | 
				
			||||||
                    "packages/node_modules/@node-red/editor-client/src/js/red.js",
 | 
					                    "packages/node_modules/@node-red/editor-client/src/js/red.js",
 | 
				
			||||||
                    "packages/node_modules/@node-red/editor-client/src/js/events.js",
 | 
					                    "packages/node_modules/@node-red/editor-client/src/js/events.js",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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<arrayLike.length;i++) {
 | 
					 | 
				
			||||||
                    result.push(arrayList[i]);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
            return result;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        if (new Set([0]).size === 0) {
 | 
					 | 
				
			||||||
            // IE does not support passing an iterable to Set constructor
 | 
					 | 
				
			||||||
            var _Set = Set;
 | 
					 | 
				
			||||||
            /*global Set:true */
 | 
					 | 
				
			||||||
            Set = function Set(iterable) {
 | 
					 | 
				
			||||||
                var set = new _Set();
 | 
					 | 
				
			||||||
                if (iterable) {
 | 
					 | 
				
			||||||
                    iterable.forEach(set.add, set);
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                return set;
 | 
					 | 
				
			||||||
            };
 | 
					 | 
				
			||||||
            Set.prototype = _Set.prototype;
 | 
					 | 
				
			||||||
            Set.prototype.constructor = Set;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
})();
 | 
					 | 
				
			||||||
@@ -34,16 +34,7 @@ RED.clipboard = (function() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function downloadData(file, data) {
 | 
					    function downloadData(file, data) {
 | 
				
			||||||
        if (window.navigator.msSaveBlob) {
 | 
					        const element = document.createElement('a');
 | 
				
			||||||
            // IE11 workaround
 | 
					 | 
				
			||||||
            // IE does not support data uri scheme for downloading data
 | 
					 | 
				
			||||||
            var blob = new Blob([data], {
 | 
					 | 
				
			||||||
                type: "data:application/json;charset=utf-8"
 | 
					 | 
				
			||||||
            });
 | 
					 | 
				
			||||||
            navigator.msSaveBlob(blob, file);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        else {
 | 
					 | 
				
			||||||
            var element = document.createElement('a');
 | 
					 | 
				
			||||||
        element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(data));
 | 
					        element.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(data));
 | 
				
			||||||
        element.setAttribute('download', file);
 | 
					        element.setAttribute('download', file);
 | 
				
			||||||
        element.style.display = 'none';
 | 
					        element.style.display = 'none';
 | 
				
			||||||
@@ -51,7 +42,6 @@ RED.clipboard = (function() {
 | 
				
			|||||||
        element.click();
 | 
					        element.click();
 | 
				
			||||||
        document.body.removeChild(element);
 | 
					        document.body.removeChild(element);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
    function setupDialogs() {
 | 
					    function setupDialogs() {
 | 
				
			||||||
        dialog = $('<div id="red-ui-clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
 | 
					        dialog = $('<div id="red-ui-clipboard-dialog" class="hide"><form class="dialog-form form-horizontal"></form></div>')
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user