[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 () {
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

@ -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 () {

View file

@ -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 () {