2019-05-22 14:49:57 -04:00
|
|
|
(function() {
|
2018-10-23 01:05:09 +03:00
|
|
|
"use strict";
|
|
|
|
|
2019-06-15 00:21:40 -04:00
|
|
|
function injectScriptElement(src, onload) {
|
|
|
|
if (!src) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
var script = document.createElement("script");
|
2019-05-22 14:49:57 -04:00
|
|
|
if (self.dashboardVersion) {
|
2020-04-06 23:45:39 +02:00
|
|
|
src += `?v=${self.dashboardVersion}`;
|
2019-05-22 14:49:57 -04:00
|
|
|
}
|
|
|
|
script.src = src;
|
2019-06-15 00:21:40 -04:00
|
|
|
|
|
|
|
if (onload) {
|
|
|
|
script.onload = onload;
|
|
|
|
}
|
|
|
|
|
2019-05-22 14:49:57 -04:00
|
|
|
document.head.appendChild(script);
|
|
|
|
}
|
|
|
|
|
2020-02-26 10:29:52 -05:00
|
|
|
function loadSite() {
|
|
|
|
injectScriptElement(
|
|
|
|
"./libraries/alameda.js",
|
|
|
|
function() {
|
|
|
|
// onload of require library
|
|
|
|
injectScriptElement("./scripts/site.js");
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2020-04-23 18:31:11 +03:00
|
|
|
try {
|
|
|
|
Promise.resolve();
|
|
|
|
} catch (ex) {
|
|
|
|
// this checks for several cases actually, typical is
|
|
|
|
// Promise() being missing on some legacy browser, and a funky one
|
|
|
|
// is Promise() present but buggy on WebOS 2
|
|
|
|
window.Promise = undefined;
|
|
|
|
self.Promise = undefined;
|
|
|
|
}
|
|
|
|
|
2020-02-26 10:29:52 -05:00
|
|
|
if (!self.Promise) {
|
|
|
|
// Load Promise polyfill if they are not natively supported
|
|
|
|
injectScriptElement(
|
|
|
|
"./libraries/npo.js",
|
|
|
|
loadSite
|
|
|
|
);
|
|
|
|
} else {
|
|
|
|
loadSite();
|
|
|
|
}
|
2019-05-22 14:49:57 -04:00
|
|
|
})();
|