[desktop] fix bug 59925
This commit is contained in:
parent
a350d98f8f
commit
2c15f82cb9
|
@ -238,42 +238,44 @@ define([
|
|||
}
|
||||
|
||||
const _checkHelpAvailable = function () {
|
||||
const curr_lang = Common.Locale.getCurrentLanguage();
|
||||
let url = 'resources/help/' + curr_lang;
|
||||
fetch(url + '/Contents.json').then(function (response) {
|
||||
if ( response.ok ) {
|
||||
/* local help avail */
|
||||
helpUrl = url;
|
||||
} else
|
||||
if ( curr_lang != Common.Locale.getDefaultLanguage() ) {
|
||||
url = 'resources/help/' + Common.Locale.getDefaultLanguage();
|
||||
fetch(url + '/Contents.json').then(function (response){
|
||||
if ( response.ok ) {
|
||||
/* local help avail. def lang */
|
||||
helpUrl = url;
|
||||
} else
|
||||
if ( this.helpUrl() ) {
|
||||
url = this.helpUrl() + curr_lang;
|
||||
fetch(url + '/Contents.json').then(function (response){
|
||||
const me = this;
|
||||
const build_url = function (arg1, arg2, arg3) {
|
||||
const re_ls = /\/$/;
|
||||
return (re_ls.test(arg1) ? arg1 : arg1 + '/') + arg2 + arg3;
|
||||
}
|
||||
|
||||
fetch(build_url('resources/help/', Common.Locale.getDefaultLanguage(), '/Contents.json'))
|
||||
.then(function (response) {
|
||||
if ( response.ok ) {
|
||||
/* local help avail */
|
||||
fetch(build_url('resources/help/', Common.Locale.getCurrentLanguage(), '/Contents.json'))
|
||||
.then(function (response){
|
||||
if ( response.ok )
|
||||
helpUrl = build_url('resources/help/', Common.Locale.getCurrentLanguage(), '');
|
||||
})
|
||||
.catch(function (e) {
|
||||
helpUrl = build_url('resources/help/', Common.Locale.getDefaultLanguage(), '');
|
||||
})
|
||||
}
|
||||
}).catch(function (e) {
|
||||
if ( me.helpUrl() ) {
|
||||
fetch(build_url(me.helpUrl(), Common.Locale.getDefaultLanguage(), '/Contents.json'))
|
||||
.then(function (response) {
|
||||
if ( response.ok ) {
|
||||
/* remote help avail */
|
||||
helpUrl = url;
|
||||
} else {
|
||||
url = this.helpUrl() + Common.getDefaultLanguage();
|
||||
fetch(url + '/Contents.json').then(function (response){
|
||||
if ( response.ok ) {
|
||||
/* remote help avail. def lang */
|
||||
helpUrl = url;
|
||||
} else {
|
||||
/* no help avail. open help center */
|
||||
}
|
||||
});
|
||||
fetch(build_url(me.helpUrl(), Common.Locale.getCurrentLanguage(), '/Contents.json'))
|
||||
.then(function (response) {
|
||||
if ( response.ok ) {
|
||||
helpUrl = build_url(me.helpUrl(), Common.Locale.getCurrentLanguage(), '');
|
||||
}
|
||||
})
|
||||
.catch(function (e) {
|
||||
helpUrl = build_url(me.helpUrl(), Common.Locale.getDefaultLanguage(), '');
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -281,6 +283,7 @@ define([
|
|||
_.extend(config, opts);
|
||||
|
||||
if ( config.isDesktopApp ) {
|
||||
const me = this;
|
||||
let is_win_xp = nativevars && nativevars.os === 'winxp';
|
||||
|
||||
Common.UI.Themes.setAvailable(!is_win_xp);
|
||||
|
@ -322,7 +325,7 @@ define([
|
|||
}).show();
|
||||
}
|
||||
|
||||
_checkHelpAvailable();
|
||||
_checkHelpAvailable.call(me);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -2028,20 +2028,8 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
|
|||
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 () {
|
||||
|
@ -2055,9 +2043,21 @@ SSE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
|
|||
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 + '/';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -472,6 +472,7 @@ define([
|
|||
window.open(_url_obj.toString(), '_blank');
|
||||
}
|
||||
|
||||
me.helpUrl = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -489,10 +490,7 @@ define([
|
|||
me.helpUrl = url;
|
||||
me.showHelp();
|
||||
} else {
|
||||
// me.helpUrl = null;
|
||||
if ( Common.Controllers.Desktop.isActive() ) {
|
||||
url = 'resources/help/' + lang + name;
|
||||
}
|
||||
me.helpUrl = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue