mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update apiclient
This commit is contained in:
parent
bba5791b88
commit
31a5eef8bc
10 changed files with 462 additions and 54 deletions
|
@ -16,12 +16,12 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.0.17",
|
"version": "1.0.19",
|
||||||
"_release": "1.0.17",
|
"_release": "1.0.19",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.0.17",
|
"tag": "1.0.19",
|
||||||
"commit": "3ce9bb842c3188d3440aef5319b01a24e57603cb"
|
"commit": "09f50cd4f4b126b0ea9a0a26c1b425b4a1e25f5b"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
"_source": "git://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
||||||
"_target": "~1.0.3",
|
"_target": "~1.0.3",
|
||||||
|
|
|
@ -187,7 +187,8 @@
|
||||||
|
|
||||||
var fetchRequest = {
|
var fetchRequest = {
|
||||||
headers: headers,
|
headers: headers,
|
||||||
method: request.type
|
method: request.type,
|
||||||
|
credentials: 'same-origin'
|
||||||
};
|
};
|
||||||
|
|
||||||
var contentType = request.contentType;
|
var contentType = request.contentType;
|
||||||
|
@ -221,6 +222,9 @@
|
||||||
|
|
||||||
var timeout = setTimeout(reject, timeoutMs);
|
var timeout = setTimeout(reject, timeoutMs);
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
options.credentials = 'same-origin';
|
||||||
|
|
||||||
fetch(url, options).then(function (response) {
|
fetch(url, options).then(function (response) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
resolve(response);
|
resolve(response);
|
||||||
|
|
|
@ -88,7 +88,8 @@
|
||||||
|
|
||||||
var fetchRequest = {
|
var fetchRequest = {
|
||||||
headers: headers,
|
headers: headers,
|
||||||
method: request.type
|
method: request.type,
|
||||||
|
credentials: 'same-origin'
|
||||||
};
|
};
|
||||||
|
|
||||||
var contentType = request.contentType;
|
var contentType = request.contentType;
|
||||||
|
@ -124,6 +125,9 @@
|
||||||
|
|
||||||
var timeout = setTimeout(reject, timeoutMs);
|
var timeout = setTimeout(reject, timeoutMs);
|
||||||
|
|
||||||
|
options = options || {};
|
||||||
|
options.credentials = 'same-origin';
|
||||||
|
|
||||||
fetch(url, options).then(function (response) {
|
fetch(url, options).then(function (response) {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
|
|
|
@ -10,19 +10,19 @@
|
||||||
"license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE",
|
"license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE",
|
||||||
"homepage": "https://github.com/MediaBrowser/emby-webcomponents",
|
"homepage": "https://github.com/MediaBrowser/emby-webcomponents",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"requirejs": "requirejs#^2.1.22"
|
"requirejs": "requirejs#^2.1.22",
|
||||||
|
"isMobile": "isMobile#^0.3.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"ignore": [],
|
"ignore": [],
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"_release": "1.0.0",
|
"_release": "1.0.2",
|
||||||
"_resolution": {
|
"_resolution": {
|
||||||
"type": "version",
|
"type": "version",
|
||||||
"tag": "1.0.0",
|
"tag": "1.0.2",
|
||||||
"commit": "e5ea8f8503ae36e45609e77aae4ecae170cb5dea"
|
"commit": "a4909b1637879d7e52ce9eaba8247ad98b690de9"
|
||||||
},
|
},
|
||||||
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
"_source": "git://github.com/MediaBrowser/emby-webcomponents.git",
|
||||||
"_target": "~1.0.0",
|
"_target": "~1.0.0",
|
||||||
"_originalSource": "emby-webcomponents",
|
"_originalSource": "emby-webcomponents"
|
||||||
"_direct": true
|
|
||||||
}
|
}
|
|
@ -10,7 +10,8 @@
|
||||||
"license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE",
|
"license": "https://github.com/MediaBrowser/emby-webcomponents/blob/master/LICENSE",
|
||||||
"homepage": "https://github.com/MediaBrowser/emby-webcomponents",
|
"homepage": "https://github.com/MediaBrowser/emby-webcomponents",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"requirejs": "requirejs#^2.1.22"
|
"requirejs": "requirejs#^2.1.22",
|
||||||
|
"isMobile": "isMobile#^0.3.9"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
||||||
|
|
66
dashboard-ui/bower_components/emby-webcomponents/browser.js
vendored
Normal file
66
dashboard-ui/bower_components/emby-webcomponents/browser.js
vendored
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
define(['isMobile'], function (isMobile) {
|
||||||
|
|
||||||
|
var uaMatch = function (ua) {
|
||||||
|
ua = ua.toLowerCase();
|
||||||
|
|
||||||
|
var match = /(edge)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
|
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
|
/(opr)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
|
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
|
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
||||||
|
/(msie) ([\w.]+)/.exec(ua) ||
|
||||||
|
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||||
|
[];
|
||||||
|
|
||||||
|
var platform_match = /(ipad)/.exec(ua) ||
|
||||||
|
/(iphone)/.exec(ua) ||
|
||||||
|
/(android)/.exec(ua) ||
|
||||||
|
[];
|
||||||
|
|
||||||
|
var browser = match[1] || "";
|
||||||
|
|
||||||
|
if (ua.indexOf("windows phone") != -1 || ua.indexOf("iemobile") != -1) {
|
||||||
|
|
||||||
|
// http://www.neowin.net/news/ie11-fakes-user-agent-to-fool-gmail-in-windows-phone-81-gdr1-update
|
||||||
|
browser = "msie";
|
||||||
|
}
|
||||||
|
else if (ua.indexOf("like gecko") != -1 && ua.indexOf('webkit') == -1 && ua.indexOf('opera') == -1 && ua.indexOf('chrome') == -1 && ua.indexOf('safari') == -1) {
|
||||||
|
browser = "msie";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (browser == 'opr') {
|
||||||
|
browser = 'opera';
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
browser: browser,
|
||||||
|
version: match[2] || "0",
|
||||||
|
platform: platform_match[0] || ""
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
var userAgent = window.navigator.userAgent;
|
||||||
|
var matched = uaMatch(userAgent);
|
||||||
|
var browser = {};
|
||||||
|
|
||||||
|
if (matched.browser) {
|
||||||
|
browser[matched.browser] = true;
|
||||||
|
browser.version = matched.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (matched.platform) {
|
||||||
|
browser[matched.platform] = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!browser.chrome && !browser.msie && !browser.edge && !browser.opera && userAgent.toLowerCase().indexOf("webkit") != -1) {
|
||||||
|
browser.safari = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMobile.any) {
|
||||||
|
browser.mobile = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
browser.animate = document.documentElement.animate != null;
|
||||||
|
|
||||||
|
return browser;
|
||||||
|
});
|
333
dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js
vendored
Normal file
333
dashboard-ui/bower_components/emby-webcomponents/browserdeviceprofile.js
vendored
Normal file
|
@ -0,0 +1,333 @@
|
||||||
|
define(['browser'], function (browser) {
|
||||||
|
|
||||||
|
var supportedFormats;
|
||||||
|
function getSupportedFormats() {
|
||||||
|
|
||||||
|
if (supportedFormats) {
|
||||||
|
return supportedFormats;
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = [];
|
||||||
|
var elem = document.createElement('video');
|
||||||
|
|
||||||
|
if (elem.canPlayType('video/webm').replace(/no/, '')) {
|
||||||
|
list.push('webm');
|
||||||
|
}
|
||||||
|
if (elem.canPlayType('audio/mp4; codecs="ac-3"').replace(/no/, '')) {
|
||||||
|
list.push('ac3');
|
||||||
|
}
|
||||||
|
if (browser.chrome) {
|
||||||
|
list.push('mkv');
|
||||||
|
}
|
||||||
|
|
||||||
|
var canPlayH264 = true;
|
||||||
|
var userAgent = navigator.userAgent.toLowerCase();
|
||||||
|
if (userAgent.indexOf('firefox') != -1 && userAgent.indexOf('windows') == -1) {
|
||||||
|
canPlayH264 = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canPlayH264) {
|
||||||
|
list.push('h264');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.createElement('audio').canPlayType('audio/aac').replace(/no/, '')) {
|
||||||
|
list.push('aac');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.createElement('audio').canPlayType('audio/mp3').replace(/no/, '')) {
|
||||||
|
list.push('mp3');
|
||||||
|
}
|
||||||
|
if (document.createElement('audio').canPlayType('audio/ogg; codecs="opus"').replace(/no/, '')) {
|
||||||
|
list.push('opus');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.createElement('audio').canPlayType('audio/webm').replace(/no/, '')) {
|
||||||
|
list.push('webma');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (document.createElement('audio').canPlayType('audio/flac').replace(/no/, '')) {
|
||||||
|
list.push('flac');
|
||||||
|
}
|
||||||
|
|
||||||
|
supportedFormats = list;
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _supportsTextTracks;
|
||||||
|
function supportsTextTracks() {
|
||||||
|
|
||||||
|
if (_supportsTextTracks == null) {
|
||||||
|
_supportsTextTracks = document.createElement('video').textTracks != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// For now, until ready
|
||||||
|
return _supportsTextTracks;
|
||||||
|
}
|
||||||
|
|
||||||
|
var _canPlayHls;
|
||||||
|
function canPlayHls(src) {
|
||||||
|
|
||||||
|
if (_canPlayHls == null) {
|
||||||
|
_canPlayHls = window.MediaSource != null || canPlayNativeHls();
|
||||||
|
}
|
||||||
|
return _canPlayHls;
|
||||||
|
}
|
||||||
|
|
||||||
|
function canPlayNativeHls() {
|
||||||
|
var media = document.createElement('video');
|
||||||
|
|
||||||
|
if (media.canPlayType('application/x-mpegURL').replace(/no/, '') ||
|
||||||
|
media.canPlayType('application/vnd.apple.mpegURL').replace(/no/, '')) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return function () {
|
||||||
|
|
||||||
|
var bitrateSetting = 100000000;
|
||||||
|
|
||||||
|
var supportedFormats = getSupportedFormats();
|
||||||
|
|
||||||
|
var canPlayWebm = supportedFormats.indexOf('webm') != -1;
|
||||||
|
var canPlayAc3 = supportedFormats.indexOf('ac3') != -1;
|
||||||
|
var canPlayMp3 = supportedFormats.indexOf('mp3') != -1;
|
||||||
|
var canPlayAac = supportedFormats.indexOf('aac') != -1;
|
||||||
|
var canPlayMkv = supportedFormats.indexOf('mkv') != -1;
|
||||||
|
|
||||||
|
var profile = {};
|
||||||
|
|
||||||
|
profile.MaxStreamingBitrate = bitrateSetting;
|
||||||
|
profile.MaxStaticBitrate = 100000000;
|
||||||
|
profile.MusicStreamingTranscodingBitrate = Math.min(bitrateSetting, 192000);
|
||||||
|
|
||||||
|
profile.DirectPlayProfiles = [];
|
||||||
|
|
||||||
|
if (supportedFormats.indexOf('h264') != -1) {
|
||||||
|
profile.DirectPlayProfiles.push({
|
||||||
|
Container: 'mp4,m4v',
|
||||||
|
Type: 'Video',
|
||||||
|
VideoCodec: 'h264',
|
||||||
|
AudioCodec: 'aac' + (canPlayMp3 ? ',mp3' : '') + (canPlayAc3 ? ',ac3' : '')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (browser.chrome) {
|
||||||
|
profile.DirectPlayProfiles.push({
|
||||||
|
Container: 'mkv,mov',
|
||||||
|
Type: 'Video',
|
||||||
|
VideoCodec: 'h264',
|
||||||
|
AudioCodec: 'aac' + (canPlayMp3 ? ',mp3' : '') + (canPlayAc3 ? ',ac3' : '')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
['opus', 'mp3', 'aac', 'flac', 'webma'].forEach(function (audioFormat) {
|
||||||
|
|
||||||
|
if (supportedFormats.indexOf(audioFormat) != -1) {
|
||||||
|
profile.DirectPlayProfiles.push({
|
||||||
|
Container: audioFormat == 'webma' ? 'webma,webm' : audioFormat,
|
||||||
|
Type: 'Audio'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (canPlayWebm) {
|
||||||
|
profile.DirectPlayProfiles.push({
|
||||||
|
Container: 'webm',
|
||||||
|
Type: 'Video'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
profile.TranscodingProfiles = [];
|
||||||
|
|
||||||
|
['opus', 'mp3', 'aac'].forEach(function (audioFormat) {
|
||||||
|
|
||||||
|
if (supportedFormats.indexOf(audioFormat) != -1) {
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: audioFormat,
|
||||||
|
Type: 'Audio',
|
||||||
|
AudioCodec: audioFormat,
|
||||||
|
Context: 'Streaming',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: audioFormat,
|
||||||
|
Type: 'Audio',
|
||||||
|
AudioCodec: audioFormat,
|
||||||
|
Context: 'Static',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Can't use mkv on mobile because we have to use the native player controls and they won't be able to seek it
|
||||||
|
if (canPlayMkv && !browser.mobile) {
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: 'mkv',
|
||||||
|
Type: 'Video',
|
||||||
|
AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''),
|
||||||
|
VideoCodec: 'h264',
|
||||||
|
Context: 'Streaming'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canPlayHls()) {
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: 'ts',
|
||||||
|
Type: 'Video',
|
||||||
|
AudioCodec: 'aac' + (canPlayAc3 ? ',ac3' : ''),
|
||||||
|
VideoCodec: 'h264',
|
||||||
|
Context: 'Streaming',
|
||||||
|
Protocol: 'hls'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canPlayWebm) {
|
||||||
|
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: 'webm',
|
||||||
|
Type: 'Video',
|
||||||
|
AudioCodec: 'vorbis',
|
||||||
|
VideoCodec: 'vpx',
|
||||||
|
Context: 'Streaming',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: 'mp4',
|
||||||
|
Type: 'Video',
|
||||||
|
AudioCodec: 'aac',
|
||||||
|
VideoCodec: 'h264',
|
||||||
|
Context: 'Streaming',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.TranscodingProfiles.push({
|
||||||
|
Container: 'mp4',
|
||||||
|
Type: 'Video',
|
||||||
|
AudioCodec: 'aac',
|
||||||
|
VideoCodec: 'h264',
|
||||||
|
Context: 'Static',
|
||||||
|
Protocol: 'http'
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.ContainerProfiles = [];
|
||||||
|
|
||||||
|
profile.CodecProfiles = [];
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'Audio',
|
||||||
|
Conditions: [{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'AudioChannels',
|
||||||
|
Value: '2'
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Codec: 'aac',
|
||||||
|
Container: 'mkv,mov',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'NotEquals',
|
||||||
|
Property: 'AudioProfile',
|
||||||
|
Value: 'HE-AAC'
|
||||||
|
}
|
||||||
|
// Disabling this is going to require us to learn why it was disabled in the first place
|
||||||
|
//,
|
||||||
|
//{
|
||||||
|
// Condition: 'NotEquals',
|
||||||
|
// Property: 'AudioProfile',
|
||||||
|
// Value: 'LC'
|
||||||
|
//}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Codec: 'aac,mp3',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'AudioChannels',
|
||||||
|
Value: '6'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'VideoAudio',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'Equals',
|
||||||
|
Property: 'IsSecondaryAudio',
|
||||||
|
Value: 'false',
|
||||||
|
IsRequired: 'false'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'Video',
|
||||||
|
Codec: 'h264',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'NotEquals',
|
||||||
|
Property: 'IsAnamorphic',
|
||||||
|
Value: 'true',
|
||||||
|
IsRequired: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Condition: 'EqualsAny',
|
||||||
|
Property: 'VideoProfile',
|
||||||
|
Value: 'high|main|baseline|constrained baseline'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
Condition: 'LessThanEqual',
|
||||||
|
Property: 'VideoLevel',
|
||||||
|
Value: '41'
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.CodecProfiles.push({
|
||||||
|
Type: 'Video',
|
||||||
|
Codec: 'vpx',
|
||||||
|
Conditions: [
|
||||||
|
{
|
||||||
|
Condition: 'NotEquals',
|
||||||
|
Property: 'IsAnamorphic',
|
||||||
|
Value: 'true',
|
||||||
|
IsRequired: false
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
|
// Subtitle profiles
|
||||||
|
// External vtt or burn in
|
||||||
|
profile.SubtitleProfiles = [];
|
||||||
|
if (supportsTextTracks()) {
|
||||||
|
|
||||||
|
profile.SubtitleProfiles.push({
|
||||||
|
Format: 'vtt',
|
||||||
|
Method: 'External'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
profile.ResponseProfiles = [];
|
||||||
|
|
||||||
|
profile.ResponseProfiles.push({
|
||||||
|
Type: 'Video',
|
||||||
|
Container: 'm4v',
|
||||||
|
MimeType: 'video/mp4'
|
||||||
|
});
|
||||||
|
|
||||||
|
profile.ResponseProfiles.push({
|
||||||
|
Type: 'Video',
|
||||||
|
Container: 'mov',
|
||||||
|
MimeType: 'video/webm'
|
||||||
|
});
|
||||||
|
|
||||||
|
return profile;
|
||||||
|
}();
|
||||||
|
});
|
|
@ -26,17 +26,17 @@ define(function () {
|
||||||
requireCss.load = function (cssId, req, load, config) {
|
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
|
// Somehow if the url starts with /css, require will get all screwed up since this extension is also called css
|
||||||
cssId = cssId.replace('components/requirecss', 'css');
|
var srch = '/emby-webcomponents/requirecss';
|
||||||
|
var index = cssId.indexOf(srch);
|
||||||
|
|
||||||
|
if (index != -1) {
|
||||||
|
cssId = 'css' + cssId.substring(index + srch.length);
|
||||||
|
}
|
||||||
|
|
||||||
var url = cssId + '.css';
|
var url = cssId + '.css';
|
||||||
|
|
||||||
var packageName = '';
|
var packageName = '';
|
||||||
|
|
||||||
// TODO: handle any value before the #
|
|
||||||
if (url.indexOf('theme#') != -1) {
|
|
||||||
url = url.replace('theme#', '');
|
|
||||||
packageName = 'theme';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) {
|
if (url.indexOf('http') != 0 && url.indexOf('file:') != 0) {
|
||||||
url = config.baseUrl + url;
|
url = config.baseUrl + url;
|
||||||
}
|
}
|
|
@ -1,18 +1,12 @@
|
||||||
define(function () {
|
define(function () {
|
||||||
var cssAPI = {};
|
|
||||||
|
|
||||||
cssAPI.normalize = function (name, normalize) {
|
|
||||||
if (name.substr(name.length - 5, 5) == '.html')
|
|
||||||
name = name.substr(0, name.length - 5);
|
|
||||||
|
|
||||||
return normalize(name);
|
|
||||||
}
|
|
||||||
|
|
||||||
var importedFiles = [];
|
var importedFiles = [];
|
||||||
|
|
||||||
cssAPI.load = function (cssId, req, load, config) {
|
return {
|
||||||
|
|
||||||
// Somehow if the url starts with /css, require will get all screwed up since this extension is also called css
|
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');
|
cssId = cssId.replace('js/requirehtml', 'html');
|
||||||
|
|
||||||
var url = cssId + '.html';
|
var url = cssId + '.html';
|
||||||
|
@ -40,7 +34,13 @@ define(function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
load();
|
load();
|
||||||
}
|
},
|
||||||
|
|
||||||
return cssAPI;
|
normalize: function (name, normalize) {
|
||||||
|
if (name.substr(name.length - 5, 5) == '.html')
|
||||||
|
name = name.substr(0, name.length - 5);
|
||||||
|
|
||||||
|
return normalize(name);
|
||||||
|
}
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
|
@ -1835,7 +1835,7 @@ var AppInfo = {};
|
||||||
requirejs.config({
|
requirejs.config({
|
||||||
map: {
|
map: {
|
||||||
'*': {
|
'*': {
|
||||||
'css': 'components/requirecss',
|
'css': bowerPath + '/emby-webcomponents/requirecss',
|
||||||
'html': bowerPath + '/emby-webcomponents/requirehtml'
|
'html': bowerPath + '/emby-webcomponents/requirehtml'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue