1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
This commit is contained in:
Luke Pulverenti 2017-01-27 18:07:14 -05:00
parent 82bcca376f
commit 8a6884abef
494 changed files with 256 additions and 120180 deletions

View file

@ -1,75 +1 @@
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 importedCss.indexOf(url) !== -1;
}
function removeFromLoadHistory(url) {
url = url.toLowerCase();
importedCss = importedCss.filter(function (c) {
return url.indexOf(c.toLowerCase()) === -1;
});
}
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 linkUrl = url;
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);
}
};
return requireCss;
});
define(function(){"use strict";function isLoaded(url){return importedCss.indexOf(url)!==-1}function removeFromLoadHistory(url){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);index!==-1&&(cssId="css"+cssId.substring(index+srch.length));var url=cssId+".css";if(url.indexOf("://")===-1&&(url=config.baseUrl+url),isLoaded(url))load();else{importedCss.push(url);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)}},window.requireCss={removeStylesheet:function(stylesheet){stylesheet.parentNode.removeChild(stylesheet),removeFromLoadHistory(stylesheet.href)}},requireCss});

View file

@ -1,50 +1 @@
define(function () {
'use strict';
var importedFiles = [];
return {
load: function (cssId, req, load, config) {
// Somehow if the url starts with /html, require will get all screwed up since this extension is also called html
cssId = cssId.replace('js/requirehtml', 'html');
var url = cssId + '.html';
if (url.indexOf('://') === -1) {
url = config.baseUrl + url;
}
if (importedFiles.indexOf(url) === -1) {
importedFiles.push(url);
var link = document.createElement('link');
link.rel = 'import';
if (config.urlArgs) {
if (url.toLowerCase().indexOf('bower_') === -1 || url.toLowerCase().indexOf('emby-webcomponents') !== -1) {
url = url + config.urlArgs(cssId, url);
}
}
link.onload = load;
link.href = url;
document.head.appendChild(link);
return;
}
load();
},
normalize: function (name, normalize) {
if (name.substr(name.length - 5, 5) === '.html') {
name = name.substr(0, name.length - 5);
}
return normalize(name);
}
};
});
define(function(){"use strict";var importedFiles=[];return{load:function(cssId,req,load,config){cssId=cssId.replace("js/requirehtml","html");var url=cssId+".html";if(url.indexOf("://")===-1&&(url=config.baseUrl+url),importedFiles.indexOf(url)===-1){importedFiles.push(url);var link=document.createElement("link");return link.rel="import",config.urlArgs&&(url.toLowerCase().indexOf("bower_")!==-1&&url.toLowerCase().indexOf("emby-webcomponents")===-1||(url+=config.urlArgs(cssId,url))),link.onload=load,link.href=url,void document.head.appendChild(link)}load()},normalize:function(name,normalize){return".html"===name.substr(name.length-5,5)&&(name=name.substr(0,name.length-5)),normalize(name)}}});

View file

@ -1,30 +1 @@
define(function () {
'use strict';
return {
load: function (url, req, load, config) {
if (url.indexOf('://') === -1) {
url = config.baseUrl + url;
}
if (config.urlArgs) {
url += config.urlArgs(url, url);
}
var xhr = new XMLHttpRequest();
xhr.open('GET', url, true);
xhr.onload = function (e) {
load(this.response);
};
xhr.send();
},
normalize: function (name, normalize) {
return normalize(name);
}
};
});
define(function(){"use strict";return{load:function(url,req,load,config){url.indexOf("://")===-1&&(url=config.baseUrl+url),config.urlArgs&&(url+=config.urlArgs(url,url));var xhr=new XMLHttpRequest;xhr.open("GET",url,!0),xhr.onload=function(e){load(this.response)},xhr.send()},normalize:function(name,normalize){return normalize(name)}}});