[desktop] support for external help in SSE and PE

This commit is contained in:
Maxim Kadushkin 2022-06-09 10:39:27 +03:00
parent 42e2ae9277
commit 654f14192f
3 changed files with 33 additions and 5 deletions

View file

@ -346,7 +346,13 @@ define([
} }
}, },
helpUrl: function () { 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;
} }
}; };
}; };

View file

@ -1597,10 +1597,21 @@ define([
me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; me.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json'; store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json';
store.fetch(config); store.fetch(config);
} else {
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 { } else {
me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; me.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
store.reset(me.en_data); store.reset(me.en_data);
} }
}
}, },
success: function () { success: function () {
var rec = me.openUrl ? store.find(function(record){ var rec = me.openUrl ? store.find(function(record){

View file

@ -1952,10 +1952,21 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; me.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json'; store.url = 'resources/help/{{DEFAULT_LANG}}/Contents.json';
store.fetch(config); store.fetch(config);
} else {
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 { } else {
me.urlPref = 'resources/help/{{DEFAULT_LANG}}/'; me.urlPref = 'resources/help/{{DEFAULT_LANG}}/';
store.reset(me.en_data); store.reset(me.en_data);
} }
}
}, },
success: function () { success: function () {
var rec = me.openUrl ? store.find(function(record){ var rec = me.openUrl ? store.find(function(record){