2019-05-02 15:45:10 -06:00
|
|
|
import setupListeners from './js/setupListeners';
|
2019-05-03 10:34:11 -06:00
|
|
|
import { renderAll } from './js/render';
|
2019-05-23 15:26:13 -06:00
|
|
|
import { hasToken } from './js/utilities';
|
2019-05-08 15:23:46 -06:00
|
|
|
import { loadDictionary } from './js/dictionaryManagement';
|
2019-05-09 14:24:47 -06:00
|
|
|
import { loadSettings } from './js/settings';
|
2019-06-04 11:11:58 -06:00
|
|
|
import { setupAds } from './js/ads';
|
2019-05-02 15:45:10 -06:00
|
|
|
|
2019-05-02 10:57:56 -06:00
|
|
|
function initialize() {
|
2019-05-23 15:26:13 -06:00
|
|
|
loadDictionary();
|
|
|
|
loadSettings();
|
|
|
|
setupListeners();
|
|
|
|
|
2019-05-21 16:29:05 -06:00
|
|
|
if (hasToken()) {
|
|
|
|
import('./js/account/index.js').then(account => {
|
|
|
|
account.loginWithToken();
|
|
|
|
});
|
|
|
|
}
|
2019-06-04 11:11:58 -06:00
|
|
|
|
|
|
|
setupAds().then(() => renderAll());
|
2019-05-02 10:57:56 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
window.onload = (function (oldLoad) {
|
|
|
|
return function () {
|
|
|
|
oldLoad && oldLoad();
|
|
|
|
initialize();
|
|
|
|
}
|
|
|
|
})(window.onload);
|