Share Gaia assets and adapters, keep private profiles and development documents local, and update both public READMEs.
35 lines
944 B
JavaScript
35 lines
944 B
JavaScript
/* global App */
|
|
|
|
'use strict';
|
|
(function() {
|
|
/**
|
|
* This file should never be changed or add new functionalities.
|
|
* The responsibility is only start the app instance and catch
|
|
* the error from the start function.
|
|
*
|
|
* The main reason is this file is not test-able so
|
|
* it should not grow anyway.
|
|
*
|
|
* If you have a new module, please find a proper parent
|
|
* in the dependency tree and put it there.
|
|
*/
|
|
window.app = new App();
|
|
var startApp = function() {
|
|
window.app.start().catch(function(err) {
|
|
console.error(err);
|
|
console.trace();
|
|
});
|
|
};
|
|
if (document.readyState !== 'loading') {
|
|
startApp();
|
|
} else {
|
|
document.addEventListener('readystatechange',
|
|
function readyStateChange() {
|
|
if (document.readyState == 'interactive') {
|
|
document.removeEventListener('readystatechange',
|
|
readyStateChange);
|
|
startApp();
|
|
}
|
|
});
|
|
}
|
|
}());
|