2016-09-24 14:32:31 +00:00
|
|
|
|
2017-11-29 10:01:48 +00:00
|
|
|
var assetsPath;
|
2016-11-14 09:47:39 +00:00
|
|
|
|
|
|
|
if (_DEV_MODE)
|
2017-11-29 10:01:48 +00:00
|
|
|
{
|
|
|
|
var host = window.location.host.split(':')[0];
|
|
|
|
assetsPath = 'http://'+ host +':'+ _DEV_SERVER_PORT +'/'+ _PUBLIC_PATH;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
assetsPath = _PUBLIC_PATH;
|
2016-11-14 09:47:39 +00:00
|
|
|
|
2017-11-29 10:01:48 +00:00
|
|
|
__webpack_public_path__ = assetsPath;
|
2016-11-14 09:47:39 +00:00
|
|
|
|
2016-10-30 22:48:18 +00:00
|
|
|
require ('hedera/hedera');
|
2016-09-24 14:32:31 +00:00
|
|
|
|
2016-09-27 06:18:20 +00:00
|
|
|
window.onload = function ()
|
2016-09-26 09:28:47 +00:00
|
|
|
{
|
2017-11-29 10:01:48 +00:00
|
|
|
loadLocale (main);
|
2016-09-27 06:18:20 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function main (req)
|
|
|
|
{
|
2018-01-03 15:35:03 +00:00
|
|
|
if (req)
|
|
|
|
onLocaleLoad (req);
|
2016-09-27 06:18:20 +00:00
|
|
|
|
2016-09-26 09:28:47 +00:00
|
|
|
hederaWeb = new Hedera.App ();
|
|
|
|
hederaWeb.run ();
|
|
|
|
}
|
2016-09-24 14:32:31 +00:00
|
|
|
|
2017-11-29 10:01:48 +00:00
|
|
|
function loadLocale (cb)
|
2016-09-27 06:18:20 +00:00
|
|
|
{
|
2017-11-29 10:01:48 +00:00
|
|
|
Vn.Locale.init ();
|
|
|
|
var lang = Vn.Locale.language;
|
|
|
|
|
2018-02-05 12:58:17 +00:00
|
|
|
var req = require.context ('js', true, /locale\/en.yml$/);
|
2018-01-03 15:35:03 +00:00
|
|
|
onLocaleLoad (req);
|
|
|
|
|
2016-09-27 06:18:20 +00:00
|
|
|
switch (lang)
|
|
|
|
{
|
|
|
|
case 'ca':
|
2016-10-04 15:27:49 +00:00
|
|
|
require ([], function () {
|
2018-02-05 12:58:17 +00:00
|
|
|
cb (require.context ('js', true, /locale\/ca.yml$/)); });
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'es':
|
2016-09-27 19:31:46 +00:00
|
|
|
require ([], function () {
|
2018-02-05 12:58:17 +00:00
|
|
|
cb (require.context ('js', true, /locale\/es.yml$/)); });
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'fr':
|
2016-09-27 12:47:19 +00:00
|
|
|
require ([], function () {
|
2018-02-05 12:58:17 +00:00
|
|
|
cb (require.context ('js', true, /locale\/fr.yml$/)); });
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'mn':
|
2016-09-27 12:47:19 +00:00
|
|
|
require ([], function () {
|
2018-02-05 12:58:17 +00:00
|
|
|
cb (require.context ('js', true, /locale\/mn.yml$/)); });
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
case 'pt':
|
2016-09-27 12:47:19 +00:00
|
|
|
require ([], function () {
|
2018-02-05 12:58:17 +00:00
|
|
|
cb (require.context ('js', true, /locale\/pt.yml$/)); });
|
2016-09-27 06:18:20 +00:00
|
|
|
break;
|
|
|
|
default:
|
2018-01-03 15:35:03 +00:00
|
|
|
cb ();
|
2016-09-27 06:18:20 +00:00
|
|
|
}
|
|
|
|
}
|
2018-01-03 15:35:03 +00:00
|
|
|
|
|
|
|
function onLocaleLoad (req)
|
|
|
|
{
|
|
|
|
var keys = req.keys ();
|
|
|
|
|
|
|
|
for (var i = 0; i < keys.length; i++)
|
|
|
|
Vn.Locale.add (req (keys[i]));
|
|
|
|
}
|