diff --git a/apps/common/main/lib/controller/HintManager.js b/apps/common/main/lib/controller/HintManager.js index ee2dd42f2..fa6fdb12d 100644 --- a/apps/common/main/lib/controller/HintManager.js +++ b/apps/common/main/lib/controller/HintManager.js @@ -492,7 +492,9 @@ Common.UI.HintManager = new(function() { match = false; var keyCode = e.keyCode; if (keyCode !== 16 && keyCode !== 17 && keyCode !== 18 && keyCode !== 91) { - curLetter = _lang === 'en' ? ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : e.key; + curLetter = _lang === 'en' ? + ((keyCode > 47 && keyCode < 58 || keyCode > 64 && keyCode < 91) ? String.fromCharCode(e.keyCode) : null) : + (/[.*+?^${}()|[\]\\]/g.test(e.key) ? null : e.key); } if (curLetter) { var curr; diff --git a/apps/common/main/lib/view/About.js b/apps/common/main/lib/view/About.js index e588215ae..04f3530eb 100644 --- a/apps/common/main/lib/view/About.js +++ b/apps/common/main/lib/view/About.js @@ -235,10 +235,10 @@ define([ this.lblCompanyLic.parents('tr').addClass('hidden'); value = Common.UI.Themes.isDarkTheme() ? (customer.logoDark || customer.logo) : (customer.logo || customer.logoDark); - value.length ? + value && value.length ? this.divCompanyLogo.html('') : this.divCompanyLogo.parents('tr').addClass('hidden'); - value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); + value && value.length && Common.NotificationCenter.on('uitheme:changed', this.changeLogo.bind(this)); } else { this.cntLicenseeInfo.addClass('hidden'); this.cntLicensorInfo.addClass('margin-bottom'); diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index a898d25be..45947fc43 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -104,6 +104,8 @@ define([ this.api.asc_registerCallback('asc_onCurrentPage', this.onCurrentPage.bind(this)); this.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(this.onDocumentModifiedChanged, this)); this.api.asc_registerCallback('asc_onZoomChange', this.onApiZoomChange.bind(this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); + Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); // Initialize api gateway Common.Gateway.on('init', this.loadConfig.bind(this)); @@ -678,7 +680,7 @@ define([ } if (this._state.licenseType!==Asc.c_oLicenseResult.SuccessLimit && this.appOptions.canFillForms) { - this.disableEditing(true); + Common.NotificationCenter.trigger('api:disconnect'); } var value = Common.localStorage.getItem("de-license-warning"); @@ -1811,9 +1813,21 @@ define([ } }, - disableEditing: function(state) { - this.view && this.view.btnClear && this.view.btnClear.setDisabled(state); - this._isDisabled = state; + onApiServerDisconnect: function(enableDownload) { + this._state.isDisconnected = true; + this._isDisabled = true; + this.view && this.view.btnClear && this.view.btnClear.setDisabled(true); + if (!enableDownload) { + this.appOptions.canPrint = this.appOptions.canDownload = false; + this.view && this.view.btnDownload.setDisabled(true); + this.view && this.view.btnSubmit.setDisabled(true); + if (this.view && this.view.btnOptions && this.view.btnOptions.menu) { + this.view.btnOptions.menu.items[0].setDisabled(true); // print + this.view.btnOptions.menu.items[2].setDisabled(true); // download + this.view.btnOptions.menu.items[3].setDisabled(true); // download docx + this.view.btnOptions.menu.items[4].setDisabled(true); // download pdf + } + } }, errorDefaultMessage : 'Error code: %1', diff --git a/apps/documenteditor/mobile/src/store/textSettings.js b/apps/documenteditor/mobile/src/store/textSettings.js index c5526df34..b3c50936d 100644 --- a/apps/documenteditor/mobile/src/store/textSettings.js +++ b/apps/documenteditor/mobile/src/store/textSettings.js @@ -101,11 +101,11 @@ export class storeTextSettings { this.thumbCanvas = document.createElement('canvas'); this.thumbContext = this.thumbCanvas.getContext('2d'); this.thumbs = [ - {ratio: 1, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, - {ratio: 1.25, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, - {ratio: 1.5, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, - {ratio: 1.75, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, - {ratio: 2, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} + {ratio: 1, path: '../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, + {ratio: 1.25, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, + {ratio: 1.5, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, + {ratio: 1.75, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, + {ratio: 2, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} ]; const applicationPixelRatio = Common.Utils.applicationPixelRatio(); diff --git a/apps/presentationeditor/mobile/src/store/textSettings.js b/apps/presentationeditor/mobile/src/store/textSettings.js index 44ae68c56..551c633ae 100644 --- a/apps/presentationeditor/mobile/src/store/textSettings.js +++ b/apps/presentationeditor/mobile/src/store/textSettings.js @@ -105,11 +105,11 @@ export class storeTextSettings { this.thumbCanvas = document.createElement('canvas'); this.thumbContext = this.thumbCanvas.getContext('2d'); this.thumbs = [ - {ratio: 1, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, - {ratio: 1.25, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, - {ratio: 1.5, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, - {ratio: 1.75, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, - {ratio: 2, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} + {ratio: 1, path: '../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, + {ratio: 1.25, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, + {ratio: 1.5, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, + {ratio: 1.75, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, + {ratio: 2, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} ]; const applicationPixelRatio = Common.Utils.applicationPixelRatio(); diff --git a/apps/spreadsheeteditor/mobile/src/store/textSettings.js b/apps/spreadsheeteditor/mobile/src/store/textSettings.js index 9b57d4350..b034ad03f 100644 --- a/apps/spreadsheeteditor/mobile/src/store/textSettings.js +++ b/apps/spreadsheeteditor/mobile/src/store/textSettings.js @@ -105,11 +105,11 @@ export class storeTextSettings { this.thumbCanvas = document.createElement('canvas'); this.thumbContext = this.thumbCanvas.getContext('2d'); this.thumbs = [ - {ratio: 1, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, - {ratio: 1.25, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, - {ratio: 1.5, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, - {ratio: 1.75, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, - {ratio: 2, path: '../../../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} + {ratio: 1, path: '../../../../../sdkjs/common/Images/fonts_thumbnail.png', width: this.iconWidth, height: this.iconHeight}, + {ratio: 1.25, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.25x.png', width: this.iconWidth * 1.25, height: this.iconHeight * 1.25}, + {ratio: 1.5, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.5x.png', width: this.iconWidth * 1.5, height: this.iconHeight * 1.5}, + {ratio: 1.75, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@1.75x.png', width: this.iconWidth * 1.75, height: this.iconHeight * 1.75}, + {ratio: 2, path: '../../../../../sdkjs/common/Images/fonts_thumbnail@2x.png', width: this.iconWidth * 2, height: this.iconHeight * 2} ]; const applicationPixelRatio = Common.Utils.applicationPixelRatio();