mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
bundle flvjs and shaka and move all libs to one folder
This commit is contained in:
parent
bbc5a5f491
commit
02a23ffaee
11 changed files with 86 additions and 155 deletions
|
@ -430,13 +430,8 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function loadUserSkinWithOptions(ctx) {
|
||||
|
||||
require(['queryString'], function (queryString) {
|
||||
|
||||
//var url = options.url;
|
||||
//var index = url.indexOf('?');
|
||||
var params = queryString.parse(ctx.querystring);
|
||||
|
||||
skinManager.loadUserSkin({
|
||||
start: params.start
|
||||
});
|
||||
|
@ -444,16 +439,13 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function validateRoles(apiClient, roles) {
|
||||
|
||||
return Promise.all(roles.split(',').map(function (role) {
|
||||
return validateRole(apiClient, role);
|
||||
}));
|
||||
}
|
||||
|
||||
function validateRole(apiClient, role) {
|
||||
|
||||
if (role === 'admin') {
|
||||
|
||||
return apiClient.getCurrentUser().then(function (user) {
|
||||
if (user.Policy.IsAdministrator) {
|
||||
return Promise.resolve();
|
||||
|
@ -480,7 +472,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
route: route,
|
||||
path: ctx.path
|
||||
};
|
||||
//next();
|
||||
|
||||
ctx.handled = true;
|
||||
}
|
||||
|
@ -503,7 +494,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function endsWith(str, srch) {
|
||||
|
||||
return str.lastIndexOf(srch) === srch.length - 1;
|
||||
}
|
||||
|
||||
|
@ -513,6 +503,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
if (endsWith(baseRoute, '/') && !endsWith(baseRoute, '://')) {
|
||||
baseRoute = baseRoute.substring(0, baseRoute.length - 1);
|
||||
}
|
||||
|
||||
function baseUrl() {
|
||||
return baseRoute;
|
||||
}
|
||||
|
@ -551,14 +542,11 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function back() {
|
||||
|
||||
page.back();
|
||||
}
|
||||
|
||||
function canGoBack() {
|
||||
|
||||
var curr = current();
|
||||
|
||||
if (!curr) {
|
||||
return false;
|
||||
}
|
||||
|
@ -576,7 +564,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function show(path, options) {
|
||||
|
||||
if (path.indexOf('/') !== 0 && path.indexOf('://') === -1) {
|
||||
path = '/' + path;
|
||||
}
|
||||
|
@ -585,7 +572,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
path = path.replace(baseRoute, '');
|
||||
|
||||
if (currentRouteInfo && currentRouteInfo.path === path) {
|
||||
|
||||
// can't use this with home right now due to the back menu
|
||||
if (currentRouteInfo.route.type !== 'home') {
|
||||
loading.hide();
|
||||
|
@ -594,7 +580,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
resolveOnNextShow = resolve;
|
||||
page.show(path, options);
|
||||
});
|
||||
|
@ -615,14 +600,12 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function showItem(item, serverId, options) {
|
||||
|
||||
if (typeof (item) === 'string') {
|
||||
var apiClient = serverId ? connectionManager.getApiClient(serverId) : connectionManager.currentApiClient();
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), item).then(function (item) {
|
||||
appRouter.showItem(item, options);
|
||||
});
|
||||
} else {
|
||||
|
||||
if (arguments.length === 2) {
|
||||
options = arguments[1];
|
||||
}
|
||||
|
@ -637,7 +620,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
var allRoutes = [];
|
||||
|
||||
function addRoute(path, newRoute) {
|
||||
|
||||
page(path, getHandler(newRoute));
|
||||
allRoutes.push(newRoute);
|
||||
}
|
||||
|
@ -649,7 +631,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
var backdropContainer;
|
||||
var backgroundContainer;
|
||||
function setTransparency(level) {
|
||||
|
||||
if (!backdropContainer) {
|
||||
backdropContainer = document.querySelector('.backdropContainer');
|
||||
}
|
||||
|
@ -662,8 +643,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
document.documentElement.classList.add('transparentDocument');
|
||||
backgroundContainer.classList.add('backgroundContainer-transparent');
|
||||
backdropContainer.classList.add('hide');
|
||||
}
|
||||
else if (level === 'backdrop' || level === 1) {
|
||||
} else if (level === 'backdrop' || level === 1) {
|
||||
backdrop.externalBackdrop(true);
|
||||
document.documentElement.classList.add('transparentDocument');
|
||||
backgroundContainer.classList.add('backgroundContainer-transparent');
|
||||
|
@ -677,9 +657,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
function pushState(state, title, url) {
|
||||
|
||||
state.navigate = false;
|
||||
|
||||
page.pushState(state, title, url);
|
||||
}
|
||||
|
||||
|
@ -690,40 +668,24 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
}
|
||||
|
||||
console.log('Setting page base to ' + baseRoute);
|
||||
|
||||
page.base(baseRoute);
|
||||
}
|
||||
|
||||
setBaseRoute();
|
||||
|
||||
function syncNow() {
|
||||
require(['localsync'], function (localSync) {
|
||||
localSync.sync();
|
||||
});
|
||||
}
|
||||
|
||||
function invokeShortcut(id) {
|
||||
|
||||
if (id.indexOf('library-') === 0) {
|
||||
|
||||
id = id.replace('library-', '');
|
||||
|
||||
id = id.split('_');
|
||||
|
||||
appRouter.showItem(id[0], id[1]);
|
||||
|
||||
} else if (id.indexOf('item-') === 0) {
|
||||
|
||||
id = id.replace('item-', '');
|
||||
|
||||
id = id.split('_');
|
||||
|
||||
appRouter.showItem(id[0], id[1]);
|
||||
|
||||
} else {
|
||||
|
||||
id = id.split('_');
|
||||
|
||||
appRouter.show(appRouter.getRouteUrl(id[0], {
|
||||
serverId: id[1]
|
||||
}));
|
||||
|
@ -740,6 +702,7 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
appRouter.canGoBack = canGoBack;
|
||||
appRouter.current = current;
|
||||
appRouter.beginConnectionWizard = beginConnectionWizard;
|
||||
appRouter.invokeShortcut = invokeShortcut;
|
||||
appRouter.showItem = showItem;
|
||||
appRouter.setTransparency = setTransparency;
|
||||
appRouter.getRoutes = getRoutes;
|
||||
|
@ -751,7 +714,6 @@ define(['loading', 'globalize', 'events', 'viewManager', 'layoutManager', 'skinM
|
|||
Backdrop: 1,
|
||||
Full: 2
|
||||
};
|
||||
appRouter.invokeShortcut = invokeShortcut;
|
||||
|
||||
return appRouter;
|
||||
});
|
||||
|
|
|
@ -2,7 +2,6 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
'use strict';
|
||||
|
||||
function getKey(name, userId) {
|
||||
|
||||
if (userId) {
|
||||
name = userId + '-' + name;
|
||||
}
|
||||
|
@ -15,20 +14,15 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
}
|
||||
|
||||
AppSettings.prototype.enableAutoLogin = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('enableAutoLogin', val.toString());
|
||||
}
|
||||
|
||||
return this.get('enableAutoLogin') !== 'false';
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableAutomaticBitrateDetection = function (isInNetwork, mediaType, val) {
|
||||
|
||||
var key = 'enableautobitratebitrate-' + mediaType + '-' + isInNetwork;
|
||||
|
||||
if (val != null) {
|
||||
|
||||
if (isInNetwork && mediaType === 'Audio') {
|
||||
val = true;
|
||||
}
|
||||
|
@ -44,11 +38,8 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.maxStreamingBitrate = function (isInNetwork, mediaType, val) {
|
||||
|
||||
var key = 'maxbitrate-' + mediaType + '-' + isInNetwork;
|
||||
|
||||
if (val != null) {
|
||||
|
||||
if (isInNetwork && mediaType === 'Audio') {
|
||||
// nothing to do, this is always a max value
|
||||
} else {
|
||||
|
@ -65,7 +56,6 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.maxStaticMusicBitrate = function (val) {
|
||||
|
||||
if (val !== undefined) {
|
||||
this.set('maxStaticMusicBitrate', val);
|
||||
}
|
||||
|
@ -75,18 +65,15 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.maxChromecastBitrate = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('chromecastBitrate1', val);
|
||||
}
|
||||
|
||||
val = this.get('chromecastBitrate1');
|
||||
|
||||
return val ? parseInt(val) : null;
|
||||
};
|
||||
|
||||
AppSettings.prototype.syncOnlyOnWifi = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('syncOnlyOnWifi', val.toString());
|
||||
}
|
||||
|
@ -95,7 +82,6 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.syncPath = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('syncPath', val);
|
||||
}
|
||||
|
@ -104,13 +90,11 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.cameraUploadServers = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('cameraUploadServers', val.join(','));
|
||||
}
|
||||
|
||||
val = this.get('cameraUploadServers');
|
||||
|
||||
if (val) {
|
||||
return val.split(',');
|
||||
}
|
||||
|
@ -119,7 +103,6 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.runAtStartup = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('runatstartup', val.toString());
|
||||
}
|
||||
|
@ -128,9 +111,7 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.set = function (name, value, userId) {
|
||||
|
||||
var currentValue = this.get(name, userId);
|
||||
|
||||
appStorage.setItem(getKey(name, userId), value);
|
||||
|
||||
if (currentValue !== value) {
|
||||
|
@ -139,12 +120,10 @@ define(['appStorage', 'events'], function (appStorage, events) {
|
|||
};
|
||||
|
||||
AppSettings.prototype.get = function (name, userId) {
|
||||
|
||||
return appStorage.getItem(getKey(name, userId));
|
||||
};
|
||||
|
||||
AppSettings.prototype.enableSystemExternalPlayers = function (val) {
|
||||
|
||||
if (val != null) {
|
||||
this.set('enableSystemExternalPlayers', val.toString());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue