Fixed web app text editor with IE.

Ylian Saint-Hilaire committed Feb 11, 2020 at 19:19 UTC 0d4754fba26c84306b80ead554e92089d1a54088
3 files changed +61 -4
package.json
+1 -1
@@ -1,6 +1,6 @@
1 {
2 "name": "meshcentral",
3 - "version": "0.4.9-c",
3 + "version": "0.4.9-d",
4 "keywords": [
5 "Remote Management",
6 "Intel AMT",
translate/translate.json
+21 -3
@@ -3486,7 +3486,7 @@
3486 "pt": "Erro de chamada",
3487 "ru": "Ошибка вызова",
3488 "xloc": [
3489 - "default.handlebars->25->1473"
3489 + "default.handlebars->25->1476"
3490 ]
3491 },
3492 {
@@ -8448,6 +8448,12 @@
8448 "default.handlebars->25->74"
8449 ]
8450 },
8451 + {
8452 + "en": "Illegal invocation",
8453 + "xloc": [
8454 + "default.handlebars->25->1474"
8455 + ]
8456 + },
8457 {
8458 "cs": "Kódovaní obrazu",
8459 "de": "Bildkodierung",
@@ -9985,7 +9991,7 @@
9991 "pt": "Menos",
9992 "ru": "Меньше",
9993 "xloc": [
9988 - "default.handlebars->25->1475"
9994 + "default.handlebars->25->1478"
9995 ]
9996 },
9997 {
@@ -11537,7 +11543,7 @@
11543 "pt": "Mais",
11544 "ru": "Еще",
11545 "xloc": [
11540 - "default.handlebars->25->1474"
11546 + "default.handlebars->25->1477"
11547 ]
11548 },
11549 {
@@ -20014,6 +20020,12 @@
20020 "default.handlebars->25->407"
20021 ]
20022 },
20023 + {
20024 + "en": "encoding",
20025 + "xloc": [
20026 + "default.handlebars->25->1473"
20027 + ]
20028 + },
20029 {
20030 "cs": "eventslist.csv",
20031 "en": "eventslist.csv",
@@ -20352,6 +20364,12 @@
20364 "default.handlebars->25->411"
20365 ]
20366 },
20367 + {
20368 + "en": "undefined",
20369 + "xloc": [
20370 + "default.handlebars->25->1475"
20371 + ]
20372 + },
20373 {
20374 "cs": "uživatel:",
20375 "en": "user:",
views/default.handlebars
+39
@@ -10977,6 +10977,45 @@
10977 // Generic methods
10978 //
10979
10980 + // Converts string to UTF8 byte array, polyfill for IE.
10981 + if (typeof TextEncoder === 'undefined') {
10982 + window.TextEncoder=function TextEncoder(){};
10983 + TextEncoder.prototype.encode = function encode(str) {
10984 + 'use strict';
10985 + var Len = str.length, resPos = -1;
10986 + var resArr = typeof Uint8Array === 'undefined' ? new Array(Len * 1.5) : new Uint8Array(Len * 3);
10987 + for (var point=0, nextcode=0, i = 0; i !== Len; ) {
10988 + point = str.charCodeAt(i), i += 1;
10989 + if (point >= 0xD800 && point <= 0xDBFF) {
10990 + if (i === Len) { resArr[resPos += 1] = 0xef; resArr[resPos += 1] = 0xbf; resArr[resPos += 1] = 0xbd; break; }
10991 + nextcode = str.charCodeAt(i);
10992 + if (nextcode >= 0xDC00 && nextcode <= 0xDFFF) {
10993 + point = (point - 0xD800) * 0x400 + nextcode - 0xDC00 + 0x10000;
10994 + i += 1;
10995 + if (point > 0xffff) { resArr[resPos += 1] = (0x1e<<3) | (point>>>18); resArr[resPos += 1] = (0x2<<6) | ((point>>>12)&0x3f); resArr[resPos += 1] = (0x2<<6) | ((point>>>6)&0x3f); resArr[resPos += 1] = (0x2<<6) | (point&0x3f); continue; }
10996 + } else { resArr[resPos += 1] = 0xef; resArr[resPos += 1] = 0xbf; resArr[resPos += 1] = 0xbd; continue; }
10997 + }
10998 + if (point <= 0x007f) {
10999 + resArr[resPos += 1] = (0x0<<7) | point;
11000 + } else if (point <= 0x07ff) {
11001 + resArr[resPos += 1] = (0x6<<5) | (point>>>6); resArr[resPos += 1] = (0x2<<6) | (point&0x3f);
11002 + } else {
11003 + resArr[resPos += 1] = (0xe<<4) | (point>>>12); resArr[resPos += 1] = (0x2<<6) | ((point>>>6)&0x3f); resArr[resPos += 1] = (0x2<<6) | (point&0x3f);
11004 + }
11005 + }
11006 + if (typeof Uint8Array !== 'undefined') return resArr.subarray(0, resPos + 1);
11007 + resArr.length = resPos + 1;
11008 + return resArr;
11009 + };
11010 + TextEncoder.prototype.toString = function(){return '[object TextEncoder]'};
11011 + try {
11012 + Object.defineProperty(TextEncoder.prototype,"encoding",{
11013 + get:function(){ if(TextEncoder.prototype.isPrototypeOf(this)) return'utf-8'; else throw TypeError("Illegal invocation"); }
11014 + });
11015 + } catch(e) { TextEncoder.prototype.encoding = 'utf-8'; }
11016 + if (typeof Symbol!=="undefined")TextEncoder.prototype[Symbol.toStringTag]='TextEncoder';
11017 + }
11018 +
11019 function joinPaths() { var x = []; for (var i in arguments) { var w = arguments[i]; if ((w != null) && (w != '')) { while (w.endsWith('/') || w.endsWith('\\')) { w = w.substring(0, w.length - 1); } while (w.startsWith('/') || w.startsWith('\\')) { w = w.substring(1); } x.push(w); } } return x.join('/'); }
11020 function putstore(name, val) {
11021 try {