From 654f14192f2de1f4537f418d6ae43104eb5deb1a Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Thu, 9 Jun 2022 10:39:27 +0300 Subject: [PATCH] [desktop] support for external help in SSE and PE --- apps/common/main/lib/controller/Desktop.js | 8 +++++++- .../main/app/view/FileMenuPanels.js | 15 +++++++++++++-- .../main/app/view/FileMenuPanels.js | 15 +++++++++++++-- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/apps/common/main/lib/controller/Desktop.js b/apps/common/main/lib/controller/Desktop.js index 1d7fdfd37..40644ce7d 100644 --- a/apps/common/main/lib/controller/Desktop.js +++ b/apps/common/main/lib/controller/Desktop.js @@ -346,7 +346,13 @@ define([ } }, helpUrl: function () { - return 'https://download.onlyoffice.com/install/desktop/editors/help/v7.2.0-1/apps/documenteditor/main/resources/help'; + if ( !!nativevars && nativevars.helpUrl ) { + var webapp = window.SSE ? 'spreadsheeteditor' : + window.PE ? 'presentationeditor' : 'documenteditor'; + return nativevars.helpUrl + webapp + '/main/resources/help'; + } + + return undefined; } }; }; diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 770749a44..a7760095a 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1598,8 +1598,19 @@ define([ store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json'; store.fetch(config); } else { - me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; - store.reset(me.en_data); + if ( Common.Controllers.Desktop.isActive() ) { + if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) + me.iFrame.src = '../../common/main/resources/help/download.html'; + else { + store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; + me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + lang + '/'; + store.url = me.urlPref + '/Contents.json'; + store.fetch(config); + } + } else { + me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; + store.reset(me.en_data); + } } }, success: function () { diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index aae5722aa..e36fb6a14 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -1953,8 +1953,19 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json'; store.fetch(config); } else { - me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; - store.reset(me.en_data); + if ( Common.Controllers.Desktop.isActive() ) { + if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) + me.iFrame.src = '../../common/main/resources/help/download.html'; + else { + store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; + me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + lang + '/'; + store.url = me.urlPref + '/Contents.json'; + store.fetch(config); + } + } else { + me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; + store.reset(me.en_data); + } } }, success: function () {