From 80cbaaa6ba6e033d6b9b9643f386654d614530b0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Mon, 10 Oct 2016 16:13:38 +0300 Subject: [PATCH 1/9] [SSE] Fix Bug 33195. --- apps/spreadsheeteditor/main/app/controller/Main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index c6e57cea0..5f64f6fdb 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1708,7 +1708,7 @@ define([ var app = this.getApplication(), filemenu = app.getController('LeftMenu').getView('LeftMenu').getMenu('file'); app.getController('Viewport').getView('Common.Views.Header').setDocumentCaption(meta.title); - this.updateWindowTitle(true); + this.updateWindowTitle(this.api.asc_isDocumentModified(), true); this.appOptions.spreadsheet.title = meta.title; filemenu.loadDocument({doc:this.appOptions.spreadsheet}); filemenu.panels['info'].updateInfo(this.appOptions.spreadsheet); From d71f63e5553df6698564ebbeb3f413de95cb594c Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Tue, 11 Oct 2016 14:08:41 +0300 Subject: [PATCH 2/9] [SSE] Eix Bug 33206. --- apps/spreadsheeteditor/main/app/controller/DocumentHolder.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js index 88ddb8a58..828c754c1 100644 --- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js @@ -1312,6 +1312,7 @@ define([ item.setDisabled(isCellLocked); }); documentHolder.pmiCopy.setDisabled(false); + documentHolder.pmiFilterCells.setDisabled(isCellLocked || (filterInfo==null)); documentHolder.pmiSortCells.setDisabled(isCellLocked || (filterInfo==null)); documentHolder.pmiReapply.setDisabled(isCellLocked || (isApplyAutoFilter!==true)); if (showMenu) this.showPopupMenu(documentHolder.ssMenu, {}, event); From 1494f1f80702cf1bd4288b8471c9f98a6dab46d3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Wed, 12 Oct 2016 12:53:32 +0300 Subject: [PATCH 3/9] ComboBox: add parameter scrollAlwaysVisible. [SSE] AutoFilterDialog: added combobox with cell values to custom filter dialog. --- apps/common/main/lib/component/ComboBox.js | 13 ++- .../main/app/view/AutoFilterDialog.js | 87 ++++++++++--------- 2 files changed, 56 insertions(+), 44 deletions(-) diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index 35f3ca96f..24e147e2f 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -84,7 +84,8 @@ define([ menuCls : '', menuStyle : '', displayField: 'displayValue', - valueField : 'value' + valueField : 'value', + scrollAlwaysVisible: false }, template: _.template([ @@ -117,6 +118,7 @@ define([ this.store = me.options.store || new Common.UI.ComboBoxStore(); this.displayField = me.options.displayField; this.valueField = me.options.valueField; + this.scrollAlwaysVisible = me.options.scrollAlwaysVisible; me.rendered = me.options.rendered || false; this.lastValue = null; @@ -216,7 +218,8 @@ define([ el: $('.dropdown-menu', this.cmpEl), minScrollbarLength: 40, scrollYMarginOffset: 30, - includePadding: true + includePadding: true, + alwaysVisibleY: this.scrollAlwaysVisible }, this.options.scroller)); } @@ -239,7 +242,8 @@ define([ el: $('.dropdown-menu', this.cmpEl), minScrollbarLength: 40, scrollYMarginOffset: 30, - includePadding: true + includePadding: true, + alwaysVisibleY: this.scrollAlwaysVisible }, this.options.scroller)); } @@ -542,7 +546,8 @@ define([ el: $('.dropdown-menu', this.cmpEl), minScrollbarLength : 40, scrollYMarginOffset: 30, - includePadding : true + includePadding : true, + alwaysVisibleY: this.scrollAlwaysVisible }, this.options.scroller)); } } diff --git a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js index de1452a3e..895065774 100644 --- a/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js +++ b/apps/spreadsheeteditor/main/app/view/AutoFilterDialog.js @@ -119,9 +119,10 @@ define([ this.cmbCondition1 = new Common.UI.ComboBox({ el : $('#id-search-begin-digital-combo', this.$window), - menuStyle : 'min-width: 225px;', + menuStyle : 'min-width: 225px;max-height: 135px;', cls : 'input-group-nr', data : this.conditions, + scrollAlwaysVisible: true, editable : false }); this.cmbCondition1.setValue(Asc.c_oAscCustomAutoFilter.equals); @@ -130,9 +131,10 @@ define([ this.cmbCondition2 = new Common.UI.ComboBox({ el : $('#id-search-end-digital-combo', this.$window), - menuStyle : 'min-width: 225px;', + menuStyle : 'min-width: 225px;max-height: 135px;', cls : 'input-group-nr', data : this.conditions, + scrollAlwaysVisible: true, editable : false }); this.cmbCondition2.setValue(0); @@ -150,39 +152,34 @@ define([ name : 'asc-radio-filter-tab' }); - this.txtValue1 = new Common.UI.InputField({ + this.cmbValue1 = new Common.UI.ComboBox({ el : $('#id-sd-cell-search-begin', this.$window), - template: _.template([ - '<div class="input-field" style="<%= style %>">', - '<input ', - 'type="<%= type %>" ', - 'name="<%= name %>" ', - 'class="form-control <%= cls %>" style="float:none" ', - 'placeholder="<%= placeHolder %>" ', - 'value="<%= value %>"', - '>', - '</div>'].join('')), - allowBlank : true, - validateOnChange: true, - validation : function () { return true; } + cls : 'input-group-nr', + menuStyle : 'min-width: 225px;max-height: 135px;', + scrollAlwaysVisible: true, + data : [] }); - this.txtValue2 = new Common.UI.InputField({ + + this.cmbValue2 = new Common.UI.ComboBox({ el : $('#id-sd-cell-search-end', this.$window), - template: _.template([ - '<div class="input-field" style="<%= style %>">', - '<input ', - 'type="<%= type %>" ', - 'name="<%= name %>" ', - 'class="form-control <%= cls %>" style="float:none" ', - 'placeholder="<%= placeHolder %>" ', - 'value="<%= value %>"', - '>', - '</div>'].join('')), - allowBlank : true, - validateOnChange: true, - validation : function () { return true; } + cls : 'input-group-nr', + menuStyle : 'min-width: 225px;max-height: 135px;', + scrollAlwaysVisible: true, + data : [] }); + var comparator = function(item1, item2) { + var n1 = item1.get('intval'), + n2 = item2.get('intval'), + isN1 = n1!==undefined, + isN2 = n2!==undefined; + if (isN1 !== isN2) return (isN1) ? -1 : 1; + !isN1 && (n1 = item1.get('value').toLowerCase()) && (n2 = item2.get('value').toLowerCase()); + if (n1==n2) return 0; + return (n2=='' || n1!=='' && n1<n2) ? -1 : 1; + }; + this.cmbValue1.store.comparator = this.cmbValue2.store.comparator = comparator; + this.$window.find('.dlg-btn').on('click', _.bind(this.onBtnClick, this)); this.loadDefaults(); @@ -192,8 +189,8 @@ define([ var me = this; _.defer(function () { - if (me.txtValue1) { - me.txtValue1.focus(); + if (me.cmbValue1) { + me.cmbValue1._input.focus(); } }, 500); }, @@ -221,8 +218,18 @@ define([ loadDefaults: function () { if (this.properties && this.rbOr && this.rbAnd && - this.cmbCondition1 && this.cmbCondition2 && this.txtValue1 && this.txtValue2) { + this.cmbCondition1 && this.cmbCondition2 && this.cmbValue1 && this.cmbValue2) { + var arr = []; + this.properties.asc_getValues().forEach(function (item) { + var value = item.asc_getText(); + if (!_.isEmpty(value)) { + arr.push({value: value, displayValue: value, + intval: (!isNaN(parseFloat(value)) && isFinite(value)) ? parseFloat(value) : undefined}); + } + }); + this.cmbValue1.setData(arr); + this.cmbValue2.setData(arr); var filterObj = this.properties.asc_getFilterObj(); if (filterObj.asc_getType() == Asc.c_oAscAutoFilterTypes.CustomFilters) { var customFilter = filterObj.asc_getFilter(), @@ -233,14 +240,14 @@ define([ this.cmbCondition1.setValue(customFilters[0].asc_getOperator() || Asc.c_oAscCustomAutoFilter.equals); this.cmbCondition2.setValue((customFilters.length>1) ? (customFilters[1].asc_getOperator() || 0) : 0); - this.txtValue1.setValue(null === customFilters[0].asc_getVal() ? '' : customFilters[0].asc_getVal()); - this.txtValue2.setValue((customFilters.length>1) ? (null === customFilters[1].asc_getVal() ? '' : customFilters[1].asc_getVal()) : ''); + this.cmbValue1.setValue(null === customFilters[0].asc_getVal() ? '' : customFilters[0].asc_getVal()); + this.cmbValue2.setValue((customFilters.length>1) ? (null === customFilters[1].asc_getVal() ? '' : customFilters[1].asc_getVal()) : ''); } } }, save: function () { if (this.api && this.properties && this.rbOr && this.rbAnd && - this.cmbCondition1 && this.cmbCondition2 && this.txtValue1 && this.txtValue2) { + this.cmbCondition1 && this.cmbCondition2 && this.cmbValue1 && this.cmbValue2) { var filterObj = this.properties.asc_getFilterObj(); filterObj.asc_setFilter(new Asc.CustomFilters()); @@ -253,10 +260,10 @@ define([ customFilter.asc_setAnd(this.rbAnd.getValue()); customFilters[0].asc_setOperator(this.cmbCondition1.getValue()); - customFilters[0].asc_setVal(this.txtValue1.getValue()); + customFilters[0].asc_setVal(this.cmbValue1.getValue()); if (this.cmbCondition2.getValue() !== 0) { customFilters[1].asc_setOperator(this.cmbCondition2.getValue() || undefined); - customFilters[1].asc_setVal(this.txtValue2.getValue()); + customFilters[1].asc_setVal(this.cmbValue2.getValue()); } this.api.asc_applyAutoFilter(this.properties); @@ -390,8 +397,8 @@ define([ var me = this; _.defer(function () { - if (me.txtValue1) { - me.txtValue1.focus(); + if (me.spnCount) { + me.spnCount.$input.focus(); } }, 500); }, From 0dd09875b825e93fd1351166177c24c6437471fc Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Wed, 12 Oct 2016 16:32:48 +0300 Subject: [PATCH 4/9] Disable download as, print, save and version history when server is disconnected. --- apps/documenteditor/main/app/controller/LeftMenu.js | 6 +++--- apps/documenteditor/main/app/controller/Main.js | 4 ++-- apps/documenteditor/main/app/controller/Toolbar.js | 6 +++--- apps/documenteditor/main/app/view/FileMenu.js | 6 ++++-- apps/documenteditor/main/app/view/Toolbar.js | 2 ++ apps/documenteditor/main/locale/de.json | 2 +- apps/documenteditor/main/locale/en.json | 4 +--- apps/documenteditor/main/locale/es.json | 2 +- apps/documenteditor/main/locale/fr.json | 2 +- apps/presentationeditor/main/app/controller/LeftMenu.js | 6 +++--- apps/presentationeditor/main/app/controller/Main.js | 4 ++-- apps/presentationeditor/main/app/controller/Toolbar.js | 6 +++--- apps/presentationeditor/main/app/view/FileMenu.js | 4 ++++ apps/presentationeditor/main/app/view/Toolbar.js | 2 +- apps/presentationeditor/main/locale/en.json | 2 +- apps/presentationeditor/main/locale/es.json | 2 +- apps/presentationeditor/main/locale/fr.json | 2 +- apps/spreadsheeteditor/main/app/controller/LeftMenu.js | 6 +++--- apps/spreadsheeteditor/main/app/controller/Main.js | 4 ++-- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 6 +++--- apps/spreadsheeteditor/main/app/view/FileMenu.js | 4 ++++ apps/spreadsheeteditor/main/app/view/Toolbar.js | 1 + apps/spreadsheeteditor/main/locale/en.json | 2 +- apps/spreadsheeteditor/main/locale/es.json | 2 +- apps/spreadsheeteditor/main/locale/fr.json | 2 +- 25 files changed, 50 insertions(+), 39 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 45b04c8c6..30626e67f 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -122,7 +122,7 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onReplaceAll', _.bind(this.onApiTextReplaced, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { @@ -446,7 +446,7 @@ define([ } }, - onApiServerDisconnect: function() { + onApiServerDisconnect: function(disableDownload) { this.mode.isEdit = false; this.leftMenu.close(); @@ -456,7 +456,7 @@ define([ /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(true); - this.leftMenu.getMenu('file').setMode({isDisconnected: true}); + this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload}); if ( this.dlgSearch ) { this.leftMenu.btnSearch.toggle(false, true); this.dlgSearch['hide'](); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index ce7988140..ce3302791 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -1195,7 +1195,7 @@ define([ break; case Asc.c_oAscError.ID.CoAuthoringDisconnect: - config.msg = (this.appOptions.isEdit) ? this.errorCoAuthoringDisconnect : this.errorViewerDisconnect; + config.msg = this.errorViewerDisconnect; break; case Asc.c_oAscError.ID.ConvertationPassword: @@ -1964,7 +1964,7 @@ define([ textNoLicenseTitle: 'ONLYOFFICE open source version', warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.', textContactUs: 'Contact sales', - errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.', + errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.', warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.', titleLicenseExp: 'License expired', openErrorText: 'An error has occurred while opening the file', diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c2f40c4ad..a07326226 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -304,7 +304,7 @@ define([ this.api.asc_registerCallback('asc_onMarkerFormatChanged', _.bind(this.onApiStartHighlight, this)); this.api.asc_registerCallback('asc_onTextHighLight', _.bind(this.onApiHighlightColor, this)); this.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onCanCopyCut', _.bind(this.onApiCanCopyCut, this)); this.api.asc_registerCallback('asc_onMathTypes', _.bind(this.onMathTypes, this)); @@ -2592,8 +2592,8 @@ define([ }); }, - onApiCoAuthoringDisconnect: function() { - this.toolbar.setMode({isDisconnected:true}); + onApiCoAuthoringDisconnect: function(disableDownload) { + this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload}); this.editMode = false; }, diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 7187d1305..d9a6eed04 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -215,6 +215,7 @@ define([ applyMode: function() { this.items[5][this.mode.canPrint?'show':'hide'](); this.items[6][(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); + this.items[6].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); this.items[7][this.mode.canOpenRecent?'show':'hide'](); this.items[8][this.mode.canCreateNew?'show':'hide'](); this.items[8].$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); @@ -261,8 +262,7 @@ define([ this.panels['help'].setLangConfig(this.mode.lang); - this.items[11][this.mode.canUseHistory?'show':'hide'](); - this.items[11].setDisabled(this.mode.isDisconnected); + this.items[11][this.mode.canUseHistory&&!this.mode.isDisconnected?'show':'hide'](); }, setMode: function(mode, delay) { @@ -271,6 +271,8 @@ define([ this.mode.canOpenRecent = this.mode.canCreateNew = false; this.mode.isDisconnected = mode.isDisconnected; this.mode.canRename = false; + this.mode.canPrint = false; + this.mode.canDownload = this.mode.canDownloadOrigin = false; } else { this.mode = mode; } diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index bb8aabb8e..dfdc84a85 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1517,6 +1517,8 @@ define([ this.cmbFontName.setDisabled(true); this.cmbFontSize.setDisabled(true); this.listStyles.setDisabled(true); + if (mode.disableDownload) + this.btnPrint.setDisabled(true); } this.mode = mode; diff --git a/apps/documenteditor/main/locale/de.json b/apps/documenteditor/main/locale/de.json index 9f54529ef..61e3cf093 100644 --- a/apps/documenteditor/main/locale/de.json +++ b/apps/documenteditor/main/locale/de.json @@ -210,7 +210,7 @@ "DE.Controllers.Main.errorUpdateVersion": "Die Dateiversion wurde geändert. Die Seite wird neu geladen.", "DE.Controllers.Main.errorUserDrop": "Kein Zugriff auf diese Datei ist möglich.", "DE.Controllers.Main.errorUsersExceed": "Die nach dem Zahlungsplan erlaubte Anzahl der Benutzer ist überschritten", - "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "DE.Controllers.Main.leavePageText": "Dieses Dokument enthält ungespeicherte Änderungen. Klicken Sie auf \"Auf dieser Seite bleiben\" und dann auf \"Speichern\", um sie zu speichern. Klicken Sie auf \"Diese Seite verlassen\", um alle nicht gespeicherten Änderungen zu verwerfen.\n", "DE.Controllers.Main.loadFontsTextText": "Daten werden geladen...", "DE.Controllers.Main.loadFontsTitleText": "Daten werden geladen", diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index 93734ac68..23c72830c 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -198,8 +198,6 @@ "DE.Controllers.Main.applyChangesTextText": "Loading the changes...", "DE.Controllers.Main.applyChangesTitleText": "Loading the Changes", "del_DE.Controllers.Main.convertationErrorText": "Conversion failed.", - "DE.Controllers.Main.openErrorText": "An error has occurred while opening the file", - "DE.Controllers.Main.saveErrorText": "An error has occurred while saving the file", "DE.Controllers.Main.convertationTimeoutText": "Conversion timeout exceeded.", "DE.Controllers.Main.criticalErrorExtText": "Press \"OK\" to return to document list.", "DE.Controllers.Main.criticalErrorTitle": "Error", @@ -224,7 +222,7 @@ "DE.Controllers.Main.errorUpdateVersion": "The file version has been changed. The page will be reloaded.", "DE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.", "DE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded", - "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "DE.Controllers.Main.leavePageText": "You have unsaved changes in this document. Click \"Stay on This Page\", then \"Save\" to save them. Click \"Leave This Page\" to discard all the unsaved changes.", "DE.Controllers.Main.loadFontsTextText": "Loading data...", "DE.Controllers.Main.loadFontsTitleText": "Loading Data", diff --git a/apps/documenteditor/main/locale/es.json b/apps/documenteditor/main/locale/es.json index 7076c79d7..fc1790b27 100644 --- a/apps/documenteditor/main/locale/es.json +++ b/apps/documenteditor/main/locale/es.json @@ -210,7 +210,7 @@ "DE.Controllers.Main.errorUpdateVersion": "Se ha cambiado la versión del archivo. La página será actualizada.", "DE.Controllers.Main.errorUserDrop": "No se puede acceder al archivo ahora.", "DE.Controllers.Main.errorUsersExceed": "El número de usuarios permitido según su plan de precios fue excedido", - "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "DE.Controllers.Main.leavePageText": "Hay cambios no guardados en este documento. Haga clic en 'Permanecer en esta página', después 'Guardar' para guardarlos. Haga clic en 'Abandonar esta página' para descartar todos los cambios no guardados.", "DE.Controllers.Main.loadFontsTextText": "Cargando datos...", "DE.Controllers.Main.loadFontsTitleText": "Cargando datos", diff --git a/apps/documenteditor/main/locale/fr.json b/apps/documenteditor/main/locale/fr.json index 238e8d94f..3533035f1 100644 --- a/apps/documenteditor/main/locale/fr.json +++ b/apps/documenteditor/main/locale/fr.json @@ -210,7 +210,7 @@ "DE.Controllers.Main.errorUpdateVersion": "La version du fichier a été changée. La page sera rechargée.", "DE.Controllers.Main.errorUserDrop": "Impossible d'accéder au fichier", "DE.Controllers.Main.errorUsersExceed": "Le nombre d'utilisateurs autorisés par le plan tarifaire a été dépassé", - "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "DE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "DE.Controllers.Main.leavePageText": "Vous avez des modifications non enregistrées dans ce document. Cliquez sur 'Rester sur cette page', ensuite sur 'Enregistrer' pour enregistrer les modifications. Cliquez sur 'Quitter cette page' pour annuler toutes les modifications non enregistrées.", "DE.Controllers.Main.loadFontsTextText": "Chargement des données...", "DE.Controllers.Main.loadFontsTitleText": "Chargement des données", diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index f8794b990..7e563df19 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -119,7 +119,7 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onThumbnailsShow', _.bind(this.onThumbnailsShow, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { @@ -344,7 +344,7 @@ define([ // this.api.asc_selectSearchingResults(false); }, - onApiServerDisconnect: function() { + onApiServerDisconnect: function(disableDownload) { this.mode.isEdit = false; this.leftMenu.close(); @@ -354,7 +354,7 @@ define([ /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(true); - this.leftMenu.getMenu('file').setMode({isDisconnected: true}); + this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload}); if ( this.dlgSearch ) { this.leftMenu.btnSearch.toggle(false, true); this.dlgSearch['hide'](); diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index baa3c69c8..57efa7dfc 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -963,7 +963,7 @@ define([ break; case Asc.c_oAscError.ID.CoAuthoringDisconnect: - config.msg = (this.appOptions.isEdit) ? this.errorCoAuthoringDisconnect : this.errorViewerDisconnect; + config.msg = this.errorViewerDisconnect; break; case Asc.c_oAscError.ID.ConvertationPassword: @@ -1779,7 +1779,7 @@ define([ textNoLicenseTitle: 'ONLYOFFICE open source version', warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.', textContactUs: 'Contact sales', - errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.', + errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.', warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.', titleLicenseExp: 'License expired', openErrorText: 'An error has occurred while opening the file', diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index a7062bf86..0db6a057b 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -278,7 +278,7 @@ define([ this.api.asc_registerCallback('asc_onCanUnGroup', _.bind(this.onApiCanUnGroup, this)); this.api.asc_registerCallback('asc_onPresentationSize', _.bind(this.onApiPageSize, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onZoomChange', _.bind(this.onApiZoomChange, this)); this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onApiFocusObject, this)); @@ -684,8 +684,8 @@ define([ this.toolbar.lockToolbar(PE.enumLock.themeLock, false, {array: [this.toolbar.btnColorSchemas]}); }, - onApiCoAuthoringDisconnect: function() { - this.toolbar.setMode({isDisconnected:true}); + onApiCoAuthoringDisconnect: function(disableDownload) { + this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload}); this.editMode = false; }, diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 46b94f94b..da463c62d 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -212,6 +212,7 @@ define([ applyMode: function() { this.items[5][this.mode.canPrint?'show':'hide'](); this.items[6][(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); + this.items[6].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); this.items[7][this.mode.canOpenRecent?'show':'hide'](); this.items[8][this.mode.canCreateNew?'show':'hide'](); this.items[8].$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); @@ -258,7 +259,10 @@ define([ if (mode.isDisconnected) { this.mode.canEdit = this.mode.isEdit = false; this.mode.canOpenRecent = this.mode.canCreateNew = false; + this.mode.isDisconnected = mode.isDisconnected; this.mode.canRename = false; + this.mode.canPrint = false; + this.mode.canDownload = false; } else { this.mode = mode; } diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index f9c837390..7f2ee762c 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1287,7 +1287,7 @@ define([ this.mnuitemHideTitleBar.hide(); } - this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint, {array: [this.btnPrint]}); + this.lockToolbar(PE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]}); }, changeViewMode: function(item, compact) { diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index d44929f8b..7f5687b99 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -135,7 +135,7 @@ "PE.Controllers.Main.errorUpdateVersion": "The file version has been changed. The page will be reloaded.", "PE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.", "PE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded", - "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "PE.Controllers.Main.leavePageText": "You have unsaved changes in this presentation. Click \"Stay on This Page\", then \"Save\" to save them. Click \"Leave This Page\" to discard all the unsaved changes.", "PE.Controllers.Main.loadFontsTextText": "Loading data...", "PE.Controllers.Main.loadFontsTitleText": "Loading Data", diff --git a/apps/presentationeditor/main/locale/es.json b/apps/presentationeditor/main/locale/es.json index 9fbd8f50c..21a2fe207 100644 --- a/apps/presentationeditor/main/locale/es.json +++ b/apps/presentationeditor/main/locale/es.json @@ -123,7 +123,7 @@ "PE.Controllers.Main.errorUpdateVersion": "Se ha cambiado la versión del archivo. La página será actualizada.", "PE.Controllers.Main.errorUserDrop": "No se puede acceder al archivo ahora.", "PE.Controllers.Main.errorUsersExceed": "El número de usuarios permitido según su plan de precios fue excedido", - "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "PE.Controllers.Main.leavePageText": "Hay cambios no guardados en esta presentación. Pulse \"Permanecer en esta página\", después \"Guardar\" para guardadarlos. Pulse \"Abandonar esta página\" para descartar todos los cambios no guardados.", "PE.Controllers.Main.loadFontsTextText": "Cargando datos...", "PE.Controllers.Main.loadFontsTitleText": "Cargando datos", diff --git a/apps/presentationeditor/main/locale/fr.json b/apps/presentationeditor/main/locale/fr.json index 406607cd3..7201bf8a1 100644 --- a/apps/presentationeditor/main/locale/fr.json +++ b/apps/presentationeditor/main/locale/fr.json @@ -123,7 +123,7 @@ "PE.Controllers.Main.errorUpdateVersion": "La version du fichier a été changée. La page sera rechargée.", "PE.Controllers.Main.errorUserDrop": "Impossible d'accéder au fichier", "PE.Controllers.Main.errorUsersExceed": "Le nombre d'utilisateurs autorisés par le plan tarifaire a été dépassé", - "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "PE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "PE.Controllers.Main.leavePageText": "Vous avez des modifications non enregistrées dans cette présentation. Cliquez sur \"Rester sur cette page\", ensuite sur \"Enregistrer\" pour enregistrer les modifications. Cliquez sur \"Quitter cette page\" pour annuler toutes les modifications non enregistrées.", "PE.Controllers.Main.loadFontsTextText": "Chargement des données...", "PE.Controllers.Main.loadFontsTitleText": "Chargement des données", diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index e5482dcbc..3bc0df158 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -127,7 +127,7 @@ define([ setApi: function(api) { this.api = api; this.api.asc_registerCallback('asc_onRenameCellTextEnd', _.bind(this.onRenameText, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect', _.bind(this.onApiServerDisconnect, this, true)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiServerDisconnect, this)); /** coauthoring begin **/ if (this.mode.canCoAuthoring) { @@ -509,7 +509,7 @@ define([ } }, - onApiServerDisconnect: function() { + onApiServerDisconnect: function(disableDownload) { this.mode.isEdit = false; this.leftMenu.close(); @@ -519,7 +519,7 @@ define([ /** coauthoring end **/ this.leftMenu.btnPlugins.setDisabled(true); - this.leftMenu.getMenu('file').setMode({isDisconnected: true}); + this.leftMenu.getMenu('file').setMode({isDisconnected: true, disableDownload: !!disableDownload}); if ( this.dlgSearch ) { this.leftMenu.btnSearch.toggle(false, true); this.dlgSearch['hide'](); diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 5f64f6fdb..ba4b3cc2b 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1076,7 +1076,7 @@ define([ break; case Asc.c_oAscError.ID.CoAuthoringDisconnect: - config.msg = (this.appOptions.isEdit) ? this.errorCoAuthoringDisconnect : this.errorViewerDisconnect; + config.msg = this.errorViewerDisconnect; break; case Asc.c_oAscError.ID.ConvertationPassword: @@ -1969,7 +1969,7 @@ define([ warnNoLicense: 'You are using an open source version of ONLYOFFICE. The version has limitations for concurrent connections to the document server (20 connections at a time).<br>If you need more please consider purchasing a commercial license.', textContactUs: 'Contact sales', confirmPutMergeRange: 'The source data contains merged cells.<br>They will be unmerged before they are pasted into the table.', - errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.', + errorViewerDisconnect: 'Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.', warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.', titleLicenseExp: 'License expired', openErrorText: 'An error has occurred while opening the file', diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index bd2b39d10..5129c25fc 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -269,7 +269,7 @@ define([ this.api.asc_registerCallback('asc_onInitTablePictures', _.bind(this.onApiInitTableTemplates, this)); this.api.asc_registerCallback('asc_onInitEditorStyles', _.bind(this.onApiInitEditorStyles, this)); - this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this)); + this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this, true)); Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this)); this.api.asc_registerCallback('asc_onLockDefNameManager', _.bind(this.onLockDefNameManager, this)); this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this)); @@ -1374,8 +1374,8 @@ define([ window.styles_loaded = true; }, - onApiCoAuthoringDisconnect: function() { - this.toolbar.setMode({isDisconnected:true}); + onApiCoAuthoringDisconnect: function(disableDownload) { + this.toolbar.setMode({isDisconnected:true, disableDownload: !!disableDownload}); this.editMode = false; }, diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 69577f294..ff7b248c5 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -198,6 +198,7 @@ define([ applyMode: function() { this.items[5][this.mode.canPrint?'show':'hide'](); this.items[6][(this.mode.canRename && !this.mode.isDesktopApp) ?'show':'hide'](); + this.items[6].$el.find('+.devider')[!this.mode.isDisconnected?'show':'hide'](); this.items[7][this.mode.canOpenRecent?'show':'hide'](); this.items[8][this.mode.canCreateNew?'show':'hide'](); this.items[8].$el.find('+.devider')[this.mode.canCreateNew?'show':'hide'](); @@ -242,7 +243,10 @@ define([ if (mode.isDisconnected) { this.mode.canEdit = this.mode.isEdit = false; this.mode.canOpenRecent = this.mode.canCreateNew = false; + this.mode.isDisconnected = mode.isDisconnected; this.mode.canRename = false; + this.mode.canPrint = false; + this.mode.canDownload = false; } else { this.mode = mode; } diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 5d4f096c6..d9afcc7a3 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1684,6 +1684,7 @@ define([ this.lockToolbar( SSE.enumLock.lostConnect, true ); this.lockToolbar( SSE.enumLock.lostConnect, true, {array:[this.btnEditChart,this.btnUndo,this.btnRedo,this.btnOpenDocument,this.btnNewDocument,this.btnSave]} ); + this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]}); } else { this.mode = mode; diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index c5900342b..05ed1e1ee 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -173,7 +173,7 @@ "SSE.Controllers.Main.errorUpdateVersion": "The file version has been changed. The page will be reloaded.", "SSE.Controllers.Main.errorUserDrop": "The file cannot be accessed right now.", "SSE.Controllers.Main.errorUsersExceed": "The number of users allowed by the pricing plan was exceeded", - "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "SSE.Controllers.Main.errorWrongBracketsCount": "An error in the entered formula.<br>Wrong number of brackets is used.", "SSE.Controllers.Main.errorWrongOperator": "An error in the entered formula. Wrong operator is used.<br>Please correct the error or use the Esc button to cancel the formula editing.", "SSE.Controllers.Main.leavePageText": "You have unsaved changes in this spreadsheet. Click 'Stay on this Page' then 'Save' to save them. Click 'Leave this Page' to discard all the unsaved changes.", diff --git a/apps/spreadsheeteditor/main/locale/es.json b/apps/spreadsheeteditor/main/locale/es.json index 891234a3a..edc45f3ef 100644 --- a/apps/spreadsheeteditor/main/locale/es.json +++ b/apps/spreadsheeteditor/main/locale/es.json @@ -167,7 +167,7 @@ "SSE.Controllers.Main.errorUpdateVersion": "Se ha cambiado la versión del archivo. La página será actualizada.", "SSE.Controllers.Main.errorUserDrop": "No se puede acceder al archivo ahora.", "SSE.Controllers.Main.errorUsersExceed": "El número de usuarios permitido según su plan de precios fue excedido", - "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "SSE.Controllers.Main.errorWrongBracketsCount": "Un error en la fórmula introducida.<br>Número incorrecto de corchetes es usado.", "SSE.Controllers.Main.errorWrongOperator": "Un error en la fórmula introducida.Operador inválido es usado.<br>Por favor, corrija el error o utilice el botón Esc para cancelar la edición de fórmulas.", "SSE.Controllers.Main.leavePageText": "Usted tiene cambios no guardados en esta hoja de cálculo. Haga clic en 'Permanecer en esta página', después 'Guardar' para guardarlos. Haga clic en 'Abandonar esta página' para descartar todos los cambios no guardados.", diff --git a/apps/spreadsheeteditor/main/locale/fr.json b/apps/spreadsheeteditor/main/locale/fr.json index 33baf2931..49a50d198 100644 --- a/apps/spreadsheeteditor/main/locale/fr.json +++ b/apps/spreadsheeteditor/main/locale/fr.json @@ -167,7 +167,7 @@ "SSE.Controllers.Main.errorUpdateVersion": "La version du fichier a été changée. La page sera rechargée.", "SSE.Controllers.Main.errorUserDrop": "Impossible d'accéder au fichier", "SSE.Controllers.Main.errorUsersExceed": "Le nombre d'utilisateurs autorisés par le plan tarifaire a été dépassé", - "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download until the connection is restored.", + "SSE.Controllers.Main.errorViewerDisconnect": "Connection is lost. You can still view the document,<br>but will not be able to download or print until the connection is restored.", "SSE.Controllers.Main.errorWrongBracketsCount": "Une erreur dans la formule entrée.<br>Nombre utilisé entre parenthèses est incorrect.", "SSE.Controllers.Main.errorWrongOperator": "Une erreur dans la formule entrée.<br>Opérateur utilisé est incorrect.<br>Veuillez corriger l'erreur ou utilisez le bouton Esc pour annuler l'édition de formule.", "SSE.Controllers.Main.leavePageText": "Vous avez des modifications non enregistrées dans cette feuille de calcul. Cliquez sur 'Rester sur cette page ' ensuite 'Enregistrer' pour les enregistrer. Cliquez sur 'Quitter cette page' pour annuler toutes les modifications non enregistrées.", From f59b72e9ac1a221cd726d5a1a900b9f118f39796 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Wed, 12 Oct 2016 18:38:10 +0300 Subject: [PATCH 5/9] [DE] [SSE] Init shape settings in the right panel before first opening. --- apps/documenteditor/main/app/controller/Main.js | 4 ++-- apps/documenteditor/main/app/controller/RightMenu.js | 1 + apps/documenteditor/main/app/view/ChartSettings.js | 5 ++--- apps/documenteditor/main/app/view/HeaderFooterSettings.js | 5 ++--- apps/documenteditor/main/app/view/ImageSettings.js | 5 ++--- apps/documenteditor/main/app/view/MailMergeSettings.js | 6 +++--- apps/documenteditor/main/app/view/ParagraphSettings.js | 5 ++--- apps/documenteditor/main/app/view/ShapeSettings.js | 2 +- apps/documenteditor/main/app/view/TableSettings.js | 2 +- apps/documenteditor/main/app/view/TextArtSettings.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 3 ++- apps/spreadsheeteditor/main/app/controller/RightMenu.js | 1 + apps/spreadsheeteditor/main/app/view/ChartSettings.js | 5 ++--- apps/spreadsheeteditor/main/app/view/ImageSettings.js | 5 ++--- apps/spreadsheeteditor/main/app/view/ParagraphSettings.js | 5 ++--- apps/spreadsheeteditor/main/app/view/ShapeSettings.js | 2 +- apps/spreadsheeteditor/main/app/view/TableSettings.js | 6 +++--- apps/spreadsheeteditor/main/app/view/TextArtSettings.js | 2 +- 18 files changed, 31 insertions(+), 35 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index ce3302791..1171d9962 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -872,12 +872,12 @@ define([ documentHolderController.getView('DocumentHolder').createDelayedElements(); me.loadLanguages(); - rightmenuController.createDelayedElements(); - var shapes = me.api.asc_getPropertyEditorShapes(); if (shapes) me.fillAutoShapes(shapes[0], shapes[1]); + rightmenuController.createDelayedElements(); + me.updateThemeColors(); toolbarController.activateControls(); if (me.needToUpdateVersion) diff --git a/apps/documenteditor/main/app/controller/RightMenu.js b/apps/documenteditor/main/app/controller/RightMenu.js index 8508b08a1..a02320a16 100644 --- a/apps/documenteditor/main/app/controller/RightMenu.js +++ b/apps/documenteditor/main/app/controller/RightMenu.js @@ -269,6 +269,7 @@ define([ } if (this.editMode && this.api) { + this.rightmenu.shapeSettings.createDelayedElements(); var selectedElements = this.api.getSelectedElements(); if (selectedElements.length>0) { var open = Common.localStorage.getItem("de-hide-right-settings"); diff --git a/apps/documenteditor/main/app/view/ChartSettings.js b/apps/documenteditor/main/app/view/ChartSettings.js index a1d7a1ba8..1eba1e243 100644 --- a/apps/documenteditor/main/app/view/ChartSettings.js +++ b/apps/documenteditor/main/app/view/ChartSettings.js @@ -105,10 +105,8 @@ define([ }, ChangeSettings: function(props) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); @@ -307,6 +305,7 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.updateMetricUnit(); + this._initSettings = false; }, _ChartWrapStyleChanged: function(style) { diff --git a/apps/documenteditor/main/app/view/HeaderFooterSettings.js b/apps/documenteditor/main/app/view/HeaderFooterSettings.js index 233f29130..937a8be04 100644 --- a/apps/documenteditor/main/app/view/HeaderFooterSettings.js +++ b/apps/documenteditor/main/app/view/HeaderFooterSettings.js @@ -94,10 +94,8 @@ define([ }, ChangeSettings: function(prop) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); @@ -244,6 +242,7 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.updateMetricUnit(); + this._initSettings = false; }, setLocked: function (locked) { diff --git a/apps/documenteditor/main/app/view/ImageSettings.js b/apps/documenteditor/main/app/view/ImageSettings.js index 6f0cb29d5..0223fe7fd 100644 --- a/apps/documenteditor/main/app/view/ImageSettings.js +++ b/apps/documenteditor/main/app/view/ImageSettings.js @@ -182,13 +182,12 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.updateMetricUnit(); + this._initSettings = false; }, ChangeSettings: function(props) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); diff --git a/apps/documenteditor/main/app/view/MailMergeSettings.js b/apps/documenteditor/main/app/view/MailMergeSettings.js index 4ece50e2e..256669a41 100644 --- a/apps/documenteditor/main/app/view/MailMergeSettings.js +++ b/apps/documenteditor/main/app/view/MailMergeSettings.js @@ -380,13 +380,13 @@ define([ this.cmbMergeTo.setValue(this._arrMergeSrc[0].value); } } + + this._initSettings = false; }, ChangeSettings: function(props) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedControls(); - this._initSettings = false; - } this.disableInsertControls(this._locked); diff --git a/apps/documenteditor/main/app/view/ParagraphSettings.js b/apps/documenteditor/main/app/view/ParagraphSettings.js index b9ce88807..c79b66775 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettings.js +++ b/apps/documenteditor/main/app/view/ParagraphSettings.js @@ -276,10 +276,8 @@ define([ }, ChangeSettings: function(prop) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); this.hideTextOnlySettings(this.isChart); @@ -397,6 +395,7 @@ define([ createDelayedElements: function() { this.UpdateThemeColors(); this.updateMetricUnit(); + this._initSettings = false; }, openAdvancedSettings: function(e) { diff --git a/apps/documenteditor/main/app/view/ShapeSettings.js b/apps/documenteditor/main/app/view/ShapeSettings.js index 9085b782d..0e13335b9 100644 --- a/apps/documenteditor/main/app/view/ShapeSettings.js +++ b/apps/documenteditor/main/app/view/ShapeSettings.js @@ -764,7 +764,6 @@ define([ if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; if (props && props.get_ShapeProperties()) { @@ -1450,6 +1449,7 @@ define([ this.fillAutoShapes(); this.UpdateThemeColors(); + this._initSettings = false; }, onInitStandartTextures: function(texture) { diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 2a5a4f7db..826da4c1a 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -423,12 +423,12 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.UpdateThemeColors(); + this._initSettings = false; }, ChangeSettings: function(props) { if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; this.disableControls(this._locked); diff --git a/apps/documenteditor/main/app/view/TextArtSettings.js b/apps/documenteditor/main/app/view/TextArtSettings.js index 65f6a32e8..37d395a23 100644 --- a/apps/documenteditor/main/app/view/TextArtSettings.js +++ b/apps/documenteditor/main/app/view/TextArtSettings.js @@ -515,7 +515,6 @@ define([ if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; if (props && props.get_ShapeProperties() && props.get_ShapeProperties().get_TextArtProperties()) { @@ -965,6 +964,7 @@ define([ this.createDelayedControls(); this.UpdateThemeColors(); this.fillTransform(this.api.asc_getPropertyEditorTextArts()); + this._initSettings = false; }, fillTextArt: function() { diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index ba4b3cc2b..5bc7ca149 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -646,7 +646,6 @@ define([ documentHolderView.createDelayedElements(); toolbarController.createDelayedElements(); - rightmenuController.createDelayedElements(); if (!me.appOptions.isEditMailMerge && !me.appOptions.isEditDiagram) { var shapes = me.api.asc_getPropertyEditorShapes(); @@ -657,6 +656,8 @@ define([ me.updateThemeColors(); } + rightmenuController.createDelayedElements(); + me.api.asc_registerCallback('asc_onSaveUrl', _.bind(me.onSaveUrl, me)); me.api.asc_registerCallback('asc_onDocumentModifiedChanged', _.bind(me.onDocumentModifiedChanged, me)); me.api.asc_registerCallback('asc_onDocumentCanSaveChanged', _.bind(me.onDocumentCanSaveChanged, me)); diff --git a/apps/spreadsheeteditor/main/app/controller/RightMenu.js b/apps/spreadsheeteditor/main/app/controller/RightMenu.js index dc61d8f92..f318d6127 100644 --- a/apps/spreadsheeteditor/main/app/controller/RightMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/RightMenu.js @@ -266,6 +266,7 @@ define([ this.api.asc_registerCallback('asc_onFocusObject', _.bind(this.onFocusObject, this)); this.api.asc_registerCallback('asc_onSelectionChanged', _.bind(this.onSelectionChanged, this)); this.api.asc_registerCallback('asc_doubleClickOnObject', _.bind(this.onDoubleClickOnObject, this)); + this.rightmenu.shapeSettings.createDelayedElements(); this.onSelectionChanged(this.api.asc_getCellInfo()); } }, diff --git a/apps/spreadsheeteditor/main/app/view/ChartSettings.js b/apps/spreadsheeteditor/main/app/view/ChartSettings.js index 5d05d781a..d4c8f019e 100644 --- a/apps/spreadsheeteditor/main/app/view/ChartSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ChartSettings.js @@ -102,10 +102,8 @@ define([ }, ChangeSettings: function(props) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); @@ -316,6 +314,7 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.updateMetricUnit(); + this._initSettings = false; }, onWidthChange: function(field, newValue, oldValue, eOpts){ diff --git a/apps/spreadsheeteditor/main/app/view/ImageSettings.js b/apps/spreadsheeteditor/main/app/view/ImageSettings.js index 8ce56786f..e2e8c4799 100644 --- a/apps/spreadsheeteditor/main/app/view/ImageSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ImageSettings.js @@ -193,13 +193,12 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.updateMetricUnit(); + this._initSettings = false; }, ChangeSettings: function(props) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); diff --git a/apps/spreadsheeteditor/main/app/view/ParagraphSettings.js b/apps/spreadsheeteditor/main/app/view/ParagraphSettings.js index 5f44e337c..d3192c21d 100644 --- a/apps/spreadsheeteditor/main/app/view/ParagraphSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ParagraphSettings.js @@ -177,10 +177,8 @@ define([ }, ChangeSettings: function(prop) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; - } this.disableControls(this._locked); @@ -328,6 +326,7 @@ define([ createDelayedElements: function() { this.createDelayedControls(); this.updateMetricUnit(); + this._initSettings = false; }, openAdvancedSettings: function(e) { diff --git a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js index 11aa984ca..28ebe0db4 100644 --- a/apps/spreadsheeteditor/main/app/view/ShapeSettings.js +++ b/apps/spreadsheeteditor/main/app/view/ShapeSettings.js @@ -698,7 +698,6 @@ define([ ChangeSettings: function(props) { if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; if (this.imgprops==null) this.imgprops = new Asc.asc_CImgProperty(); @@ -1336,6 +1335,7 @@ define([ this.fillAutoShapes(); this.UpdateThemeColors(); + this._initSettings = false; }, onInitStandartTextures: function(texture) { diff --git a/apps/spreadsheeteditor/main/app/view/TableSettings.js b/apps/spreadsheeteditor/main/app/view/TableSettings.js index 8dd4b2bf8..bafa46c25 100644 --- a/apps/spreadsheeteditor/main/app/view/TableSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TableSettings.js @@ -249,13 +249,13 @@ define([ }, this)); this.btnEdit.menu.on('item:click', _.bind(this.onEditClick, this)); this.lockedControls.push(this.btnEdit); + + this._initSettings = false; }, ChangeSettings: function(props) { - if (this._initSettings) { + if (this._initSettings) this.createDelayedControls(); - this._initSettings = false; - } this.disableControls(this._locked); diff --git a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js index 48c5c1978..914ed9caf 100644 --- a/apps/spreadsheeteditor/main/app/view/TextArtSettings.js +++ b/apps/spreadsheeteditor/main/app/view/TextArtSettings.js @@ -664,7 +664,6 @@ define([ if (this._initSettings) this.createDelayedElements(); - this._initSettings = false; if (props && props.asc_getShapeProperties() && props.asc_getShapeProperties().get_TextArtProperties()) { @@ -1310,6 +1309,7 @@ define([ this.UpdateThemeColors(); this.fillTransform(this.api.asc_getPropertyEditorTextArts()); + this._initSettings = false; }, onInitStandartTextures: function(texture) { From ee13c7a3f3819982740645bd7dbb9fae683e40a5 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Thu, 13 Oct 2016 11:40:59 +0300 Subject: [PATCH 6/9] [DE] Fix Bug 33038. --- apps/documenteditor/main/app/controller/Main.js | 6 +++++- apps/documenteditor/main/app/controller/Toolbar.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 1171d9962..04d46adc4 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -520,7 +520,11 @@ define([ toolbarView.btnInsertShape.toggle(false, false); toolbarView.btnInsertText.toggle(false, false); } - + if (this.appOptions.isEdit && toolbarView && toolbarView.btnHighlightColor.pressed && + ( !_.isObject(arguments[1]) || arguments[1].id !== 'id-toolbar-btn-highlight')) { + this.api.SetMarkerFormat(false); + toolbarView.btnHighlightColor.toggle(false, false); + } application.getController('DocumentHolder').getView('DocumentHolder').focus(); if (this.api) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index a07326226..9e62acba4 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2554,7 +2554,7 @@ define([ me.api.SetMarkerFormat(true, true, parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)); } - Common.NotificationCenter.trigger('edit:complete', me.toolbar); + Common.NotificationCenter.trigger('edit:complete', me.toolbar, me.toolbar.btnHighlightColor); Common.component.Analytics.trackEvent('ToolBar', 'Highlight Color'); }, From 0817331b326529ef07037fdfeb7f305adb85ecd9 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Thu, 13 Oct 2016 13:45:06 +0300 Subject: [PATCH 7/9] [SSE] Bug 33196. --- apps/spreadsheeteditor/main/app/controller/Main.js | 7 ++++++- apps/spreadsheeteditor/main/locale/en.json | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index 5bc7ca149..d624294d9 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -1145,6 +1145,10 @@ define([ config.msg = this.errorFrmlWrongReferences; break; + case Asc.c_oAscError.ID.CopyMultiselectAreaError: + config.msg = this.errorCopyMultiselectArea; + break; + default: config.msg = this.errorDefaultMessage.replace('%1', id); break; @@ -1974,7 +1978,8 @@ define([ warnLicenseExp: 'Your license has expired.<br>Please update your license and refresh the page.', titleLicenseExp: 'License expired', openErrorText: 'An error has occurred while opening the file', - saveErrorText: 'An error has occurred while saving the file' + saveErrorText: 'An error has occurred while saving the file', + errorCopyMultiselectArea: 'This command cannot be used with multiple selections.<br>Select a single range and try again.' } })(), SSE.Controllers.Main || {})) }); diff --git a/apps/spreadsheeteditor/main/locale/en.json b/apps/spreadsheeteditor/main/locale/en.json index 05ed1e1ee..167a1dca4 100644 --- a/apps/spreadsheeteditor/main/locale/en.json +++ b/apps/spreadsheeteditor/main/locale/en.json @@ -145,6 +145,7 @@ "SSE.Controllers.Main.errorBadImageUrl": "Image URL is incorrect", "SSE.Controllers.Main.errorCoAuthoringDisconnect": "Server connection lost. The document cannot be edited right now.", "SSE.Controllers.Main.errorConnectToServer": "The document could not be saved. Please check connection settings or contact your administrator.<br>When you click the 'OK' button, you will be prompted to download the document.<br><br>Find more information about connecting Document Server <a href=\"https://api.onlyoffice.com/editors/callback\" target=\"_blank\">here</a>", + "SSE.Controllers.Main.errorCopyMultiselectArea": "This command cannot be used with multiple selections.<br>Select a single range and try again.", "SSE.Controllers.Main.errorCountArg": "An error in the entered formula.<br>Incorrect number of arguments is used.", "SSE.Controllers.Main.errorCountArgExceed": "An error in the entered formula.<br>Number of arguments is exceeded.", "SSE.Controllers.Main.errorCreateDefName": "The existing named ranges cannot be edited and the new ones cannot be created<br>at the moment as some of them are being edited.", From 488e7d4f3237177ee6d9960be7d5004d42db5d9f Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Thu, 13 Oct 2016 14:08:52 +0300 Subject: [PATCH 8/9] [DE] Align layout of history panel and file menu items. --- apps/common/main/resources/less/history.less | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/common/main/resources/less/history.less b/apps/common/main/resources/less/history.less index 6b5e10621..340c64b37 100644 --- a/apps/common/main/resources/less/history.less +++ b/apps/common/main/resources/less/history.less @@ -5,7 +5,7 @@ #history-header { position: absolute; - height: 45px; + height: 53px; left: 0; top: 0; right: 0; @@ -14,7 +14,7 @@ #history-btn-back { height: 27px; - margin-top: 8px; + margin-top: 15px; padding-top: 4px; padding-left: 20px; font-size: 13px; @@ -52,7 +52,7 @@ #history-list { height: 100%; overflow: hidden; - padding: 45px 0; + padding: 53px 0 45px 0; .item { display: block; From 0a4a5c9aeb84f2351b432d1a9123cc77df11ed80 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova <Julia.Radzhabova@onlyoffice.com> Date: Thu, 13 Oct 2016 16:14:11 +0300 Subject: [PATCH 9/9] Highlight document name when it can be renamed (when mouse is over document caption). --- apps/common/main/resources/less/header.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/main/resources/less/header.less b/apps/common/main/resources/less/header.less index 16033b322..457b1a24b 100644 --- a/apps/common/main/resources/less/header.less +++ b/apps/common/main/resources/less/header.less @@ -87,7 +87,7 @@ display: inline-block; padding: 2px 8px; - &.renamed { + &.renamed:hover { background-color: @app-header-bg-color-dark; } }