diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index f6b100557..2ce4257c9 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -207,6 +207,14 @@ define([ case '2': this.api.SetFontRenderingMode(2); break; } + if ( !Common.Utils.isIE ) { + if ( /^https?:\/\//.test('{{HELP_CENTER_WEB_DE}}') ) { + const _url_obj = new URL('{{HELP_CENTER_WEB_DE}}'); + _url_obj.searchParams.set('lang', Common.Locale.getCurrentLanguage()); + Common.Utils.InternalSettings.set("url-help-center", _url_obj.toString()); + } + } + this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); this.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(this.onDocumentContentReady, this)); this.api.asc_registerCallback('asc_onOpenDocumentProgress', _.bind(this.onOpenDocument, this)); diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 3748d4a7c..34c8bcf90 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -69,7 +69,8 @@ define([ if (item.options.action === 'help') { if ( panel.noHelpContents === true && navigator.onLine ) { this.fireEvent('item:click', [this, 'external-help', true]); - !!panel.urlHelpCenter && window.open(panel.urlHelpCenter, '_blank'); + const helpCenter = Common.Utils.InternalSettings.get('url-help-center'); + !!helpCenter && window.open(helpCenter, '_blank'); return; } } diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index 45b458d75..a506fe5bb 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -2041,14 +2041,6 @@ define([ this.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; this.openUrl = null; - if ( !Common.Utils.isIE ) { - if ( /^https?:\/\//.test('{{HELP_CENTER_WEB_DE}}') ) { - const _url_obj = new URL('{{HELP_CENTER_WEB_DE}}'); - _url_obj.searchParams.set('lang', Common.Locale.getCurrentLanguage()); - this.urlHelpCenter = _url_obj.toString(); - } - } - this.en_data = [ {"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Document Editor user interface", "headername": "Program Interface"}, {"src": "ProgramInterface/FileTab.htm", "name": "File tab"}, @@ -2169,20 +2161,8 @@ define([ store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json'; store.fetch(config); } else { - if ( Common.Controllers.Desktop.isActive() ) { - if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) { - me.noHelpContents = true; - me.iFrame.src = '../../common/main/resources/help/download.html'; - } else { - store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; - me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + store.contentLang + '/'; - store.url = me.urlPref + 'Contents.json'; - store.fetch(config); - } - } else { - me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; - store.reset(me.en_data); - } + me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; + store.reset(me.en_data); } }, success: function () { @@ -2196,9 +2176,21 @@ define([ me.onSelectItem(me.openUrl ? me.openUrl : rec.get('src')); } }; - store.url = 'resources/help/' + lang + '/Contents.json'; - store.fetch(config); - this.urlPref = 'resources/help/' + lang + '/'; + + if ( Common.Controllers.Desktop.isActive() ) { + if ( !Common.Controllers.Desktop.isHelpAvailable() ) { + me.noHelpContents = true; + me.iFrame.src = '../../common/main/resources/help/download.html'; + } else { + me.urlPref = Common.Controllers.Desktop.helpUrl() + '/'; + store.url = me.urlPref + 'Contents.json'; + store.fetch(config); + } + } else { + store.url = 'resources/help/' + lang + '/Contents.json'; + store.fetch(config); + this.urlPref = 'resources/help/' + lang + '/'; + } } }, diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 3b34cf287..087535355 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -182,6 +182,14 @@ define([ Common.Utils.InternalSettings.set("pe-settings-fontrender", value); this.api.SetFontRenderingMode(parseInt(value)); + if ( !Common.Utils.isIE ) { + if ( /^https?:\/\//.test('{{HELP_CENTER_WEB_PE}}') ) { + const _url_obj = new URL('{{HELP_CENTER_WEB_PE}}'); + _url_obj.searchParams.set('lang', Common.Locale.getCurrentLanguage()); + Common.Utils.InternalSettings.set("url-help-center", _url_obj.toString()); + } + } + this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this)); this.api.asc_registerCallback('asc_onDocumentContentReady', _.bind(this.onDocumentContentReady, this)); this.api.asc_registerCallback('asc_onOpenDocumentProgress', _.bind(this.onOpenDocument, this)); diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index 134a7625c..1b2d588d7 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -72,7 +72,8 @@ define([ if (item.options.action === 'help') { if ( panel.noHelpContents === true && navigator.onLine ) { this.fireEvent('item:click', [this, 'external-help', true]); - !!panel.urlHelpCenter && window.open(panel.urlHelpCenter, '_blank'); + const helpCenter = Common.Utils.InternalSettings.get('url-help-center'); + !!helpCenter && window.open(helpCenter, '_blank'); return; } } diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 13301004e..5db0ee3ce 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -1535,14 +1535,6 @@ define([ this.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; this.openUrl = null; - if ( !Common.Utils.isIE ) { - if ( /^https?:\/\//.test('{{HELP_CENTER_WEB_PE}}') ) { - const _url_obj = new URL('{{HELP_CENTER_WEB_PE}}'); - _url_obj.searchParams.set('lang', Common.Locale.getCurrentLanguage()); - this.urlHelpCenter = _url_obj.toString(); - } - } - this.en_data = [ {"src": "ProgramInterface/ProgramInterface.htm", "name": "Introducing Presentation Editor user interface", "headername": "Program Interface"}, {"src": "ProgramInterface/FileTab.htm", "name": "File tab"}, @@ -1646,20 +1638,8 @@ define([ store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json'; store.fetch(config); } else { - if ( Common.Controllers.Desktop.isActive() ) { - if ( store.contentLang === '{{DEFAULT_LANG}}' || !Common.Controllers.Desktop.helpUrl() ) { - me.noHelpContents = true; - me.iFrame.src = '../../common/main/resources/help/download.html'; - } else { - store.contentLang = store.contentLang === lang ? '{{DEFAULT_LANG}}' : lang; - me.urlPref = Common.Controllers.Desktop.helpUrl() + '/' + store.contentLang + '/'; - store.url = me.urlPref + 'Contents.json'; - store.fetch(config); - } - } else { - me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; - store.reset(me.en_data); - } + me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; + store.reset(me.en_data); } }, success: function () { @@ -1673,9 +1653,21 @@ define([ me.onSelectItem(me.openUrl ? me.openUrl : rec.get('src')); } }; - store.url = 'resources/help/' + lang + '/Contents.json'; - store.fetch(config); - this.urlPref = 'resources/help/' + lang + '/'; + + if ( Common.Controllers.Desktop.isActive() ) { + if ( !Common.Controllers.Desktop.isHelpAvailable() ) { + me.noHelpContents = true; + me.iFrame.src = '../../common/main/resources/help/download.html'; + } else { + me.urlPref = Common.Controllers.Desktop.helpUrl() + '/'; + store.url = me.urlPref + 'Contents.json'; + store.fetch(config); + } + } else { + store.url = 'resources/help/' + lang + '/Contents.json'; + store.fetch(config); + this.urlPref = 'resources/help/' + lang + '/'; + } } },