[desktop] open help center if there are no app help

This commit is contained in:
Maxim Kadushkin 2022-09-23 11:12:34 +03:00
parent 26efff7397
commit 1a769c6b9a
4 changed files with 18 additions and 2 deletions

View file

@ -293,6 +293,9 @@ define([
}
})).show();
break;
case 'help':
close_menu = !!isopts;
break;
default: close_menu = false;
}

View file

@ -66,6 +66,14 @@ 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.usedHelpCenter === true && navigator.onLine ) {
this.fireEvent('item:click', [this, item.options.action, true]);
window.open(panel.urlHelpCenter, '_blank');
return;
}
}
this.fireEvent('item:click', [this, item.options.action, !!panel]);
if (panel) {

View file

@ -1989,6 +1989,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 Document Editor user interface", "headername": "Program Interface"},
@ -2111,9 +2112,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.usedHelpCenter = 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() + '/' + lang + '/';
store.url = me.urlPref + 'Contents.json';

View file

@ -67,6 +67,9 @@ module.exports = function(grunt) {
}, {
from: /\{\{HELP_URL\}\}/g,
to: _encode(process.env.HELP_URL) || 'https://helpcenter.onlyoffice.com'
}, {
from: /\{\{HELP_CENTER_WEB_EDITORS\}\}/g,
to: _encode(process.env.HELP_CENTER_WEB_EDITORS) || 'https://helpcenter.onlyoffice.com/userguides/docs-index.aspx'
}, {
from: /\{\{DEFAULT_LANG\}\}/g,
to: _encode(process.env.DEFAULT_LANG) || 'en'