Fix loading 'freeipa/text' at production mode

As for now 'ssbrowser.html' and 'unauthorized.html' pages are
loaded without JS error at development mode only.

There is no standalone 'freeipa/text' module as source at
production mode. Thus 'core' one have to be loaded first and
then 'text'.

Reviewed-By: Serhii Tsymbaliuk <stsymbal@redhat.com>
This commit is contained in:
Stanislav Levin 2018-09-24 20:52:37 +03:00 committed by Serhii Tsymbaliuk
parent 4460cc5e9f
commit f658a3d107
2 changed files with 22 additions and 8 deletions

View File

@ -25,20 +25,26 @@
]
};
(function() {
var icons = [
'../ui/favicon.ico',
];
var styles = [
'../ui/css/patternfly.css',
'../ui/css/ipa.css'
];
var scripts = [
'../ui/js/libs/jquery.js',
'../ui/js/dojo/dojo.js'
'../ui/js/libs/jquery.ordered-map.js',
'../ui/js/dojo/dojo.js',
];
ipa_loader.scripts(scripts, function() {
require([
'dojo/dom',
'freeipa/text',
'dojo/domReady!'],
function(dom, text) {
'freeipa/core',
'dojo/domReady!',
],
function(dom) {
var text = require('freeipa/text');
msg = "".concat(
text.get('@i18n:ssbrowser-page.header'),
text.get('@i18n:ssbrowser-page.firefox-header'),
@ -53,6 +59,7 @@
});
});
ipa_loader.styles(styles);
ipa_loader.icons(icons);
})();
</script>

View File

@ -25,27 +25,34 @@
]
};
(function() {
var icons = [
'../ui/favicon.ico',
];
var styles = [
'../ui/css/patternfly.css',
'../ui/css/ipa.css'
];
var scripts = [
'../ui/js/libs/jquery.js',
'../ui/js/dojo/dojo.js'
'../ui/js/libs/jquery.ordered-map.js',
'../ui/js/dojo/dojo.js',
];
ipa_loader.scripts(scripts, function() {
require([
'dojo/dom',
'freeipa/text',
'dojo/domReady!'],
function(dom, text) {
'freeipa/core',
'dojo/domReady!',
],
function(dom) {
var text = require('freeipa/text');
if (msg = text.get('@i18n:unauthorized-page')) {
dom.byId('unauthorized-msg').innerHTML=msg;
}
});
});
ipa_loader.styles(styles);
ipa_loader.icons(icons);
})();
</script>
</head>