mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
Simplify apploader code
This commit is contained in:
parent
5734d5d07d
commit
1122b5b5d9
@ -1,24 +1,29 @@
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
function loadApp() {
|
||||
var script = document.createElement("script"),
|
||||
src = "./scripts/site.js";
|
||||
function injectScriptElement(src, onload) {
|
||||
if (!src) {
|
||||
return;
|
||||
}
|
||||
|
||||
var script = document.createElement("script");
|
||||
if (self.dashboardVersion) {
|
||||
src += "?v=" + self.dashboardVersion;
|
||||
}
|
||||
script.src = src;
|
||||
|
||||
if (onload) {
|
||||
script.onload = onload;
|
||||
}
|
||||
|
||||
document.head.appendChild(script);
|
||||
}
|
||||
|
||||
(function() {
|
||||
var src, script = document.createElement("script");
|
||||
src = self.Promise ? "./bower_components/alameda/alameda.js" : "./bower_components/requirejs/require.js";
|
||||
if (self.dashboardVersion) {
|
||||
src += "?v=" + self.dashboardVersion;
|
||||
injectScriptElement(
|
||||
self.Promise ? "./bower_components/alameda/alameda.js" : "./bower_components/requirejs/require.js",
|
||||
function() {
|
||||
// onload of require library
|
||||
injectScriptElement("./scripts/site.js");
|
||||
}
|
||||
script.src = src;
|
||||
script.onload = loadApp;
|
||||
document.head.appendChild(script);
|
||||
})();
|
||||
);
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user