From d229f22d7889905a9d581f4131d437b7b87700e3 Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Sat, 7 Dec 2024 23:22:44 +0300 Subject: [PATCH 1/3] [main] fix for IE --- apps/common/main/lib/util/docserviceworker.js | 4 +++- apps/common/main/lib/util/htmlutils.js | 1 - apps/documenteditor/main/app.js | 2 +- apps/documenteditor/main/index.html.deploy | 2 +- apps/documenteditor/main/index_loader.html.deploy | 8 +++++++- apps/pdfeditor/main/app.js | 2 +- apps/pdfeditor/main/index.html.deploy | 3 ++- apps/pdfeditor/main/index_loader.html.deploy | 3 ++- apps/presentationeditor/main/app.js | 2 +- apps/presentationeditor/main/index.html.deploy | 5 ++++- apps/presentationeditor/main/index_loader.html.deploy | 5 ++++- apps/spreadsheeteditor/main/app.js | 2 +- apps/spreadsheeteditor/main/index.html.deploy | 2 +- apps/spreadsheeteditor/main/index_internal.html.deploy | 8 +++++++- apps/spreadsheeteditor/main/index_loader.html.deploy | 8 +++++++- apps/visioeditor/main/app.js | 2 +- apps/visioeditor/main/index.html.deploy | 5 ++++- apps/visioeditor/main/index_loader.html.deploy | 8 +++++++- 18 files changed, 54 insertions(+), 18 deletions(-) diff --git a/apps/common/main/lib/util/docserviceworker.js b/apps/common/main/lib/util/docserviceworker.js index dfad17a1ae..6b33f1ff66 100644 --- a/apps/common/main/lib/util/docserviceworker.js +++ b/apps/common/main/lib/util/docserviceworker.js @@ -10,7 +10,9 @@ }) .then(function (registrations) { //delete stale service workers - for (const registration of registrations) { + // for (const registration of registrations) { + for (let r in registrations) { + const registration = registrations[r]; if (registration !== reg && registration.active && registration.active.scriptURL.endsWith(serviceWorkerName)) { registration.unregister(); } diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index fc72cf69d2..81228ce1bb 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -29,7 +29,6 @@ * terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode * */ -const isIE = /msie|trident/i.test(navigator.userAgent); var checkLocalStorage = (function () { try { diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js index b6295a2d14..5627c996ce 100644 --- a/apps/documenteditor/main/app.js +++ b/apps/documenteditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: '../../', + baseUrl: window.customBaseUrl || '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/documenteditor/main/index.html.deploy b/apps/documenteditor/main/index.html.deploy index 91db987dfc..4ce41d4e83 100644 --- a/apps/documenteditor/main/index.html.deploy +++ b/apps/documenteditor/main/index.html.deploy @@ -421,7 +421,7 @@ diff --git a/apps/documenteditor/main/index_loader.html.deploy b/apps/documenteditor/main/index_loader.html.deploy index 4e3af3cca3..fb8eef7471 100644 --- a/apps/documenteditor/main/index_loader.html.deploy +++ b/apps/documenteditor/main/index_loader.html.deploy @@ -331,7 +331,13 @@
- + + diff --git a/apps/pdfeditor/main/app.js b/apps/pdfeditor/main/app.js index 9ff95990b5..067b8fcef3 100644 --- a/apps/pdfeditor/main/app.js +++ b/apps/pdfeditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: '../../', + baseUrl: window.customBaseUrl || '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/pdfeditor/main/index.html.deploy b/apps/pdfeditor/main/index.html.deploy index 3fa0161ea9..15030b5446 100644 --- a/apps/pdfeditor/main/index.html.deploy +++ b/apps/pdfeditor/main/index.html.deploy @@ -399,7 +399,8 @@ diff --git a/apps/presentationeditor/main/index_loader.html.deploy b/apps/presentationeditor/main/index_loader.html.deploy index 29a2e860c6..9fb49ac421 100644 --- a/apps/presentationeditor/main/index_loader.html.deploy +++ b/apps/presentationeditor/main/index_loader.html.deploy @@ -329,7 +329,10 @@
- + + diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index 2d01621973..f62cadddde 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: '../../', + baseUrl: window.customBaseUrl || '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/spreadsheeteditor/main/index.html.deploy b/apps/spreadsheeteditor/main/index.html.deploy index 1e7a84a4f7..0722af8bd0 100644 --- a/apps/spreadsheeteditor/main/index.html.deploy +++ b/apps/spreadsheeteditor/main/index.html.deploy @@ -463,7 +463,7 @@ diff --git a/apps/spreadsheeteditor/main/index_internal.html.deploy b/apps/spreadsheeteditor/main/index_internal.html.deploy index 50555025b1..b7cfd6b123 100644 --- a/apps/spreadsheeteditor/main/index_internal.html.deploy +++ b/apps/spreadsheeteditor/main/index_internal.html.deploy @@ -237,7 +237,13 @@
- + + diff --git a/apps/spreadsheeteditor/main/index_loader.html.deploy b/apps/spreadsheeteditor/main/index_loader.html.deploy index e045353ea7..b532452f57 100644 --- a/apps/spreadsheeteditor/main/index_loader.html.deploy +++ b/apps/spreadsheeteditor/main/index_loader.html.deploy @@ -331,7 +331,13 @@
- + + diff --git a/apps/visioeditor/main/app.js b/apps/visioeditor/main/app.js index 5213049f6c..ff827d7475 100644 --- a/apps/visioeditor/main/app.js +++ b/apps/visioeditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: '../../', + baseUrl: window.customBaseUrl || '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/visioeditor/main/index.html.deploy b/apps/visioeditor/main/index.html.deploy index f711736650..e5dc81b74c 100644 --- a/apps/visioeditor/main/index.html.deploy +++ b/apps/visioeditor/main/index.html.deploy @@ -436,7 +436,10 @@
- + + diff --git a/apps/visioeditor/main/index_loader.html.deploy b/apps/visioeditor/main/index_loader.html.deploy index 55012e70dc..669f840a10 100644 --- a/apps/visioeditor/main/index_loader.html.deploy +++ b/apps/visioeditor/main/index_loader.html.deploy @@ -324,7 +324,13 @@
- + + From c057bb38d6432e2fb88622c69275032d762a8bbc Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Mon, 9 Dec 2024 14:40:52 +0300 Subject: [PATCH 2/3] [main] debug --- apps/common/main/lib/util/htmlutils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/util/htmlutils.js b/apps/common/main/lib/util/htmlutils.js index 81228ce1bb..a5a7a31df6 100644 --- a/apps/common/main/lib/util/htmlutils.js +++ b/apps/common/main/lib/util/htmlutils.js @@ -60,7 +60,7 @@ if ( window.nativeprocvars && window.nativeprocvars.rtl !== undefined ) { else ui_rtl = true; } -if ( ui_rtl && !isIE ) { +if ( ui_rtl && isIEBrowser !== true ) { document.body.setAttribute('dir', 'rtl'); document.body.classList.add('rtl'); } @@ -86,7 +86,7 @@ function checkScaling() { } } - if ( !isIE ) { + if ( isIEBrowser !== true ) { matches = { 'pixel-ratio__2_5': 'screen and (-webkit-min-device-pixel-ratio: 2.25), screen and (min-resolution: 2.25dppx)', }; @@ -106,7 +106,7 @@ let svg_icons = ['./resources/img/iconssmall@2.5x.svg', window.Common = { Utils: { injectSvgIcons: function () { - if ( isIE ) return; + if ( isIEBrowser === true ) return; let runonce; // const el = document.querySelector('div.inlined-svg'); From 13665f10c67ad8ad76672f751958a945a2f862be Mon Sep 17 00:00:00 2001 From: maxkadushkin Date: Tue, 10 Dec 2024 01:21:52 +0300 Subject: [PATCH 3/3] [main] fix for IE --- apps/documenteditor/main/app.js | 2 +- apps/documenteditor/main/index.html.deploy | 8 +++++++- apps/documenteditor/main/index_loader.html.deploy | 10 ++++++++-- apps/pdfeditor/main/app.js | 2 +- apps/pdfeditor/main/index.html.deploy | 6 +++++- apps/pdfeditor/main/index_loader.html.deploy | 6 +++++- apps/presentationeditor/main/app.js | 2 +- apps/presentationeditor/main/index.html.deploy | 10 ++++++++-- .../presentationeditor/main/index_loader.html.deploy | 8 +++++++- apps/spreadsheeteditor/main/app.js | 2 +- apps/spreadsheeteditor/main/index.html.deploy | 8 +++++++- .../main/index_internal.html.deploy | 12 +++++++++--- apps/spreadsheeteditor/main/index_loader.html.deploy | 11 ++++++++--- apps/visioeditor/main/index.html.deploy | 8 +++++++- apps/visioeditor/main/index_loader.html.deploy | 12 +++++++++--- build/Gruntfile.js | 2 +- build/common.json | 4 ++++ 17 files changed, 89 insertions(+), 24 deletions(-) diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js index 5627c996ce..b6295a2d14 100644 --- a/apps/documenteditor/main/app.js +++ b/apps/documenteditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: window.customBaseUrl || '../../', + baseUrl: '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/documenteditor/main/index.html.deploy b/apps/documenteditor/main/index.html.deploy index 7a3e307e4e..9f51ca386d 100644 --- a/apps/documenteditor/main/index.html.deploy +++ b/apps/documenteditor/main/index.html.deploy @@ -366,9 +366,15 @@
+ + diff --git a/apps/documenteditor/main/index_loader.html.deploy b/apps/documenteditor/main/index_loader.html.deploy index fb8eef7471..dc0b14008e 100644 --- a/apps/documenteditor/main/index_loader.html.deploy +++ b/apps/documenteditor/main/index_loader.html.deploy @@ -331,12 +331,18 @@
- + + + diff --git a/apps/pdfeditor/main/app.js b/apps/pdfeditor/main/app.js index 067b8fcef3..9ff95990b5 100644 --- a/apps/pdfeditor/main/app.js +++ b/apps/pdfeditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: window.customBaseUrl || '../../', + baseUrl: '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/pdfeditor/main/index.html.deploy b/apps/pdfeditor/main/index.html.deploy index cbbcc84647..ed6f12cfbc 100644 --- a/apps/pdfeditor/main/index.html.deploy +++ b/apps/pdfeditor/main/index.html.deploy @@ -346,7 +346,11 @@ - + + + diff --git a/apps/presentationeditor/main/index_loader.html.deploy b/apps/presentationeditor/main/index_loader.html.deploy index 9fb49ac421..f807a23385 100644 --- a/apps/presentationeditor/main/index_loader.html.deploy +++ b/apps/presentationeditor/main/index_loader.html.deploy @@ -329,9 +329,15 @@
+ + diff --git a/apps/spreadsheeteditor/main/app.js b/apps/spreadsheeteditor/main/app.js index f62cadddde..2d01621973 100644 --- a/apps/spreadsheeteditor/main/app.js +++ b/apps/spreadsheeteditor/main/app.js @@ -41,7 +41,7 @@ var reqerr; require.config({ // The shim config allows us to configure dependencies for // scripts that do not call define() to register a module - baseUrl: window.customBaseUrl || '../../', + baseUrl: '../../', paths: { jquery : '../vendor/jquery/jquery', underscore : '../vendor/underscore/underscore', diff --git a/apps/spreadsheeteditor/main/index.html.deploy b/apps/spreadsheeteditor/main/index.html.deploy index 03844d037b..123838a525 100644 --- a/apps/spreadsheeteditor/main/index.html.deploy +++ b/apps/spreadsheeteditor/main/index.html.deploy @@ -407,9 +407,15 @@
+ + diff --git a/apps/spreadsheeteditor/main/index_internal.html.deploy b/apps/spreadsheeteditor/main/index_internal.html.deploy index b7cfd6b123..e4fddfa459 100644 --- a/apps/spreadsheeteditor/main/index_internal.html.deploy +++ b/apps/spreadsheeteditor/main/index_internal.html.deploy @@ -237,12 +237,18 @@
- + + + diff --git a/apps/spreadsheeteditor/main/index_loader.html.deploy b/apps/spreadsheeteditor/main/index_loader.html.deploy index b532452f57..a67e8d0759 100644 --- a/apps/spreadsheeteditor/main/index_loader.html.deploy +++ b/apps/spreadsheeteditor/main/index_loader.html.deploy @@ -331,12 +331,17 @@
- + + diff --git a/apps/visioeditor/main/index.html.deploy b/apps/visioeditor/main/index.html.deploy index e5dc81b74c..779a7426c5 100644 --- a/apps/visioeditor/main/index.html.deploy +++ b/apps/visioeditor/main/index.html.deploy @@ -437,8 +437,14 @@
+ + diff --git a/apps/visioeditor/main/index_loader.html.deploy b/apps/visioeditor/main/index_loader.html.deploy index 669f840a10..e3a27956ce 100644 --- a/apps/visioeditor/main/index_loader.html.deploy +++ b/apps/visioeditor/main/index_loader.html.deploy @@ -324,12 +324,18 @@
- + + + diff --git a/build/Gruntfile.js b/build/Gruntfile.js index e36238398a..751cf93054 100644 --- a/build/Gruntfile.js +++ b/build/Gruntfile.js @@ -526,7 +526,7 @@ module.exports = function(grunt) { babel: { options: { sourceMap: false, - presets: ['@babel/preset-env'] + presets: [['@babel/preset-env', {modules: false}]] }, dist: { files: packageFile.main.js.babel.files diff --git a/build/common.json b/build/common.json index 75cbb82269..eecc4be8a6 100644 --- a/build/common.json +++ b/build/common.json @@ -94,6 +94,10 @@ "src": "../apps/common/main/resources/themes/themes.json", "dest": "../deploy/web-apps/apps/common/main/resources/themes/themes.json" }, + "iecompat": { + "src": "../apps/common/main/lib/util/fix-ie-compat.js", + "dest": "../deploy/web-apps/apps/common/main/lib/util/fix-ie-compat.js" + }, "help": { "expand": true, "cwd": "../apps/common/main/resources/help/",