mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Unminify using 1.5.323
Repo with tag: https://github.com/MediaBrowser/emby-webcomponents/tree/1.5.323
This commit is contained in:
parent
4678528d00
commit
de6ac33ec1
289 changed files with 78483 additions and 54701 deletions
|
@ -1,35 +1,75 @@
|
|||
define(function() {
|
||||
"use strict";
|
||||
define(function () {
|
||||
'use strict';
|
||||
|
||||
var requireCss = {};
|
||||
|
||||
requireCss.normalize = function (name, normalize) {
|
||||
if (name.substr(name.length - 4, 4) === '.css') {
|
||||
name = name.substr(0, name.length - 4);
|
||||
}
|
||||
|
||||
return normalize(name);
|
||||
};
|
||||
|
||||
var importedCss = [];
|
||||
|
||||
function isLoaded(url) {
|
||||
return -1 !== importedCss.indexOf(url)
|
||||
return importedCss.indexOf(url) !== -1;
|
||||
}
|
||||
|
||||
function removeFromLoadHistory(url) {
|
||||
url = url.toLowerCase(), importedCss = importedCss.filter(function(c) {
|
||||
return -1 === url.indexOf(c.toLowerCase())
|
||||
})
|
||||
|
||||
url = url.toLowerCase();
|
||||
|
||||
importedCss = importedCss.filter(function (c) {
|
||||
return url.indexOf(c.toLowerCase()) === -1;
|
||||
});
|
||||
}
|
||||
var requireCss = {};
|
||||
requireCss.normalize = function(name, normalize) {
|
||||
return ".css" === name.substr(name.length - 4, 4) && (name = name.substr(0, name.length - 4)), normalize(name)
|
||||
};
|
||||
var importedCss = [];
|
||||
return requireCss.load = function(cssId, req, load, config) {
|
||||
var srch = "/emby-webcomponents/require/requirecss",
|
||||
index = cssId.indexOf(srch); - 1 !== index && (cssId = "css" + cssId.substring(index + srch.length));
|
||||
var url = cssId + ".css";
|
||||
if (-1 === url.indexOf("://") && (url = config.baseUrl + url), isLoaded(url)) load();
|
||||
else {
|
||||
|
||||
requireCss.load = function (cssId, req, load, config) {
|
||||
|
||||
// Somehow if the url starts with /css, require will get all screwed up since this extension is also called css
|
||||
var srch = '/emby-webcomponents/require/requirecss';
|
||||
var index = cssId.indexOf(srch);
|
||||
|
||||
if (index !== -1) {
|
||||
cssId = 'css' + cssId.substring(index + srch.length);
|
||||
}
|
||||
|
||||
var url = cssId + '.css';
|
||||
|
||||
if (url.indexOf('://') === -1) {
|
||||
url = config.baseUrl + url;
|
||||
}
|
||||
|
||||
if (!isLoaded(url)) {
|
||||
importedCss.push(url);
|
||||
var link = document.createElement("link");
|
||||
link.setAttribute("rel", "stylesheet"), link.setAttribute("type", "text/css"), link.onload = load;
|
||||
|
||||
var link = document.createElement('link');
|
||||
|
||||
link.setAttribute('rel', 'stylesheet');
|
||||
link.setAttribute('type', 'text/css');
|
||||
link.onload = load;
|
||||
|
||||
var linkUrl = url;
|
||||
config.urlArgs && (linkUrl += config.urlArgs(cssId, url)), link.setAttribute("href", linkUrl), document.head.appendChild(link)
|
||||
|
||||
if (config.urlArgs) {
|
||||
linkUrl += config.urlArgs(cssId, url);
|
||||
}
|
||||
link.setAttribute('href', linkUrl);
|
||||
document.head.appendChild(link);
|
||||
} else {
|
||||
load();
|
||||
}
|
||||
}, window.requireCss = {
|
||||
removeStylesheet: function(stylesheet) {
|
||||
stylesheet.parentNode.removeChild(stylesheet), removeFromLoadHistory(stylesheet.href)
|
||||
};
|
||||
|
||||
window.requireCss = {
|
||||
removeStylesheet: function (stylesheet) {
|
||||
|
||||
stylesheet.parentNode.removeChild(stylesheet);
|
||||
removeFromLoadHistory(stylesheet.href);
|
||||
}
|
||||
}, requireCss
|
||||
});
|
||||
};
|
||||
|
||||
return requireCss;
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue