1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/scripts/apploader.js

42 lines
916 B
JavaScript
Raw Normal View History

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);
}
function loadSite() {
injectScriptElement(
"./libraries/alameda.js",
function() {
// onload of require library
injectScriptElement("./scripts/site.js");
}
);
}
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
})();