mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #343 from thornbill/webpack
Bundle npm dependencies using webpack
This commit is contained in:
commit
c8f392bdd4
12 changed files with 646 additions and 4142 deletions
9
src/bundle.js
Normal file
9
src/bundle.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* require.js module definitions bundled by webpack
|
||||
*/
|
||||
// Use define from require.js not webpack's define
|
||||
var _define = window.define;
|
||||
|
||||
var jstree = require("jstree");
|
||||
require("jstree/dist/themes/default/style.css");
|
||||
_define("jstree", ["jQuery"], function() { return jstree; });
|
|
@ -1,12 +1,29 @@
|
|||
! function() {
|
||||
(function() {
|
||||
"use strict";
|
||||
|
||||
function loadApp() {
|
||||
var script = document.createElement("script"),
|
||||
src = "./scripts/site.js";
|
||||
self.dashboardVersion && (src += "?v=" + self.dashboardVersion), script.src = src, document.head.appendChild(script)
|
||||
}! function() {
|
||||
var src, script = document.createElement("script");
|
||||
src = self.Promise ? "./bower_components/alameda/alameda.js" : "./bower_components/requirejs/require.js", self.dashboardVersion && (src += "?v=" + self.dashboardVersion), script.src = src, script.onload = loadApp, document.head.appendChild(script)
|
||||
}()
|
||||
}();
|
||||
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);
|
||||
}
|
||||
|
||||
injectScriptElement(
|
||||
self.Promise ? "./bower_components/alameda/alameda.js" : "./bower_components/requirejs/require.js",
|
||||
function() {
|
||||
// onload of require library
|
||||
injectScriptElement("./scripts/site.js");
|
||||
}
|
||||
);
|
||||
})();
|
||||
|
|
|
@ -149,7 +149,9 @@ define(["datetime", "jQuery", "material-icons"], function(datetime, $) {
|
|||
nodesToLoad = [], selectedNodeId = null, $.jstree.destroy(), $(".libraryTree", page).jstree({
|
||||
plugins: ["wholerow"],
|
||||
core: {
|
||||
check_callback: !0,
|
||||
// Disable animations because jQuery slim does not support them
|
||||
animation: false,
|
||||
check_callback: true,
|
||||
data: function(node, callback) {
|
||||
loadNode(page, this, node, openItems, selectedId, currentUser, callback)
|
||||
},
|
||||
|
@ -220,4 +222,4 @@ define(["datetime", "jQuery", "material-icons"], function(datetime, $) {
|
|||
getCurrentItemId: getCurrentItemId,
|
||||
setCurrentItemId: setCurrentItemId
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -818,12 +818,15 @@ var AppInfo = {};
|
|||
text: "components/require/requiretext"
|
||||
}
|
||||
},
|
||||
bundles: {
|
||||
bundle: ["jstree"]
|
||||
},
|
||||
urlArgs: urlArgs,
|
||||
paths: paths,
|
||||
onError: onRequireJsError
|
||||
});
|
||||
requirejs.onError = onRequireJsError;
|
||||
define("jstree", ["thirdparty/jstree/jstree", "css!thirdparty/jstree/themes/default/style.css"], returnFirstDependency);
|
||||
|
||||
define("dashboardcss", ["css!css/dashboard"], returnFirstDependency);
|
||||
define("slideshow", [componentsPath + "/slideshow/slideshow"], returnFirstDependency);
|
||||
define("fetch", [bowerPath + "/fetch/fetch"], returnFirstDependency);
|
||||
|
|
2926
src/thirdparty/jstree/jstree.js
vendored
2926
src/thirdparty/jstree/jstree.js
vendored
File diff suppressed because it is too large
Load diff
BIN
src/thirdparty/jstree/themes/default/32px.png
vendored
BIN
src/thirdparty/jstree/themes/default/32px.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 2.8 KiB |
1003
src/thirdparty/jstree/themes/default/style.css
vendored
1003
src/thirdparty/jstree/themes/default/style.css
vendored
File diff suppressed because it is too large
Load diff
BIN
src/thirdparty/jstree/themes/default/throbber.gif
vendored
BIN
src/thirdparty/jstree/themes/default/throbber.gif
vendored
Binary file not shown.
Before Width: | Height: | Size: 1.4 KiB |
Loading…
Add table
Add a link
Reference in a new issue