From 659e7cec506b46a2d4b04854cbad98ade6432db2 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Tue, 11 Oct 2022 22:12:02 +0300 Subject: [PATCH] [desktop] for bug 59316 --- apps/documenteditor/main/app/view/FileMenu.js | 2 +- apps/documenteditor/main/app/view/FileMenuPanels.js | 2 +- apps/presentationeditor/main/app/controller/LeftMenu.js | 1 + apps/presentationeditor/main/app/view/FileMenu.js | 7 +++++++ apps/presentationeditor/main/app/view/FileMenuPanels.js | 6 ++++-- apps/spreadsheeteditor/main/app/controller/LeftMenu.js | 1 + apps/spreadsheeteditor/main/app/view/FileMenu.js | 7 +++++++ apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 6 ++++-- 8 files changed, 26 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 8a92b0750..8bf3fdb57 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -67,7 +67,7 @@ define([ if (item) { var panel = this.panels[item.options.action]; if (item.options.action === 'help') { - if ( panel.usedHelpCenter === true && navigator.onLine ) { + if ( panel.noHelpContents === true && navigator.onLine ) { this.fireEvent('item:click', [this, 'external-help', true]); window.open(panel.urlHelpCenter, '_blank'); return; diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 9b52cf439..4a79cd855 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -2113,7 +2113,7 @@ define([ } else { if ( Common.Controllers.Desktop.isActive() ) { if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) { - me.usedHelpCenter = true; + me.noHelpContents = true; me.iFrame.src = '../../common/main/resources/help/download.html'; } else { store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index c41b6fed9..f3fad7e5b 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -271,6 +271,7 @@ define([ this.showHistory(); } break; + case 'external-help': close_menu = true; break; default: close_menu = false; } diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 867189ab9..eda4f9afa 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -69,6 +69,13 @@ define([ var item = _.findWhere(this.items, {el: event.currentTarget}); if (item) { var panel = this.panels[item.options.action]; + if (item.options.action === 'help') { + if ( panel.noHelpContents === true && navigator.onLine ) { + this.fireEvent('item:click', [this, 'external-help', true]); + window.open(panel.urlHelpCenter, '_blank'); + return; + } + } this.fireEvent('item:click', [this, item.options.action, !!panel]); if (panel) { diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 40098f3c7..1d4951096 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1505,6 +1505,7 @@ define([ this.menu = options.menu; this.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; this.openUrl = null; + this.urlHelpCenter = '{{HELP_CENTER_WEB_EDITORS}}'; this.en_data = [ {"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Presentation Editor user interface", "headername": "Program Interface"}, @@ -1610,9 +1611,10 @@ define([ store.fetch(config); } else { if ( Common.Controllers.Desktop.isActive() ) { - if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) + if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) { + me.noHelpContents = true; me.iFrame.src = '../../common/main/resources/help/download.html'; - else { + } else { store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + store.contentLang + '/'; store.url = me.urlPref + 'Contents.json'; diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index edbc33b2a..42b8be033 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -314,6 +314,7 @@ define([ this.showHistory(); } break; + case 'external-help': close_menu = true; break; default: close_menu = false; } diff --git a/apps/spreadsheeteditor/main/app/view/FileMenu.js b/apps/spreadsheeteditor/main/app/view/FileMenu.js index 0f682e816..c841f3721 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenu.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenu.js @@ -56,6 +56,13 @@ define([ var item = _.findWhere(this.items, {el: event.currentTarget}); if (item) { var panel = this.panels[item.options.action]; + if (item.options.action === 'help') { + if ( panel.noHelpContents === true && navigator.onLine ) { + this.fireEvent('item:click', [this, 'external-help', true]); + window.open(panel.urlHelpCenter, '_blank'); + return; + } + } this.fireEvent('item:click', [this, item.options.action, !!panel]); if (panel) { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index b2d7e5ffe..4634d3360 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1877,6 +1877,7 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ this.menu = options.menu; this.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; this.openUrl = null; + this.urlHelpCenter = '{{HELP_CENTER_WEB_EDITORS}}'; this.en_data = [ {"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Spreadsheet Editor user interface", "headername": "Program Interface"}, @@ -1984,9 +1985,10 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ store.fetch(config); } else { if ( Common.Controllers.Desktop.isActive() ) { - if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) + if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) { + me.noHelpContents = true; me.iFrame.src = '../../common/main/resources/help/download.html'; - else { + } else { store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + store.contentLang + '/'; store.url = me.urlPref + 'Contents.json';