From e7c17af42942e25d65d535b76561dbe48439c6d0 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Mon, 28 Oct 2019 17:23:53 +0300 Subject: [PATCH 1/7] Disable "save copy as" for desktop with blockchain (#256) --- apps/documenteditor/main/app/view/FileMenu.js | 3 ++- apps/presentationeditor/main/app/view/FileMenu.js | 3 ++- apps/spreadsheeteditor/main/app/view/FileMenu.js | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index bbf120cf35..c6b4bd8de0 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -251,7 +251,8 @@ define([ applyMode: function() { this.miDownload[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); - this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); + var isBCSupport = window["AscDesktopEditor"] ? window["AscDesktopEditor"]["isBlockchainSupport"]() : false; + this.miSaveCopyAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide'](); this.miSaveAs[((this.mode.canDownload || this.mode.canDownloadOrigin) && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); this.miSave[this.mode.isEdit?'show':'hide'](); this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index f76d343281..e1ad48940a 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -246,7 +246,8 @@ define([ applyMode: function() { this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); - this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); + var isBCSupport = window["AscDesktopEditor"] ? window["AscDesktopEditor"]["isBlockchainSupport"]() : false; + this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide'](); this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); this.miSave[this.mode.isEdit?'show':'hide'](); this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 1666b2ab48..3c88f6b9e7 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -235,7 +235,8 @@ define([ applyMode: function() { this.miDownload[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline))?'show':'hide'](); - this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) ?'show':'hide'](); + var isBCSupport = window["AscDesktopEditor"] ? window["AscDesktopEditor"]["isBlockchainSupport"]() : false; + this.miSaveCopyAs[(this.mode.canDownload && (!this.mode.isDesktopApp || !this.mode.isOffline)) && (this.mode.canRequestSaveAs || this.mode.saveAsUrl) && !isBCSupport ?'show':'hide'](); this.miSaveAs[(this.mode.canDownload && this.mode.isDesktopApp && this.mode.isOffline)?'show':'hide'](); this.miSave[this.mode.isEdit?'show':'hide'](); this.miEdit[!this.mode.isEdit && this.mode.canEdit && this.mode.canRequestEditRights ?'show':'hide'](); From e208538f42c9018c6a1f72cb20d21effb7013629 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 29 Oct 2019 11:19:06 +0300 Subject: [PATCH 2/7] Fix Bug 43314 (#257) --- 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 821dfc3a4f..68c75ab282 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -873,7 +873,7 @@ define([ } }); } - } else if (!this.appOptions.isDesktopApp && !this.appOptions.canBrandingExt && + } else if (!this.appOptions.isDesktopApp && !this.appOptions.isEditDiagram && !this.appOptions.isEditMailMerge && !this.appOptions.canBrandingExt && this.editorConfig && this.editorConfig.customization && (this.editorConfig.customization.loaderName || this.editorConfig.customization.loaderLogo)) { Common.UI.warning({ title: this.textPaidFeature, From fdb4df366dc2c4339cce10a3131a974de313abbe Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 29 Oct 2019 15:32:13 +0300 Subject: [PATCH 3/7] Fix Bug 43332 (#258) --- apps/common/main/lib/extend/Bootstrap.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/common/main/lib/extend/Bootstrap.js b/apps/common/main/lib/extend/Bootstrap.js index b7d4a582f9..599f129e72 100755 --- a/apps/common/main/lib/extend/Bootstrap.js +++ b/apps/common/main/lib/extend/Bootstrap.js @@ -205,10 +205,15 @@ function clearMenus(isFromInputControl) { }) } +function toggle() { + $('.dropdown-backdrop').remove(); +} + $(document) .off('keydown.bs.dropdown.data-api') .on('keydown.bs.dropdown.data-api', '[data-toggle=dropdown], [role=menu]' , onDropDownKeyDown); +('ontouchstart' in document.documentElement) && $(document).on('click.bs.dropdown.data-api', '[data-toggle=dropdown]', toggle); /* * workaround closing menu by right click * */ From 4196914962f2b79501e856ac8712b050b17f4576 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 30 Oct 2019 14:48:09 +0300 Subject: [PATCH 4/7] [DE][SSE] Send "embedded" parameter to sdk (#259) --- apps/documenteditor/embed/js/ApplicationController.js | 3 ++- apps/spreadsheeteditor/embed/js/ApplicationController.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 07d2debb19..91184b0801 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -513,7 +513,8 @@ DE.ApplicationController = new(function(){ window["flat_desine"] = true; api = new Asc.asc_docs_api({ - 'id-view' : 'editor_sdk' + 'id-view' : 'editor_sdk', + 'embedded' : true }); if (api){ diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index 9dafa9ae0a..f446c6a07c 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -532,7 +532,8 @@ SSE.ApplicationController = new(function(){ }); api = new Asc.spreadsheet_api({ - 'id-view': 'editor_sdk' + 'id-view': 'editor_sdk', + 'embedded' : true }); if (api){ From 3308662a1d4debec207983cdd48baa485d011602 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 6 Nov 2019 11:07:56 +0300 Subject: [PATCH 5/7] [DE] Fix Bug 43460 (#261) --- apps/common/main/lib/controller/History.js | 3 +++ apps/documenteditor/main/app/controller/Main.js | 2 ++ 2 files changed, 5 insertions(+) diff --git a/apps/common/main/lib/controller/History.js b/apps/common/main/lib/controller/History.js index 056183ee32..a3d1f9445f 100644 --- a/apps/common/main/lib/controller/History.js +++ b/apps/common/main/lib/controller/History.js @@ -81,6 +81,7 @@ define([ }, setMode: function(mode) { + this.mode = mode; if (!mode.canHistoryClose) { this.panelHistory.$el.find('#history-header').hide(); this.panelHistory.$el.find('#history-list').css('padding-top', 0); @@ -163,6 +164,8 @@ define([ }, onSetHistoryData: function(opts) { + if (!this.mode.canUseHistory) return; + if (opts.data.error) { var config = { title: this.notcriticalErrorTitle, diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index c4ddc90925..2e073f65c1 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -487,6 +487,8 @@ define([ }, onRefreshHistory: function(opts) { + if (!this.appOptions.canUseHistory) return; + this.loadMask && this.loadMask.hide(); if (opts.data.error || !opts.data.history) { var historyStore = this.getApplication().getCollection('Common.Collections.HistoryVersions'); From 933a0d001bb58c33276fc4b1836b1b39131cc8f2 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 8 Nov 2019 13:53:10 +0300 Subject: [PATCH 6/7] Update translation (#262) --- apps/documenteditor/main/app/controller/LeftMenu.js | 2 +- apps/documenteditor/main/locale/en.json | 2 +- apps/documenteditor/main/locale/it.json | 2 +- apps/documenteditor/main/locale/lv.json | 2 +- apps/documenteditor/main/locale/sl.json | 2 +- apps/documenteditor/main/locale/tr.json | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index fd86037ef7..3ae6efafcc 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -875,7 +875,7 @@ define([ requestEditRightsText : 'Requesting editing rights...', textReplaceSuccess : 'Search has been done. {0} occurrences have been replaced', textReplaceSkipped : 'The replacement has been made. {0} occurrences were skipped.', - textLoadHistory : 'Loading versions history...', + textLoadHistory : 'Loading version history...', notcriticalErrorTitle: 'Warning', leavePageText: 'All unsaved changes in this document will be lost.
Click \'Cancel\' then \'Save\' to save them. Click \'OK\' to discard all the unsaved changes.', warnDownloadAs : 'If you continue saving in this format all features except the text will be lost.
Are you sure you want to continue?', diff --git a/apps/documenteditor/main/locale/en.json b/apps/documenteditor/main/locale/en.json index fe28eb861d..dbbb912124 100644 --- a/apps/documenteditor/main/locale/en.json +++ b/apps/documenteditor/main/locale/en.json @@ -322,7 +322,7 @@ "DE.Controllers.LeftMenu.newDocumentTitle": "Unnamed document", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "DE.Controllers.LeftMenu.requestEditRightsText": "Requesting editing rights...", - "DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...", + "DE.Controllers.LeftMenu.textLoadHistory": "Loading version history...", "DE.Controllers.LeftMenu.textNoTextFound": "The data you have been searching for could not be found. Please adjust your search options.", "DE.Controllers.LeftMenu.textReplaceSkipped": "The replacement has been made. {0} occurrences were skipped.", "DE.Controllers.LeftMenu.textReplaceSuccess": "The search has been done. Occurrences replaced: {0}", diff --git a/apps/documenteditor/main/locale/it.json b/apps/documenteditor/main/locale/it.json index adba75904d..cb3314de04 100644 --- a/apps/documenteditor/main/locale/it.json +++ b/apps/documenteditor/main/locale/it.json @@ -322,7 +322,7 @@ "DE.Controllers.LeftMenu.newDocumentTitle": "Documento senza nome", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Avviso", "DE.Controllers.LeftMenu.requestEditRightsText": "Richiesta di autorizzazione di modifica...", - "DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...", + "DE.Controllers.LeftMenu.textLoadHistory": "Loading version history...", "DE.Controllers.LeftMenu.textNoTextFound": "I dati da cercare non sono stati trovati. Modifica i parametri di ricerca.", "DE.Controllers.LeftMenu.textReplaceSkipped": "La sostituzione è stata effettuata. {0} occorrenze sono state saltate.", "DE.Controllers.LeftMenu.textReplaceSuccess": "La ricerca è stata effettuata. Occorrenze sostituite: {0}", diff --git a/apps/documenteditor/main/locale/lv.json b/apps/documenteditor/main/locale/lv.json index 7eaa4c94c5..c6ecf6d330 100644 --- a/apps/documenteditor/main/locale/lv.json +++ b/apps/documenteditor/main/locale/lv.json @@ -296,7 +296,7 @@ "DE.Controllers.LeftMenu.newDocumentTitle": "Dokuments bez nosaukuma", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "DE.Controllers.LeftMenu.requestEditRightsText": "Pieprasa rediģēšanas tiesības...", - "DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...", + "DE.Controllers.LeftMenu.textLoadHistory": "Loading version history...", "DE.Controllers.LeftMenu.textNoTextFound": "Text not found", "DE.Controllers.LeftMenu.textReplaceSkipped": "Replace was done. Some occurrences was skipped.", "DE.Controllers.LeftMenu.textReplaceSuccess": "All occurrences was replaced", diff --git a/apps/documenteditor/main/locale/sl.json b/apps/documenteditor/main/locale/sl.json index 2a214f3899..2b22165489 100644 --- a/apps/documenteditor/main/locale/sl.json +++ b/apps/documenteditor/main/locale/sl.json @@ -163,7 +163,7 @@ "DE.Controllers.LeftMenu.newDocumentTitle": "Neimenovan dokument", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "DE.Controllers.LeftMenu.requestEditRightsText": "Zahtevanje urejevalnih pravic...", - "DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...", + "DE.Controllers.LeftMenu.textLoadHistory": "Loading version history...", "DE.Controllers.LeftMenu.textNoTextFound": "Podatkov, katere iščete, ni bilo mogoče najti. Prosim nastavite svoje možnosti iskanja.", "DE.Controllers.LeftMenu.textReplaceSkipped": "Nadomestek je bil izdelan. {0} dogodki so bili preskočeni.", "DE.Controllers.LeftMenu.textReplaceSuccess": "Iskanje je bilo storjeno. Dogodki nadomeščeni: {0}", diff --git a/apps/documenteditor/main/locale/tr.json b/apps/documenteditor/main/locale/tr.json index 9c2b4754df..69969fbf44 100644 --- a/apps/documenteditor/main/locale/tr.json +++ b/apps/documenteditor/main/locale/tr.json @@ -252,7 +252,7 @@ "DE.Controllers.LeftMenu.newDocumentTitle": "İsimlendirilmemiş döküman", "DE.Controllers.LeftMenu.notcriticalErrorTitle": "Warning", "DE.Controllers.LeftMenu.requestEditRightsText": "Düzenleme hakları isteniyor...", - "DE.Controllers.LeftMenu.textLoadHistory": "Loading versions history...", + "DE.Controllers.LeftMenu.textLoadHistory": "Loading version history...", "DE.Controllers.LeftMenu.textNoTextFound": "Aradığınız veri bulunamadı. Lütfen arama seçeneklerinizi ayarlayınız.", "DE.Controllers.LeftMenu.textReplaceSkipped": "Değiştirme yapıldı. {0} olay atlandı.", "DE.Controllers.LeftMenu.textReplaceSuccess": "Arama yapıldı. {0} olay değiştirildi.", From a6d4dc6ff7b3c601a8bb4cff5b289e2cc6b357ac Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 12 Nov 2019 11:05:59 +0300 Subject: [PATCH 7/7] [Embedded] Fix hiding download button and settings menu. (#263) --- apps/documenteditor/embed/js/ApplicationController.js | 8 ++++++-- apps/presentationeditor/embed/js/ApplicationController.js | 8 ++++++-- apps/spreadsheeteditor/embed/js/ApplicationController.js | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index 91184b0801..20a3ea7d02 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -115,8 +115,6 @@ DE.ApplicationController = new(function(){ } embedConfig.docTitle = docConfig.title; - if ( !embedConfig.saveUrl && permissions.print === false) - $('#idt-copy').hide(); } } @@ -221,6 +219,9 @@ DE.ApplicationController = new(function(){ var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -2); (zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100)); + if ( !embedConfig.saveUrl && permissions.print === false) + $('#idt-download').hide(); + if ( !embedConfig.shareUrl ) $('#idt-share').hide(); @@ -230,6 +231,9 @@ DE.ApplicationController = new(function(){ if ( !embedConfig.fullscreenUrl ) $('#idt-fullscreen').hide(); + if ( !embedConfig.saveUrl && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl) + $('#box-tools').addClass('hidden'); + common.controller.modals.attach({ share: '#idt-share', embed: '#idt-embed' diff --git a/apps/presentationeditor/embed/js/ApplicationController.js b/apps/presentationeditor/embed/js/ApplicationController.js index a425b38405..440ef0d56d 100644 --- a/apps/presentationeditor/embed/js/ApplicationController.js +++ b/apps/presentationeditor/embed/js/ApplicationController.js @@ -111,8 +111,6 @@ PE.ApplicationController = new(function(){ } embedConfig.docTitle = docConfig.title; - if (!embedConfig.saveUrl && permissions.print === false) - $('#idt-copy').hide(); } } @@ -225,6 +223,9 @@ PE.ApplicationController = new(function(){ var zf = (config.customization && config.customization.zoom ? parseInt(config.customization.zoom) : -1); (zf == -1) ? api.zoomFitToPage() : ((zf == -2) ? api.zoomFitToWidth() : api.zoom(zf>0 ? zf : 100)); + if (!embedConfig.saveUrl && permissions.print === false) + $('#idt-download').hide(); + if ( !embedConfig.shareUrl ) $('#idt-share').hide(); @@ -234,6 +235,9 @@ PE.ApplicationController = new(function(){ if ( !embedConfig.fullscreenUrl ) $('#idt-fullscreen').hide(); + if ( !embedConfig.saveUrl && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl) + $('#box-tools').addClass('hidden'); + common.controller.modals.attach({ share: '#idt-share', embed: '#idt-embed' diff --git a/apps/spreadsheeteditor/embed/js/ApplicationController.js b/apps/spreadsheeteditor/embed/js/ApplicationController.js index f446c6a07c..7eeb18036c 100644 --- a/apps/spreadsheeteditor/embed/js/ApplicationController.js +++ b/apps/spreadsheeteditor/embed/js/ApplicationController.js @@ -109,8 +109,6 @@ SSE.ApplicationController = new(function(){ } embedConfig.docTitle = docConfig.title; - if ( !embedConfig.saveUrl && permissions.print === false) - $('#idt-copy').hide(); } } @@ -170,6 +168,9 @@ SSE.ApplicationController = new(function(){ function onDocumentContentReady() { hidePreloader(); + if ( !embedConfig.saveUrl && permissions.print === false) + $('#idt-download').hide(); + if ( !embedConfig.shareUrl ) $('#idt-share').hide(); @@ -179,6 +180,9 @@ SSE.ApplicationController = new(function(){ if ( !embedConfig.fullscreenUrl ) $('#idt-fullscreen').hide(); + if ( !embedConfig.saveUrl && permissions.print === false && !embedConfig.shareUrl && !embedConfig.embedUrl && !embedConfig.fullscreenUrl) + $('#box-tools').addClass('hidden'); + common.controller.modals.attach({ share: '#idt-share', embed: '#idt-embed'