From fb8b479e60777132d1698ff5d21cdfe1f3cf04c3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 16 Jun 2017 14:53:29 +0300 Subject: [PATCH 01/20] [DE] Use localStorate.getBool instead getItem. --- .../main/app/controller/LeftMenu.js | 24 +++++++------------ .../main/app/controller/Main.js | 22 +++++++---------- .../main/app/view/FileMenuPanels.js | 20 +++++----------- .../mobile/app/controller/Main.js | 3 +-- 4 files changed, 24 insertions(+), 45 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 556d6f00f..ec5ee750d 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -287,13 +287,12 @@ define([ }, applySettings: function(menu) { - var value = Common.localStorage.getItem("de-settings-inputmode"); - this.api.SetTextBoxInputMode(parseInt(value) == 1); + var value; + this.api.SetTextBoxInputMode(Common.localStorage.getBool("de-settings-inputmode")); /** coauthoring begin **/ if (this.mode.isEdit && !this.mode.isOffline && this.mode.canCoAuthoring) { - value = Common.localStorage.getItem("de-settings-coauthmode"); - var fast_coauth = (value===null || parseInt(value) == 1); + var fast_coauth = Common.localStorage.getBool("de-settings-coauthmode", true); this.api.asc_SetFastCollaborative(fast_coauth); value = Common.localStorage.getItem((fast_coauth) ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict"); @@ -306,9 +305,7 @@ define([ this.api.SetCollaborativeMarksShowType(value); } - value = Common.localStorage.getItem("de-settings-livecomment"); - var resolved = Common.localStorage.getItem("de-settings-resolvedcomment"); - (!(value!==null && parseInt(value) == 0)) ? this.api.asc_showComments(!(resolved!==null && parseInt(resolved) == 0)) : this.api.asc_hideComments(); + (Common.localStorage.getBool("de-settings-livecomment", true)) ? this.api.asc_showComments(Common.localStorage.getBool("de-settings-resolvedcomment", true)) : this.api.asc_hideComments(); /** coauthoring end **/ value = Common.localStorage.getItem("de-settings-fontrender"); @@ -325,8 +322,7 @@ define([ this.api.asc_setSpellCheck(Common.localStorage.getBool("de-settings-spellcheck", true)); } - value = Common.localStorage.getItem("de-settings-showsnaplines"); - this.api.put_ShowSnapLines(value===null || parseInt(value) == 1); + this.api.put_ShowSnapLines(Common.localStorage.getBool("de-settings-showsnaplines", true)); menu.hide(); }, @@ -517,12 +513,10 @@ define([ }, commentsShowHide: function(mode) { - var value = Common.localStorage.getItem("de-settings-livecomment"), - resolved = Common.localStorage.getItem("de-settings-resolvedcomment"); - value = (value!==null && parseInt(value) == 0); - resolved = (resolved!==null && parseInt(resolved) == 0); - if (value || resolved) { - (mode === 'show') ? this.api.asc_showComments(true) : ((!value) ? this.api.asc_showComments(!resolved) : this.api.asc_hideComments()); + var value = Common.localStorage.getBool("de-settings-livecomment", true), + resolved = Common.localStorage.getBool("de-settings-resolvedcomment", true); + if (!value || !resolved) { + (mode === 'show') ? this.api.asc_showComments(true) : ((value) ? this.api.asc_showComments(resolved) : this.api.asc_hideComments()); } if (mode === 'show') { diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index d9d418561..bf86936e0 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -735,10 +735,8 @@ define([ me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); /** coauthoring begin **/ - value = Common.localStorage.getItem("de-settings-livecomment"); - this.isLiveCommenting = !(value!==null && parseInt(value) == 0); - var resolved = Common.localStorage.getItem("de-settings-resolvedcomment"); - this.isLiveCommenting ? this.api.asc_showComments(!(resolved!==null && parseInt(resolved) == 0)) : this.api.asc_hideComments(); + this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true); + this.isLiveCommenting ? this.api.asc_showComments(Common.localStorage.getBool("de-settings-resolvedcomment", true)) : this.api.asc_hideComments(); /** coauthoring end **/ value = Common.localStorage.getItem("de-settings-zoom"); @@ -782,7 +780,7 @@ define([ /** coauthoring begin **/ if (me.appOptions.isEdit && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { value = Common.localStorage.getItem("de-settings-coauthmode"); - if (value===null && Common.localStorage.getItem("de-settings-autosave")===null && + if (value===null && !Common.localStorage.itemExists("de-settings-autosave") && me.appOptions.customization && me.appOptions.customization.autosave===false) { value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null } @@ -848,8 +846,7 @@ define([ me.api.asc_setAutoSaveGap(value); if (me.appOptions.canForcesave) {// use asc_setIsForceSaveOnUserSave only when customization->forcesave = true - value = Common.localStorage.getItem("de-settings-forcesave"); - me.appOptions.forcesave = (value===null) ? me.appOptions.canForcesave : (parseInt(value)==1); + me.appOptions.forcesave = Common.localStorage.getBool("de-settings-forcesave", me.appOptions.canForcesave); me.api.asc_setIsForceSaveOnUserSave(me.appOptions.forcesave); } @@ -1750,8 +1747,7 @@ define([ }, onTryUndoInFastCollaborative: function() { - var val = window.localStorage.getItem("de-hide-try-undoredo"); - if (!(val && parseInt(val) == 1)) + if (!window.localStorage.getBool("de-hide-try-undoredo")) Common.UI.info({ width: 500, msg: this.textTryUndoRedo, @@ -1785,15 +1781,13 @@ define([ applySettings: function() { if (this.appOptions.isEdit && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { - var value = Common.localStorage.getItem("de-settings-coauthmode"), - oldval = this._state.fastCoauth; - this._state.fastCoauth = (value===null || parseInt(value) == 1); + var oldval = this._state.fastCoauth; + this._state.fastCoauth = Common.localStorage.getBool("de-settings-coauthmode", true); if (this._state.fastCoauth && !oldval) this.synchronizeChanges(); } if (this.appOptions.canForcesave) { - value = Common.localStorage.getItem("de-settings-forcesave"); - this.appOptions.forcesave = (value===null) ? this.appOptions.canForcesave : (parseInt(value)==1); + this.appOptions.forcesave = Common.localStorage.getBool("de-settings-forcesave", this.appOptions.canForcesave); this.api.asc_setIsForceSaveOnUserSave(this.appOptions.forcesave); } }, diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index ef058c37f..a2953db42 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -350,14 +350,11 @@ define([ this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100)); /** coauthoring begin **/ - value = Common.localStorage.getItem("de-settings-livecomment"); - this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); - - value = Common.localStorage.getItem("de-settings-resolvedcomment"); - this.chResolvedComment.setValue(!(value!==null && parseInt(value) == 0)); + this.chLiveComment.setValue(Common.localStorage.getBool("de-settings-livecomment", true)); + this.chResolvedComment.setValue(Common.localStorage.getBool("de-settings-resolvedcomment", true)); value = Common.localStorage.getItem("de-settings-coauthmode"); - if (value===null && Common.localStorage.getItem("de-settings-autosave")===null && + if (value===null && !Common.localStorage.itemExists("de-settings-autosave") && this.mode.customization && this.mode.customization.autosave===false) value = 0; // use customization.autosave only when de-settings-coauthmode and de-settings-autosave are null var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring; @@ -387,16 +384,11 @@ define([ value = 0; this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1)); - if (this.mode.canForcesave) { - value = Common.localStorage.getItem("de-settings-forcesave"); - value = (value === null) ? this.mode.canForcesave : (parseInt(value) == 1); - this.chForcesave.setValue(value); - } + if (this.mode.canForcesave) + this.chForcesave.setValue(Common.localStorage.getBool("de-settings-forcesave", this.mode.canForcesave)); this.chSpell.setValue(Common.localStorage.getBool("de-settings-spellcheck", true)); - - value = Common.localStorage.getItem("de-settings-showsnaplines"); - this.chAlignGuides.setValue(value===null || parseInt(value) == 1); + this.chAlignGuides.setValue(Common.localStorage.getBool("de-settings-showsnaplines", true)); }, applySettings: function() { diff --git a/apps/documenteditor/mobile/app/controller/Main.js b/apps/documenteditor/mobile/app/controller/Main.js index 7162286bb..ae16b78ad 100644 --- a/apps/documenteditor/mobile/app/controller/Main.js +++ b/apps/documenteditor/mobile/app/controller/Main.js @@ -452,8 +452,7 @@ define([ me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); /** coauthoring begin **/ - value = Common.localStorage.getItem("de-settings-livecomment"); - this.isLiveCommenting = !(value!==null && parseInt(value) == 0); + this.isLiveCommenting = Common.localStorage.getBool("de-settings-livecomment", true); this.isLiveCommenting ? this.api.asc_showComments(true) : this.api.asc_hideComments(); /** coauthoring end **/ From e4ec08a6967c208600c46f262375bf837d6b24f5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 16 Jun 2017 10:52:31 +0300 Subject: [PATCH 02/20] [Embedded] Customization for header logo and url. --- apps/documenteditor/embed/js/ApplicationController.js | 2 +- apps/presentationeditor/embed/js/ApplicationController.js | 2 +- apps/spreadsheeteditor/embed/js/ApplicationController.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index c938f38a8..20d162b59 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -313,7 +313,7 @@ var ApplicationController = new(function(){ } function onEditorPermissions(params) { - if ( params.asc_getCanBranding() && (typeof config.customization == 'object') && + if ( (params.asc_getLicenseType() === Asc.c_oLicenseResult.Success) && (typeof config.customization == 'object') && config.customization && config.customization.logo ) { var logo = $('#header-logo'); diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index 4cbe3951d..53564759c 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -391,7 +391,7 @@ var ApplicationController = new(function(){ } function onEditorPermissions(params) { - if ( params.asc_getCanBranding() && (typeof config.customization == 'object') && + if ( (params.asc_getLicenseType() === Asc.c_oLicenseResult.Success) && (typeof config.customization == 'object') && config.customization && config.customization.logo ) { var logo = $('#header-logo'); diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index 7f6873718..3690aa5ed 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -292,7 +292,7 @@ var ApplicationController = new(function(){ } function onEditorPermissions(params) { - if ( params.asc_getCanBranding() && (typeof config.customization == 'object') && + if ( (params.asc_getLicenseType() === Asc.c_oLicenseResult.Success) && (typeof config.customization == 'object') && config.customization && config.customization.logo ) { var logo = $('#header-logo'); From f38d5f9b5439935477e2260e6721443eeffee844 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 19 Jun 2017 11:54:26 +0300 Subject: [PATCH 03/20] Fix Bug 35139. --- apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js | 1 + apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js | 1 + 2 files changed, 2 insertions(+) diff --git a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js index 5eefb5b7b..d4ac4aaef 100644 --- a/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/presentationeditor/main/app/view/ShapeSettingsAdvanced.js @@ -417,6 +417,7 @@ define([ 'text!presentationeditor/main/app/template/ShapeSettingsAdvanced.tem this.spnColumns = new Common.UI.MetricSpinner({ el: $('#shape-columns-number'), step: 1, + allowDecimal: false, width: 100, defaultUnit : "", value: '1', diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js index 808d21b2e..bcda24275 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettingsAdvanced.js @@ -441,6 +441,7 @@ define([ 'text!spreadsheeteditor/main/app/template/ShapeSettingsAdvanced.temp this.spnColumns = new Common.UI.MetricSpinner({ el: $('#shape-columns-number'), step: 1, + allowDecimal: false, width: 100, defaultUnit : "", value: '1', From 9f34062d32e62fdc1f136783820d948ca790ef2d Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 20 Jun 2017 12:53:18 +0300 Subject: [PATCH 04/20] Bug with closing File menu (when search dialog was opened before). --- apps/documenteditor/main/app/controller/LeftMenu.js | 2 +- apps/presentationeditor/main/app/controller/LeftMenu.js | 2 +- apps/spreadsheeteditor/main/app/controller/LeftMenu.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index ec5ee750d..8bd070b03 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -537,7 +537,7 @@ define([ if ( state == 'show' ) this.dlgSearch.suspendKeyEvents(); else - Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents); + Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents, this.dlgSearch); } }, diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index dca0258b0..00c9fc3a1 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -430,7 +430,7 @@ define([ if ( state == 'show' ) this.dlgSearch.suspendKeyEvents(); else - Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents); + Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents, this.dlgSearch); } }, diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 3415ade0d..217de4a66 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -589,7 +589,7 @@ define([ if ( state == 'show' ) this.dlgSearch.suspendKeyEvents(); else - Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents); + Common.Utils.asyncCall(this.dlgSearch.resumeKeyEvents, this.dlgSearch); } }, From d3663f11db490f8f8ab53f40a15bc3b703ec8818 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 20 Jun 2017 12:54:01 +0300 Subject: [PATCH 05/20] [DE][SSE] Use commenting display option when show/hide panels in the left menu. --- apps/documenteditor/main/app/view/LeftMenu.js | 6 ++++++ apps/spreadsheeteditor/main/app/view/LeftMenu.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/apps/documenteditor/main/app/view/LeftMenu.js b/apps/documenteditor/main/app/view/LeftMenu.js index dce3c66d5..9b9ee6397 100644 --- a/apps/documenteditor/main/app/view/LeftMenu.js +++ b/apps/documenteditor/main/app/view/LeftMenu.js @@ -136,6 +136,7 @@ define([ this.btnChat.hide(); this.btnComments.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnComments.on('toggle', _.bind(this.onBtnCommentsToggle, this)); this.btnChat.on('click', _.bind(this.onBtnMenuClick, this)); /** coauthoring end **/ @@ -174,6 +175,11 @@ define([ Common.NotificationCenter.trigger('layout:changed', 'leftmenu'); }, + onBtnCommentsToggle: function(btn, state) { + if (!state) + this.fireEvent('comments:hide', this); + }, + onBtnMenuClick: function(btn, e) { this.supressEvents = true; this.btnAbout.toggle(false); diff --git a/apps/spreadsheeteditor/main/app/view/LeftMenu.js b/apps/spreadsheeteditor/main/app/view/LeftMenu.js index 1070aa59e..b451e0c46 100644 --- a/apps/spreadsheeteditor/main/app/view/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/view/LeftMenu.js @@ -126,6 +126,7 @@ define([ this.btnChat.hide(); this.btnComments.on('click', _.bind(this.onBtnMenuClick, this)); + this.btnComments.on('toggle', _.bind(this.onBtnCommentsToggle, this)); this.btnChat.on('click', _.bind(this.onBtnMenuClick, this)); /** coauthoring end **/ @@ -163,6 +164,11 @@ define([ Common.NotificationCenter.trigger('layout:changed', 'leftmenu'); }, + onBtnCommentsToggle: function(btn, state) { + if (!state) + this.fireEvent('comments:hide', this); + }, + onBtnMenuClick: function(btn, e) { this.btnAbout.toggle(false); From 6d3f1f88f95828290f6a8341e93982c5d6ff2ed4 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 20 Jun 2017 13:11:31 +0300 Subject: [PATCH 06/20] [DE] Fix Bug 35084. --- apps/documenteditor/main/app/controller/Toolbar.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index b140a8f49..5e63c3ad8 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -722,6 +722,10 @@ define([ if (need_disable !== toolbar.btnNotes.isDisabled()) toolbar.btnNotes.setDisabled(need_disable); + need_disable = paragraph_locked || header_locked || in_image; + if (need_disable != toolbar.btnColumns.isDisabled()) + toolbar.btnColumns.setDisabled(need_disable); + if (toolbar.listStylesAdditionalMenuItem && (frame_pr===undefined) !== toolbar.listStylesAdditionalMenuItem.isDisabled()) toolbar.listStylesAdditionalMenuItem.setDisabled(frame_pr===undefined); From fe48b525d176440d7a779318d7ec10bdb959c8b3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 21 Jun 2017 12:51:14 +0300 Subject: [PATCH 07/20] [SSE] Close dialogs by enter (bug with row height dialog: deleted cell value, when dialog was closed by enter). --- apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js | 3 ++- apps/spreadsheeteditor/main/app/view/SetValueDialog.js | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js index 2f2e996ce..afb247f2f 100644 --- a/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/FormatSettingsDialog.js @@ -317,7 +317,8 @@ define([ }, onPrimary: function() { - return true; + this.onDlgBtnClick('ok'); + return false; }, onNegativeSelect: function(combo, record) { diff --git a/apps/spreadsheeteditor/main/app/view/SetValueDialog.js b/apps/spreadsheeteditor/main/app/view/SetValueDialog.js index 50fdfe928..be7e1fffb 100644 --- a/apps/spreadsheeteditor/main/app/view/SetValueDialog.js +++ b/apps/spreadsheeteditor/main/app/view/SetValueDialog.js @@ -133,6 +133,7 @@ define([ onPrimary: function() { this._handleInput('ok'); + return false; }, cancelButtonText: 'Cancel', From b455ba0a124f6f9105c0d2daf98e638d1931ec1b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 23 Jun 2017 16:42:18 +0300 Subject: [PATCH 08/20] Fix Bug 35037. --- apps/documenteditor/main/app.js | 33 ++----------------- apps/documenteditor/main/app_dev.js | 33 ++----------------- apps/documenteditor/main/index.html | 12 +++++++ apps/documenteditor/main/index.html.deploy | 26 +++++++++++++-- apps/documenteditor/mobile/app-dev.js | 33 ++----------------- apps/documenteditor/mobile/app.js | 33 ++----------------- apps/documenteditor/mobile/index.html | 12 +++++++ apps/documenteditor/mobile/index.html.deploy | 24 ++++++++++++++ apps/presentationeditor/main/app.js | 33 ++----------------- apps/presentationeditor/main/app_dev.js | 33 ++----------------- apps/presentationeditor/main/index.html | 12 +++++++ .../presentationeditor/main/index.html.deploy | 24 ++++++++++++-- apps/presentationeditor/mobile/app-dev.js | 33 ++----------------- apps/presentationeditor/mobile/app.js | 33 ++----------------- apps/presentationeditor/mobile/index.html | 12 +++++++ .../mobile/index.html.deploy | 24 ++++++++++++++ apps/spreadsheeteditor/main/app.js | 33 ++----------------- apps/spreadsheeteditor/main/app_dev.js | 33 ++----------------- apps/spreadsheeteditor/main/index.html | 12 +++++++ apps/spreadsheeteditor/main/index.html.deploy | 24 ++++++++++++-- apps/spreadsheeteditor/mobile/app-dev.js | 33 ++----------------- apps/spreadsheeteditor/mobile/app.js | 33 ++----------------- apps/spreadsheeteditor/mobile/index.html | 12 +++++++ .../mobile/index.html.deploy | 24 ++++++++++++++ 24 files changed, 235 insertions(+), 379 deletions(-) diff --git a/apps/documenteditor/main/app.js b/apps/documenteditor/main/app.js index 3cb20c44f..471759e72 100644 --- a/apps/documenteditor/main/app.js +++ b/apps/documenteditor/main/app.js @@ -200,37 +200,8 @@ require([ app.start(); }); }, function(err) { - if (err.requireType == 'timeout' && !reqerr) { - var getUrlParams = function() { - var e, - a = /\+/g, // Regex for replacing addition symbol with a space - r = /([^&=]+)=?([^&]*)/g, - d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, - q = window.location.search.substring(1), - urlParams = {}; - - while (e = r.exec(q)) - urlParams[d(e[1])] = d(e[2]); - - return urlParams; - }; - - var encodeUrlParam = function(str) { - return str.replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); - }; - - var lang = (getUrlParams()["lang"] || 'en').split("-")[0]; - - if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.'; - else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.'; - else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.'; - else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.'; - else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.'; - + if (err.requireType == 'timeout' && !reqerr && window.requireTimeourError) { + reqerr = window.requireTimeourError(); window.alert(reqerr); window.location.reload(); } diff --git a/apps/documenteditor/main/app_dev.js b/apps/documenteditor/main/app_dev.js index 49d9e8fa0..ff894fd0b 100644 --- a/apps/documenteditor/main/app_dev.js +++ b/apps/documenteditor/main/app_dev.js @@ -191,37 +191,8 @@ require([ app.start(); }); }, function(err) { - if (err.requireType == 'timeout' && !reqerr) { - var getUrlParams = function() { - var e, - a = /\+/g, // Regex for replacing addition symbol with a space - r = /([^&=]+)=?([^&]*)/g, - d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, - q = window.location.search.substring(1), - urlParams = {}; - - while (e = r.exec(q)) - urlParams[d(e[1])] = d(e[2]); - - return urlParams; - }; - - var encodeUrlParam = function(str) { - return str.replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(//g, '>'); - }; - - var lang = (getUrlParams()["lang"] || 'en').split("-")[0]; - - if ( lang == 'de') reqerr = 'Die Verbindung ist zu langsam, einige Komponenten konnten nicht geladen werden. Aktualisieren Sie bitte die Seite.'; - else if ( lang == 'es') reqerr = 'La conexión es muy lenta, algunos de los componentes no han podido cargar. Por favor recargue la página.'; - else if ( lang == 'fr') reqerr = 'La connexion est trop lente, certains des composants n\'ons pas pu être chargé. Veuillez recharger la page.'; - else if ( lang == 'ru') reqerr = 'Слишком медленное соединение, не удается загрузить некоторые компоненты. Пожалуйста, обновите страницу.'; - else reqerr = 'The connection is too slow, some of the components could not be loaded. Please reload the page.'; - + if (err.requireType == 'timeout' && !reqerr && window.requireTimeourError) { + reqerr = window.requireTimeourError(); window.alert(reqerr); window.location.reload(); } diff --git a/apps/documenteditor/main/index.html b/apps/documenteditor/main/index.html index 82fef5ca5..d3906d3d4 100644 --- a/apps/documenteditor/main/index.html +++ b/apps/documenteditor/main/index.html @@ -283,6 +283,18 @@ window.sdk_dev_scrpipts.forEach(function(item){ document.write(' diff --git a/apps/documenteditor/main/index.html.deploy b/apps/documenteditor/main/index.html.deploy index e151fbbf2..6e8dbc7a3 100644 --- a/apps/documenteditor/main/index.html.deploy +++ b/apps/documenteditor/main/index.html.deploy @@ -9,7 +9,7 @@ - +