From 291128cad70272c9e7a3ad55fdd19ecf23ad64d3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 18 Apr 2018 14:47:48 +0300 Subject: [PATCH 1/4] [Mobile] Go to editing mode from toolbar --- apps/documenteditor/mobile/app/template/Toolbar.template | 3 +++ apps/documenteditor/mobile/app/view/Toolbar.js | 9 ++++++++- .../mobile/app/template/Toolbar.template | 3 +++ apps/presentationeditor/mobile/app/view/Toolbar.js | 9 ++++++++- .../mobile/app/template/Toolbar.template | 3 +++ apps/spreadsheeteditor/mobile/app/view/Toolbar.js | 9 ++++++++- 6 files changed, 33 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/mobile/app/template/Toolbar.template b/apps/documenteditor/mobile/app/template/Toolbar.template index 7fbaf69d2..9822b76b6 100644 --- a/apps/documenteditor/mobile/app/template/Toolbar.template +++ b/apps/documenteditor/mobile/app/template/Toolbar.template @@ -34,6 +34,9 @@ + <% if (!phone) { %> diff --git a/apps/documenteditor/mobile/app/view/Toolbar.js b/apps/documenteditor/mobile/app/view/Toolbar.js index 2612f4e89..d1039415f 100644 --- a/apps/documenteditor/mobile/app/view/Toolbar.js +++ b/apps/documenteditor/mobile/app/view/Toolbar.js @@ -62,7 +62,8 @@ define([ "click #toolbar-search" : "searchToggle", "click #toolbar-edit" : "showEdition", "click #toolbar-add" : "showInserts", - "click #toolbar-settings" : "showSettings" + "click #toolbar-settings" : "showSettings", + "click #toolbar-edit-document": "editDocument" }, // Set innerHTML and get the references to the DOM elements @@ -100,6 +101,8 @@ define([ setMode: function (mode) { if (mode.isEdit) { $('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show(); + } else if (mode.canEdit && mode.canRequestEditRights){ + $('#toolbar-edit-document').show(); } }, @@ -147,6 +150,10 @@ define([ DE.getController('Settings').showModal(); }, + editDocument: function () { + Common.Gateway.requestEditRights(); + }, + textBack: 'Back' } })(), DE.Views.Toolbar || {})) diff --git a/apps/presentationeditor/mobile/app/template/Toolbar.template b/apps/presentationeditor/mobile/app/template/Toolbar.template index 3fdbea786..aae24fa0d 100644 --- a/apps/presentationeditor/mobile/app/template/Toolbar.template +++ b/apps/presentationeditor/mobile/app/template/Toolbar.template @@ -37,6 +37,9 @@ + <% if (!phone) { %> diff --git a/apps/presentationeditor/mobile/app/view/Toolbar.js b/apps/presentationeditor/mobile/app/view/Toolbar.js index 1cf717fcd..ef1f304e6 100644 --- a/apps/presentationeditor/mobile/app/view/Toolbar.js +++ b/apps/presentationeditor/mobile/app/view/Toolbar.js @@ -63,7 +63,8 @@ define([ "click #toolbar-edit" : "showEdition", "click #toolbar-add" : "showInserts", "click #toolbar-settings" : "showSettings", - "click #toolbar-preview" : "showPreview" + "click #toolbar-preview" : "showPreview", + "click #toolbar-edit-document": "editDocument" }, // Set innerHTML and get the references to the DOM elements @@ -101,6 +102,8 @@ define([ setMode: function (mode) { if (mode.isEdit) { $('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show(); + } else if (mode.canEdit && mode.canRequestEditRights){ + $('#toolbar-edit-document').show(); } }, @@ -152,6 +155,10 @@ define([ PE.getController('DocumentPreview').show(); }, + editDocument: function () { + Common.Gateway.requestEditRights(); + }, + textBack: 'Back' } })(), PE.Views.Toolbar || {})) diff --git a/apps/spreadsheeteditor/mobile/app/template/Toolbar.template b/apps/spreadsheeteditor/mobile/app/template/Toolbar.template index f81740d58..189899266 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/mobile/app/template/Toolbar.template @@ -34,6 +34,9 @@ + <% if (!phone) { %> diff --git a/apps/spreadsheeteditor/mobile/app/view/Toolbar.js b/apps/spreadsheeteditor/mobile/app/view/Toolbar.js index dd7e21eac..d9142d328 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/mobile/app/view/Toolbar.js @@ -62,7 +62,8 @@ define([ "click #toolbar-search" : "searchToggle", "click #toolbar-edit" : "showEdition", "click #toolbar-add" : "showInserts", - "click #toolbar-settings" : "showSettings" + "click #toolbar-settings" : "showSettings", + "click #toolbar-edit-document": "editDocument" }, // Set innerHTML and get the references to the DOM elements @@ -93,6 +94,8 @@ define([ setMode: function (mode) { if (mode.isEdit) { $('#toolbar-edit, #toolbar-add, #toolbar-undo, #toolbar-redo').show(); + } else if (mode.canEdit && mode.canRequestEditRights){ + $('#toolbar-edit-document').show(); } }, @@ -148,6 +151,10 @@ define([ this.$btnEdit.toggleClass('disabled', val); }, + editDocument: function () { + Common.Gateway.requestEditRights(); + }, + textBack: 'Back' } })(), SSE.Views.Toolbar || {})) From a5caa3c2e3e3a8ee11e9282284af8564bf2e0483 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 18 Apr 2018 14:54:42 +0300 Subject: [PATCH 2/4] [Mobile] Remove editing mode from settings --- .../documenteditor/mobile/app/controller/Settings.js | 5 ----- .../mobile/app/template/Settings.template | 12 ------------ apps/documenteditor/mobile/app/view/Settings.js | 3 --- .../mobile/app/controller/Settings.js | 5 ----- .../mobile/app/template/Settings.template | 12 ------------ apps/presentationeditor/mobile/app/view/Settings.js | 3 --- .../mobile/app/controller/Settings.js | 5 ----- .../mobile/app/template/Settings.template | 12 ------------ apps/spreadsheeteditor/mobile/app/view/Settings.js | 3 --- 9 files changed, 60 deletions(-) diff --git a/apps/documenteditor/mobile/app/controller/Settings.js b/apps/documenteditor/mobile/app/controller/Settings.js index 17e6cc0dc..79dd2388d 100644 --- a/apps/documenteditor/mobile/app/controller/Settings.js +++ b/apps/documenteditor/mobile/app/controller/Settings.js @@ -193,7 +193,6 @@ define([ $('#settings-readermode input:checkbox').attr('checked', Common.SharedSettings.get('readerMode')); $('#settings-search').single('click', _.bind(me.onSearch, me)); $('#settings-readermode input:checkbox').single('change', _.bind(me.onReaderMode, me)); - $('#settings-edit-document').single('click', _.bind(me.onEditDocumet, me)); $('#settings-help').single('click', _.bind(me.onShowHelp, me)); $('#settings-download').single('click', _.bind(me.onDownloadOrigin, me)); } @@ -267,10 +266,6 @@ define([ // Handlers - onEditDocumet: function() { - Common.Gateway.requestEditRights(); - }, - onSearch: function (e) { var toolbarView = DE.getController('Toolbar').getView('Toolbar'); diff --git a/apps/documenteditor/mobile/app/template/Settings.template b/apps/documenteditor/mobile/app/template/Settings.template index 05f98691a..218a43a36 100644 --- a/apps/documenteditor/mobile/app/template/Settings.template +++ b/apps/documenteditor/mobile/app/template/Settings.template @@ -25,18 +25,6 @@ <% } %> -
  • - -
    -
    - -
    -
    -
    <%= scope.textEditDoc %>
    -
    -
    -
    -
  • diff --git a/apps/documenteditor/mobile/app/view/Settings.js b/apps/documenteditor/mobile/app/view/Settings.js index e5a619d5a..98fc3697c 100644 --- a/apps/documenteditor/mobile/app/view/Settings.js +++ b/apps/documenteditor/mobile/app/view/Settings.js @@ -108,10 +108,8 @@ define([ isPhone = Common.SharedSettings.get('phone'); if (_isEdit) { - $layour.find('#settings-edit-document').hide(); $layour.find('#settings-search .item-title').text(this.textFindAndReplace) } else { - if (!_canEdit) $layour.find('#settings-edit-document').hide(); $layour.find('#settings-document').hide(); } if (!_canReader) @@ -213,7 +211,6 @@ define([ permissions = _.extend(permissions, data.doc.permissions); if (permissions.edit === false) { - $('#settings-edit-document').hide(); } } }, diff --git a/apps/presentationeditor/mobile/app/controller/Settings.js b/apps/presentationeditor/mobile/app/controller/Settings.js index ac10bfcd8..d33751306 100644 --- a/apps/presentationeditor/mobile/app/controller/Settings.js +++ b/apps/presentationeditor/mobile/app/controller/Settings.js @@ -155,7 +155,6 @@ define([ var me = this; $('#settings-search').single('click', _.bind(me._onSearch, me)); $('#settings-readermode input:checkbox').single('change', _.bind(me._onReaderMode, me)); - $('#settings-edit-presentation').single('click', _.bind(me._onEditPresentation, me)); $(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me)); $('#page-settings-setup-view li').single('click', _.bind(me._onSlideSize, me)); @@ -224,10 +223,6 @@ define([ $('#settings-presentation-title').html(name ? name : '-'); }, - _onEditPresentation: function() { - Common.Gateway.requestEditRights(); - }, - _onSearch: function (e) { var toolbarView = PE.getController('Toolbar').getView('Toolbar'); diff --git a/apps/presentationeditor/mobile/app/template/Settings.template b/apps/presentationeditor/mobile/app/template/Settings.template index 9b427b810..147a0ea46 100644 --- a/apps/presentationeditor/mobile/app/template/Settings.template +++ b/apps/presentationeditor/mobile/app/template/Settings.template @@ -25,18 +25,6 @@
  • <% } %> -
  • - -
    -
    - -
    -
    -
    <%= scope.textEditPresent %>
    -
    -
    -
    -
  • diff --git a/apps/presentationeditor/mobile/app/view/Settings.js b/apps/presentationeditor/mobile/app/view/Settings.js index 42517c9cb..3133f3322 100644 --- a/apps/presentationeditor/mobile/app/view/Settings.js +++ b/apps/presentationeditor/mobile/app/view/Settings.js @@ -109,11 +109,9 @@ define([ isPhone = Common.SharedSettings.get('phone'); if (isEdit) { - $layour.find('#settings-edit-presentation').hide(); $layour.find('#settings-readermode').hide(); $layour.find('#settings-search .item-title').text(this.textFindAndReplace) } else { - if (!canEdit) $layour.find('#settings-edit-presentation').hide(); $layour.find('#settings-presentation-setup').hide(); $layour.find('#settings-readermode input:checkbox') .attr('checked', Common.SharedSettings.get('readerMode')) @@ -190,7 +188,6 @@ define([ permissions = _.extend(permissions, data.doc.permissions); if (permissions.edit === false) { - $('#settings-edit-presentation').hide(); } } }, diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 9249eb8b0..1d3f6b443 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -148,7 +148,6 @@ define([ onPageShow: function(view, pageId) { var me = this; $('#settings-search').single('click', _.bind(me._onSearch, me)); - $('#settings-edit-document').single('click', _.bind(me._onEditDocument, me)); $(modalView).find('.formats a').single('click', _.bind(me._onSaveFormat, me)); me.initSettings(pageId); }, @@ -200,10 +199,6 @@ define([ // API handlers - _onEditDocument: function() { - Common.Gateway.requestEditRights(); - }, - _onSearch: function (e) { var toolbarView = SSE.getController('Toolbar').getView('Toolbar'); diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index c69688d2a..997c1907a 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -25,18 +25,6 @@
  • <% } %> -
  • - -
    -
    - -
    -
    -
    <%= scope.textEditDoc %>
    -
    -
    -
    -
  • diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index 5aef88a08..714a2a978 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -114,10 +114,8 @@ define([ isPhone = Common.SharedSettings.get('phone'); if (isEdit) { - $layout.find('#settings-edit-document').hide(); $layout.find('#settings-search .item-title').text(this.textFindAndReplace) } else { - if (!canEdit) $layout.find('#settings-edit-document').hide(); } if (!canDownload) $layout.find('#settings-download').hide(); if (!canAbout) $layout.find('#settings-about').hide(); @@ -185,7 +183,6 @@ define([ permissions = _.extend(permissions, data.doc.permissions); if (permissions.edit === false) { - $('#settings-edit-document').hide(); } } }, From 9b8cc2bd29d70b8f3b079f301b407032e498233e Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 18 Apr 2018 15:21:46 +0300 Subject: [PATCH 3/4] [SSE] Enable signatures --- 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 1da261a88..95cc2d548 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -872,7 +872,6 @@ define([ this.appOptions.canChat = this.appOptions.canLicense && !this.appOptions.isOffline && !((typeof (this.editorConfig.customization) == 'object') && this.editorConfig.customization.chat===false); this.appOptions.canRename = !!this.permissions.rename; this.appOptions.trialMode = params.asc_getLicenseMode(); - this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport(); this.appOptions.canModifyFilter = (this.permissions.modifyFilter!==false); this.appOptions.canBranding = (licType === Asc.c_oLicenseResult.Success) && (typeof this.editorConfig.customization == 'object'); if (this.appOptions.canBranding) @@ -897,6 +896,7 @@ define([ (typeof (this.editorConfig.customization) == 'object' && !!this.editorConfig.customization.forcesave); this.appOptions.forcesave = this.appOptions.canForcesave; this.appOptions.canEditComments= this.appOptions.isOffline || !(typeof (this.editorConfig.customization) == 'object' && this.editorConfig.customization.commentAuthorOnly); + this.appOptions.canProtect = this.appOptions.isEdit && this.appOptions.isDesktopApp && this.appOptions.isOffline && this.api.asc_isSignaturesSupport() && !(this.appOptions.isEditDiagram || this.appOptions.isEditMailMerge); this.applyModeCommonElements(); this.applyModeEditorElements(); From e7cfb6909bfc332ae168ea933ec517884a6bfaeb Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 18 Apr 2018 15:30:09 +0300 Subject: [PATCH 4/4] [SSE] button "settings" stayed disabled for some actions --- apps/common/main/lib/view/Header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index 6ebc539ba..55742ce3e 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -674,7 +674,7 @@ define([ }; btn.setDisabled( true ); } else { - btn.setDisabled( btn.keepState.disabled ); + btn.setDisabled( btn.keepState && btn.keepState.disabled || lock); delete btn.keepState; } }