diff --git a/apps/common/forms/resources/less/common.less b/apps/common/forms/resources/less/common.less index 44e06dde8..e10746914 100644 --- a/apps/common/forms/resources/less/common.less +++ b/apps/common/forms/resources/less/common.less @@ -67,6 +67,7 @@ @import "../../../../common/main/resources/less/dropdown-submenu.less"; @import "../../../../common/main/resources/less/separator.less"; @import "../../../../common/main/resources/less/input.less"; +@import "../../../../common/main/resources/less/combobox.less"; @import "../../../../common/main/resources/less/window.less"; @import "../../../../common/main/resources/less/loadmask.less"; @import "../../../../common/main/resources/less/dataview.less"; @@ -78,6 +79,7 @@ @import "../../../../common/main/resources/less/calendar.less"; @import "../../../../common/main/resources/less/spinner.less"; @import "../../../../common/main/resources/less/checkbox.less"; +@import "../../../../common/main/resources/less/opendialog.less"; @toolbarBorderColor: @border-toolbar-ie; @toolbarBorderColor: @border-toolbar; diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index dd44cf4b3..43b62b389 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -14,6 +14,7 @@ define([ 'common/main/lib/view/ImageFromUrlDialog', 'common/main/lib/view/SelectFileDlg', 'common/main/lib/view/SaveAsDlg', + 'common/main/lib/view/OpenDialog', 'common/forms/lib/view/modals', 'documenteditor/forms/app/view/ApplicationView' ], function (Viewport) { @@ -98,7 +99,7 @@ define([ this.api.asc_registerCallback('asc_onOpenDocumentProgress', this.onOpenDocument.bind(this)); this.api.asc_registerCallback('asc_onDocumentUpdateVersion', this.onUpdateVersion.bind(this)); this.api.asc_registerCallback('asc_onServerVersion', this.onServerVersion.bind(this)); - + this.api.asc_registerCallback('asc_onAdvancedOptions', this.onAdvancedOptions.bind(this)); this.api.asc_registerCallback('asc_onCountPages', this.onCountPages.bind(this)); this.api.asc_registerCallback('asc_onCurrentPage', this.onCurrentPage.bind(this)); @@ -236,7 +237,7 @@ define([ break; case Asc.c_oAscError.ID.EditingError: - config.msg = this.errorEditingDownloadas; + config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.errorEditingSaveas : this.errorEditingDownloadas; break; case Asc.c_oAscError.ID.ForceSaveButton: @@ -253,6 +254,10 @@ define([ config.closable = false; break; + case Asc.c_oAscError.ID.VKeyEncrypt: + config.msg = this.errorToken; + break; + case Asc.c_oAscError.ID.KeyExpire: config.msg = this.errorTokenExpire; break; @@ -261,6 +266,30 @@ define([ config.msg = this.errorViewerDisconnect; break; + case Asc.c_oAscError.ID.SessionAbsolute: + config.msg = this.errorSessionAbsolute; + break; + + case Asc.c_oAscError.ID.SessionIdle: + config.msg = this.errorSessionIdle; + break; + + case Asc.c_oAscError.ID.SessionToken: + config.msg = this.errorSessionToken; + break; + + case Asc.c_oAscError.ID.UplImageUrl: + config.msg = this.errorBadImageUrl; + break; + + case Asc.c_oAscError.ID.DataEncrypted: + config.msg = this.errorDataEncrypted; + break; + + case Asc.c_oAscError.ID.ConvertationSaveError: + config.msg = (this.appOptions.isDesktopApp && this.appOptions.isOffline) ? this.saveErrorTextDesktop : this.saveErrorText; + break; + default: config.msg = (typeof id == 'string') ? id : this.errorDefaultMessage.replace('%1', id); break; @@ -292,11 +321,14 @@ define([ config.callback = _.bind(function(btn){ if (id == Asc.c_oAscError.ID.Warning && btn == 'ok' && this.appOptions.canDownload) { Common.UI.Menu.Manager.hideAll(); - var me = this; - setTimeout(function() { - $('button', me.view.btnOptions.cmpEl).click(); - }, 10); - + if (this.appOptions.isDesktopApp && this.appOptions.isOffline) + this.api.asc_DownloadAs(); + else { + var me = this; + setTimeout(function() { + $('button', me.view.btnOptions.cmpEl).click(); + }, 10); + } } else if (id == Asc.c_oAscError.ID.EditingError) { Common.NotificationCenter.trigger('api:disconnect', true); // enable download and print } @@ -489,7 +521,7 @@ define([ this.appOptions.trialMode = params.asc_getLicenseMode(); this.appOptions.isBeta = params.asc_getIsBeta(); this.appOptions.canLicense = (licType === Asc.c_oLicenseResult.Success || licType === Asc.c_oLicenseResult.SuccessLimit); - this.appOptions.canSubmitForms = this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm; + this.appOptions.canSubmitForms = this.appOptions.canLicense && (typeof (this.editorConfig.customization) == 'object') && !!this.editorConfig.customization.submitForm && !this.appOptions.isOffline; var type = /^(?:(oform))$/.exec(this.document.fileType); // can fill forms only in oform format this.appOptions.isOFORM = !!(type && typeof type[1] === 'string'); @@ -510,6 +542,10 @@ define([ var me = this; me.view.btnSubmit.setVisible(this.appOptions.canFillForms && this.appOptions.canSubmitForms); me.view.btnDownload.setVisible(this.appOptions.canDownload && this.appOptions.canFillForms && !this.appOptions.canSubmitForms); + if (me.appOptions.isOffline || me.appOptions.canRequestSaveAs || !!me.appOptions.saveAsUrl) { + me.view.btnDownload.setCaption(me.appOptions.isOffline ? me.textSaveAsDesktop : me.textSaveAs); + me.view.btnDownload.updateHint(''); + } if (!this.appOptions.canFillForms) { me.view.btnPrev.setVisible(false); me.view.btnNext.setVisible(false); @@ -529,8 +565,12 @@ define([ }); me.view.btnDownload.on('click', function(){ if (me.appOptions.canDownload) { - me.isFromBtnDownload = me.appOptions.canRequestSaveAs || !!me.appOptions.saveAsUrl; - me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF, me.isFromBtnDownload)); + if (me.appOptions.isOffline) + me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF)); + else { + me.isFromBtnDownload = me.appOptions.canRequestSaveAs || !!me.appOptions.saveAsUrl; + me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF, me.isFromBtnDownload)); + } } }); @@ -672,7 +712,7 @@ define([ } }, - onLongActionEnd: function(type, id){ + onLongActionEnd: function(type, id){ var action = {id: id, type: type}; this.stackLongActions.pop(action); @@ -700,6 +740,42 @@ define([ } }, + onAdvancedOptions: function(type, advOptions, mode, formatOptions) { + if (this._openDlg) return; + + var me = this; + if (type == Asc.c_oAscAdvancedOptionsID.DRM) { + me._openDlg = new Common.Views.OpenDialog({ + title: Common.Views.OpenDialog.prototype.txtTitleProtected, + closeFile: me.appOptions.canRequestClose, + type: Common.Utils.importTextType.DRM, + warning: !(me.appOptions.isDesktopApp && me.appOptions.isOffline) && (typeof advOptions == 'string'), + warningMsg: advOptions, + validatePwd: !!me._isDRM, + handler: function (result, value) { + me.isShowOpenDialog = false; + if (result == 'ok') { + if (me.api) { + me.api.asc_setAdvancedOptions(type, value.drmOptions); + me.loadMask && me.loadMask.show(); + } + } else { + Common.Gateway.requestClose(); + Common.Controllers.Desktop.requestClose(); + } + me._openDlg = null; + } + }); + me._isDRM = true; + } + if (me._openDlg) { + this.isShowOpenDialog = true; + this.loadMask && this.loadMask.hide(); + this.onLongActionEnd(Asc.c_oAscAsyncActionType.BlockInteraction, LoadingDocument); + me._openDlg.show(); + } + }, + onDocMouseMoveStart: function() { screenTip.isHidden = true; }, @@ -1359,7 +1435,7 @@ define([ itemsCount--; } - if ( !this.appOptions.isOFORM || !this.appOptions.canDownload) { + if ( !this.appOptions.isOFORM || !this.appOptions.canDownload || this.appOptions.isOffline) { menuItems[3].setVisible(false); menuItems[4].setVisible(false); itemsCount -= 2; @@ -1708,7 +1784,18 @@ define([ mniImageFromFile: 'Image from File', mniImageFromUrl: 'Image from URL', mniImageFromStorage: 'Image from Storage', - txtUntitled: 'Untitled' + txtUntitled: 'Untitled', + errorToken: 'The document security token is not correctly formed.
Please contact your Document Server administrator.', + errorSessionAbsolute: 'The document editing session has expired. Please reload the page.', + errorSessionIdle: 'The document has not been edited for quite a long time. Please reload the page.', + errorSessionToken: 'The connection to the server has been interrupted. Please reload the page.', + errorBadImageUrl: 'Image url is incorrect', + errorDataEncrypted: 'Encrypted changes have been received, they cannot be deciphered.', + saveErrorText: 'An error has occurred while saving the file', + saveErrorTextDesktop: 'This file cannot be saved or created.
Possible reasons are:
1. The file is read-only.
2. The file is being edited by other users.
3. The disk is full or corrupted.', + errorEditingSaveas: 'An error occurred during the work with the document.
Use the \'Save as...\' option to save the file backup copy to your computer hard drive.', + textSaveAs: 'Save as PDF', + textSaveAsDesktop: 'Save as...' }, DE.Controllers.ApplicationController)); diff --git a/apps/documenteditor/forms/locale/en.json b/apps/documenteditor/forms/locale/en.json index 854673b63..c0ef6e67d 100644 --- a/apps/documenteditor/forms/locale/en.json +++ b/apps/documenteditor/forms/locale/en.json @@ -59,6 +59,22 @@ "Common.Views.ShareDialog.textTitle": "Share Link", "Common.Views.ShareDialog.txtCopy": "Copy to clipboard", "Common.Views.ShareDialog.warnCopy": "Browser's error! Use keyboard shortcut [Ctrl] + [C]", + "Common.Views.ImageFromUrlDialog.textUrl": "Paste an image URL:", + "Common.Views.ImageFromUrlDialog.txtEmpty": "This field is required", + "Common.Views.ImageFromUrlDialog.txtNotUrl": "This field should be a URL in the \"http://www.example.com\" format", + "Common.Views.SelectFileDlg.textLoading": "Loading", + "Common.Views.SelectFileDlg.textTitle": "Select Data Source", + "Common.Views.SaveAsDlg.textLoading": "Loading", + "Common.Views.SaveAsDlg.textTitle": "Folder for save", + "Common.Views.OpenDialog.closeButtonText": "Close File", + "Common.Views.OpenDialog.txtEncoding": "Encoding ", + "Common.Views.OpenDialog.txtIncorrectPwd": "Password is incorrect.", + "Common.Views.OpenDialog.txtOpenFile": "Enter a password to open the file", + "Common.Views.OpenDialog.txtPassword": "Password", + "Common.Views.OpenDialog.txtPreview": "Preview", + "Common.Views.OpenDialog.txtProtected": "Once you enter the password and open the file, the current password to the file will be reset.", + "Common.Views.OpenDialog.txtTitle": "Choose %1 options", + "Common.Views.OpenDialog.txtTitleProtected": "Protected File", "DE.Controllers.ApplicationController.convertationErrorText": "Conversion failed.", "DE.Controllers.ApplicationController.convertationTimeoutText": "Conversion timeout exceeded.", "DE.Controllers.ApplicationController.criticalErrorTitle": "Error", @@ -117,6 +133,17 @@ "DE.Controllers.ApplicationController.mniImageFromStorage": "Image from Storage", "DE.Controllers.ApplicationController.mniImageFromUrl": "Image from URL", "DE.Controllers.ApplicationController.txtUntitled": "Untitled", + "DE.Controllers.ApplicationController.errorToken": "The document security token is not correctly formed.
Please contact your Document Server administrator.", + "DE.Controllers.ApplicationController.errorSessionAbsolute": "The document editing session has expired. Please reload the page.", + "DE.Controllers.ApplicationController.errorSessionIdle": "The document has not been edited for quite a long time. Please reload the page.", + "DE.Controllers.ApplicationController.errorSessionToken": "The connection to the server has been interrupted. Please reload the page.", + "DE.Controllers.ApplicationController.errorBadImageUrl": "Image URL is incorrect", + "DE.Controllers.ApplicationController.errorDataEncrypted": "Encrypted changes have been received, they cannot be deciphered.", + "DE.Controllers.ApplicationController.saveErrorText": "An error has occurred while saving the file.", + "DE.Controllers.ApplicationController.saveErrorTextDesktop": "This file cannot be saved or created.
Possible reasons are:
1. The file is read-only.
2. The file is being edited by other users.
3. The disk is full or corrupted.", + "DE.Controllers.ApplicationController.errorEditingSaveas": "An error occurred during the work with the document.
Use the 'Save as...' option to save the file backup copy to your computer hard drive.", + "DE.Controllers.ApplicationController.textSaveAs": "Save as PDF", + "DE.Controllers.ApplicationController.textSaveAsDesktop": "Save as...", "DE.Views.ApplicationView.textClear": "Clear All Fields", "DE.Views.ApplicationView.textCopy": "Copy", "DE.Views.ApplicationView.textCut": "Cut", diff --git a/apps/documenteditor/forms/locale/ru.json b/apps/documenteditor/forms/locale/ru.json index 4bbb65d98..fe365d1df 100644 --- a/apps/documenteditor/forms/locale/ru.json +++ b/apps/documenteditor/forms/locale/ru.json @@ -59,6 +59,22 @@ "Common.Views.ShareDialog.textTitle": "Поделиться ссылкой", "Common.Views.ShareDialog.txtCopy": "Скопировать в буфер", "Common.Views.ShareDialog.warnCopy": "Browser's error! Use keyboard shortcut [Ctrl] + [C]", + "Common.Views.ImageFromUrlDialog.textUrl": "Вставьте URL изображения:", + "Common.Views.ImageFromUrlDialog.txtEmpty": "Это поле обязательно для заполнения", + "Common.Views.ImageFromUrlDialog.txtNotUrl": "Это поле должно быть URL-адресом в формате \"http://www.example.com\"", + "Common.Views.OpenDialog.closeButtonText": "Закрыть файл", + "Common.Views.OpenDialog.txtEncoding": "Кодировка", + "Common.Views.OpenDialog.txtIncorrectPwd": "Указан неверный пароль.", + "Common.Views.OpenDialog.txtOpenFile": "Введите пароль для открытия файла", + "Common.Views.OpenDialog.txtPassword": "Пароль", + "Common.Views.OpenDialog.txtPreview": "Просмотр", + "Common.Views.OpenDialog.txtProtected": "Как только вы введете пароль и откроете файл, текущий пароль к файлу будет сброшен.", + "Common.Views.OpenDialog.txtTitle": "Выбрать параметры %1", + "Common.Views.OpenDialog.txtTitleProtected": "Защищенный файл", + "Common.Views.SaveAsDlg.textLoading": "Загрузка", + "Common.Views.SaveAsDlg.textTitle": "Папка для сохранения", + "Common.Views.SelectFileDlg.textLoading": "Загрузка", + "Common.Views.SelectFileDlg.textTitle": "Выбрать источник данных", "DE.Controllers.ApplicationController.convertationErrorText": "Конвертация не удалась.", "DE.Controllers.ApplicationController.convertationTimeoutText": "Превышено время ожидания конвертации.", "DE.Controllers.ApplicationController.criticalErrorTitle": "Ошибка", diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 2a9ba723b..c5a58425c 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -322,7 +322,7 @@ define([ }); var menuHiddenItems = new Common.UI.Menu({ - maxHeight: 260, + maxHeight: 267, menuAlign: 'tl-tr' }).on('show:after', function () { this.scroller.update({alwaysVisibleY: true});