mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
d3a9a9b49e
commit
bcfbb01b4b
45 changed files with 405 additions and 390 deletions
|
@ -12,6 +12,13 @@
|
|||
|
||||
})();
|
||||
|
||||
// Compatibility
|
||||
window.Logger = {
|
||||
log: function(msg) {
|
||||
console.log(msg);
|
||||
}
|
||||
};
|
||||
|
||||
var Dashboard = {
|
||||
|
||||
filterHtml: function (html) {
|
||||
|
@ -888,7 +895,6 @@ var Dashboard = {
|
|||
html += '</div>';
|
||||
|
||||
$('.content-primary', page).before(html);
|
||||
Events.trigger(page, 'create');
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1605,18 +1611,20 @@ var AppInfo = {};
|
|||
apiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||
apiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
|
||||
|
||||
$(apiClient).off("websocketmessage", Dashboard.onWebSocketMessageReceived).off('requestfail', Dashboard.onRequestFail);
|
||||
Events.off(apiClient, 'websocketmessage', Dashboard.onWebSocketMessageReceived);
|
||||
Events.on(apiClient, 'websocketmessage', Dashboard.onWebSocketMessageReceived);
|
||||
|
||||
$(apiClient).on("websocketmessage", Dashboard.onWebSocketMessageReceived).on('requestfail', Dashboard.onRequestFail);
|
||||
Events.off(apiClient, 'requestfail', Dashboard.onRequestFail);
|
||||
Events.on(apiClient, 'requestfail', Dashboard.onRequestFail);
|
||||
}
|
||||
|
||||
//localStorage.clear();
|
||||
function createConnectionManager(capabilities) {
|
||||
function createConnectionManager(credentialProviderFactory, capabilities) {
|
||||
|
||||
var credentialKey = Dashboard.isConnectMode() ? null : 'servercredentials4';
|
||||
var credentialProvider = new MediaBrowser.CredentialProvider(credentialKey);
|
||||
var credentialProvider = new credentialProviderFactory(credentialKey);
|
||||
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities);
|
||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(credentialProvider, AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, capabilities, window.devicePixelRatio);
|
||||
|
||||
if (window.location.href.toLowerCase().indexOf('wizardstart.html') != -1) {
|
||||
window.ConnectionManager.clearData();
|
||||
|
@ -1653,12 +1661,14 @@ var AppInfo = {};
|
|||
|
||||
} else {
|
||||
|
||||
var apiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId);
|
||||
apiClient.enableAutomaticNetworking = false;
|
||||
ConnectionManager.addApiClient(apiClient);
|
||||
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
|
||||
window.ApiClient = apiClient;
|
||||
resolve();
|
||||
require(['apiclient'], function(apiClientFactory) {
|
||||
var apiClient = new apiClientFactory(Dashboard.serverAddress(), AppInfo.appName, AppInfo.appVersion, AppInfo.deviceName, AppInfo.deviceId, window.devicePixelRatio);
|
||||
apiClient.enableAutomaticNetworking = false;
|
||||
ConnectionManager.addApiClient(apiClient);
|
||||
Dashboard.importCss(apiClient.getUrl('Branding/Css'));
|
||||
window.ApiClient = apiClient;
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -1779,7 +1789,12 @@ var AppInfo = {};
|
|||
masonry: bowerPath + '/masonry/dist/masonry.pkgd.min',
|
||||
humanedate: 'components/humanedate',
|
||||
jQuery: bowerPath + '/jquery/dist/jquery.min',
|
||||
fastclick: bowerPath + '/fastclick/lib/fastclick'
|
||||
fastclick: bowerPath + '/fastclick/lib/fastclick',
|
||||
events: apiClientBowerPath + '/events',
|
||||
credentialprovider: apiClientBowerPath + '/credentials',
|
||||
apiclient: apiClientBowerPath + '/apiclient',
|
||||
connectionmanagerfactory: apiClientBowerPath + '/connectionmanager',
|
||||
connectservice: apiClientBowerPath + '/connectservice'
|
||||
};
|
||||
|
||||
paths.hlsjs = bowerPath + "/hls.js/dist/hls.min";
|
||||
|
@ -1906,13 +1921,8 @@ var AppInfo = {};
|
|||
define("fileupload", [apiClientBowerPath + "/fileupload"]);
|
||||
}
|
||||
|
||||
define("connectservice", [apiClientBowerPath + "/connectservice"]);
|
||||
define("apiclient-store", [apiClientBowerPath + "/store"]);
|
||||
define("apiclient-events", [apiClientBowerPath + "/events"]);
|
||||
define("apiclient-logger", [apiClientBowerPath + "/logger"]);
|
||||
define("apiclient-credentials", [apiClientBowerPath + "/credentials"]);
|
||||
define("apiclient-deferred", [apiClientBowerPath + "/deferred"]);
|
||||
define("apiclient", [apiClientBowerPath + "/apiclient"]);
|
||||
define("apiclient-deferred", ["legacy/deferred"]);
|
||||
define("connectionmanager", [apiClientBowerPath + "/connectionmanager"]);
|
||||
|
||||
define("contentuploader", [apiClientBowerPath + "/sync/contentuploader"]);
|
||||
|
@ -1983,6 +1993,7 @@ var AppInfo = {};
|
|||
define("buttonenabled", ["legacy/buttonenabled"]);
|
||||
|
||||
var deps = [];
|
||||
deps.push('events');
|
||||
|
||||
if (!window.fetch) {
|
||||
deps.push('fetch');
|
||||
|
@ -1990,13 +2001,14 @@ var AppInfo = {};
|
|||
|
||||
deps.push('scripts/mediacontroller');
|
||||
deps.push('scripts/globalize');
|
||||
deps.push('apiclient-events');
|
||||
|
||||
deps.push('jQuery');
|
||||
|
||||
deps.push('paper-drawer-panel');
|
||||
|
||||
require(deps, function () {
|
||||
require(deps, function (events) {
|
||||
|
||||
window.Events = events;
|
||||
|
||||
for (var i in hostingAppInfo) {
|
||||
AppInfo[i] = hostingAppInfo[i];
|
||||
|
@ -2032,6 +2044,8 @@ var AppInfo = {};
|
|||
}
|
||||
|
||||
var deps = [];
|
||||
deps.push('connectionmanagerfactory');
|
||||
deps.push('credentialprovider');
|
||||
|
||||
if (AppInfo.isNativeApp && browserInfo.android) {
|
||||
require(['cordova/android/logging']);
|
||||
|
@ -2040,11 +2054,13 @@ var AppInfo = {};
|
|||
deps.push('appstorage');
|
||||
deps.push('scripts/mediaplayer');
|
||||
deps.push('scripts/appsettings');
|
||||
deps.push('apiclient');
|
||||
deps.push('connectionmanager');
|
||||
deps.push('apiclient-credentials');
|
||||
|
||||
require(deps, function () {
|
||||
require(deps, function (connectionManagerExports, credentialProviderFactory) {
|
||||
|
||||
window.MediaBrowser = window.MediaBrowser || {};
|
||||
for (var i in connectionManagerExports) {
|
||||
MediaBrowser[i] = connectionManagerExports[i];
|
||||
}
|
||||
|
||||
// TODO: This needs to be deprecated, but it's used heavily
|
||||
$.fn.checked = function (value) {
|
||||
|
@ -2094,8 +2110,7 @@ var AppInfo = {};
|
|||
promises.push(getRequirePromise(deps));
|
||||
|
||||
promises.push(Globalize.ensure());
|
||||
promises.push(createConnectionManager(capabilities));
|
||||
|
||||
promises.push(createConnectionManager(credentialProviderFactory, capabilities));
|
||||
|
||||
Promise.all(promises).then(function () {
|
||||
|
||||
|
@ -2417,7 +2432,6 @@ var AppInfo = {};
|
|||
var initialDependencies = [];
|
||||
|
||||
initialDependencies.push('isMobile');
|
||||
initialDependencies.push('apiclient-logger');
|
||||
initialDependencies.push('apiclient-store');
|
||||
initialDependencies.push('scripts/extensions');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue