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
7c9cbbcd8d
commit
d58436bfba
5 changed files with 182 additions and 17 deletions
|
@ -16,12 +16,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.1.108",
|
||||
"_release": "1.1.108",
|
||||
"version": "1.1.109",
|
||||
"_release": "1.1.109",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.1.108",
|
||||
"commit": "ff2072d7422bd9e216a23e667c8fe08910c43265"
|
||||
"tag": "1.1.109",
|
||||
"commit": "04821a9677127cb08a156986385d3345ea9d7e74"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/Emby.ApiClient.Javascript.git",
|
||||
"_target": "^1.1.51",
|
||||
|
|
|
@ -113,9 +113,11 @@
|
|||
itemId = itemId.toString();
|
||||
}
|
||||
|
||||
var serverInfo;
|
||||
|
||||
if (startsWith(itemId, localViewPrefix)) {
|
||||
|
||||
var serverInfo = apiclientcore.serverInfo();
|
||||
serverInfo = apiclientcore.serverInfo();
|
||||
|
||||
if (serverInfo) {
|
||||
return localassetmanager.getViews(serverInfo.Id, userId).then(function (items) {
|
||||
|
@ -136,7 +138,7 @@
|
|||
|
||||
if (startsWith(itemId, localPrefix)) {
|
||||
|
||||
var serverInfo = apiclientcore.serverInfo();
|
||||
serverInfo = apiclientcore.serverInfo();
|
||||
|
||||
if (serverInfo) {
|
||||
return localassetmanager.getLocalItem(serverInfo.Id, stripStart(itemId, localPrefix)).then(function (item) {
|
||||
|
@ -220,9 +222,9 @@
|
|||
|
||||
function createEmptyList() {
|
||||
var result = {
|
||||
Items: new Array(),
|
||||
Items: [],
|
||||
TotalRecordCount: 0
|
||||
}
|
||||
};
|
||||
|
||||
return result;
|
||||
}
|
||||
|
@ -445,6 +447,6 @@
|
|||
self.getPinStatus = apiclientcore.getPinStatus;
|
||||
self.exchangePin = apiclientcore.exchangePin;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
});
|
|
@ -14,12 +14,12 @@
|
|||
},
|
||||
"devDependencies": {},
|
||||
"ignore": [],
|
||||
"version": "1.4.406",
|
||||
"_release": "1.4.406",
|
||||
"version": "1.4.407",
|
||||
"_release": "1.4.407",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "1.4.406",
|
||||
"commit": "5ef7b315244a1804f2892269a42db94a52a86ea8"
|
||||
"tag": "1.4.407",
|
||||
"commit": "12e9ff329e1589da29b56316810c2984eaf681ce"
|
||||
},
|
||||
"_source": "https://github.com/MediaBrowser/emby-webcomponents.git",
|
||||
"_target": "^1.2.1",
|
||||
|
|
152
dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js
vendored
Normal file
152
dashboard-ui/bower_components/emby-webcomponents/pluginmanager.js
vendored
Normal file
|
@ -0,0 +1,152 @@
|
|||
define(['events'], function (Events) {
|
||||
'use strict';
|
||||
|
||||
function pluginManager() {
|
||||
|
||||
var self = this;
|
||||
var plugins = [];
|
||||
|
||||
// In lieu of automatic discovery, plugins will register dynamic objects
|
||||
// Each object will have the following properties:
|
||||
// name
|
||||
// type (skin, screensaver, etc)
|
||||
self.register = function (obj) {
|
||||
|
||||
plugins.push(obj);
|
||||
Events.trigger(self, 'registered', [obj]);
|
||||
};
|
||||
|
||||
self.ofType = function (type) {
|
||||
|
||||
return plugins.filter(function (o) {
|
||||
return o.type === type;
|
||||
});
|
||||
};
|
||||
|
||||
self.plugins = function () {
|
||||
return plugins;
|
||||
};
|
||||
|
||||
self.mapRoute = function (plugin, route) {
|
||||
|
||||
if (typeof plugin === 'string') {
|
||||
plugin = plugins.filter(function (p) {
|
||||
return (p.id || p.packageName) === plugin;
|
||||
})[0];
|
||||
}
|
||||
|
||||
route = route.path || route;
|
||||
|
||||
if (route.toLowerCase().indexOf('http') === 0) {
|
||||
return route;
|
||||
}
|
||||
|
||||
return '/plugins/' + plugin.id + '/' + route;
|
||||
};
|
||||
|
||||
// TODO: replace with each plugin version
|
||||
var cacheParam = new Date().getTime();
|
||||
|
||||
self.mapPath = function (plugin, path, addCacheParam) {
|
||||
|
||||
if (typeof plugin === 'string') {
|
||||
plugin = plugins.filter(function (p) {
|
||||
return (p.id || p.packageName) === plugin;
|
||||
})[0];
|
||||
}
|
||||
|
||||
var url = plugin.baseUrl + '/' + path;
|
||||
|
||||
if (addCacheParam) {
|
||||
url += url.indexOf('?') === -1 ? '?' : '&';
|
||||
url += 'v=' + cacheParam;
|
||||
}
|
||||
|
||||
return url;
|
||||
};
|
||||
|
||||
function loadStrings(plugin, globalize) {
|
||||
var strings = plugin.getTranslations ? plugin.getTranslations() : [];
|
||||
return globalize.loadStrings({
|
||||
name: plugin.id || plugin.packageName,
|
||||
strings: strings
|
||||
});
|
||||
}
|
||||
|
||||
function definePluginRoute(route, plugin) {
|
||||
|
||||
route.contentPath = self.mapPath(plugin, route.path);
|
||||
route.path = self.mapRoute(plugin, route);
|
||||
|
||||
Emby.App.defineRoute(route, plugin.id);
|
||||
}
|
||||
|
||||
self.loadPlugin = function (url) {
|
||||
|
||||
console.log('Loading plugin: ' + url);
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
require([url, 'globalize'], function (pluginFactory, globalize) {
|
||||
|
||||
var plugin = new pluginFactory();
|
||||
|
||||
// See if it's already installed
|
||||
var existing = plugins.filter(function (p) {
|
||||
return p.id === plugin.id;
|
||||
})[0];
|
||||
|
||||
if (existing) {
|
||||
resolve(url);
|
||||
return;
|
||||
}
|
||||
|
||||
plugin.installUrl = url;
|
||||
|
||||
var urlLower = url.toLowerCase();
|
||||
if (urlLower.indexOf('http:') === -1 && urlLower.indexOf('https:') === -1 && urlLower.indexOf('file:') === -1) {
|
||||
if (url.indexOf(Emby.Page.baseUrl()) !== 0) {
|
||||
|
||||
url = Emby.Page.baseUrl() + '/' + url;
|
||||
}
|
||||
}
|
||||
|
||||
var separatorIndex = Math.max(url.lastIndexOf('/'), url.lastIndexOf('\\'));
|
||||
plugin.baseUrl = url.substring(0, separatorIndex);
|
||||
|
||||
var paths = {};
|
||||
paths[plugin.id] = plugin.baseUrl;
|
||||
|
||||
requirejs.config({
|
||||
waitSeconds: 0,
|
||||
paths: paths
|
||||
});
|
||||
|
||||
self.register(plugin);
|
||||
|
||||
if (plugin.getRoutes) {
|
||||
plugin.getRoutes().forEach(function (route) {
|
||||
definePluginRoute(route, plugin);
|
||||
});
|
||||
}
|
||||
|
||||
if (plugin.type === 'skin') {
|
||||
|
||||
// translations won't be loaded for skins until needed
|
||||
resolve(plugin);
|
||||
} else {
|
||||
|
||||
loadStrings(plugin, globalize).then(function () {
|
||||
resolve(plugin);
|
||||
}, reject);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
var instance = new pluginManager();
|
||||
window.Emby = window.Emby || {};
|
||||
window.Emby.PluginManager = instance;
|
||||
return instance;
|
||||
});
|
|
@ -1,4 +1,4 @@
|
|||
define(['serverNotifications', 'events', 'loading', 'connectionManager', 'imageLoader', 'dom', 'globalize', 'registrationServices', 'listViewStyle'], function (serverNotifications, events, loading, connectionManager, imageLoader, dom, globalize, registrationServices) {
|
||||
define(['serverNotifications', 'events', 'loading', 'connectionManager', 'imageLoader', 'dom', 'globalize', 'registrationServices', 'layoutManager', 'listViewStyle'], function (serverNotifications, events, loading, connectionManager, imageLoader, dom, globalize, registrationServices, layoutManager) {
|
||||
'use strict';
|
||||
|
||||
function onSyncJobsUpdated(e, apiClient, data) {
|
||||
|
@ -79,7 +79,16 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
|
|||
|
||||
var html = '';
|
||||
|
||||
html += '<div class="listItem" data-id="' + job.Id + '" data-status="' + job.Status + '">';
|
||||
var tagName = layoutManager.tv ? 'button' : 'div';
|
||||
var typeAttribute = tagName === 'button' ? ' type="button"' : '';
|
||||
|
||||
var listItemClass = 'listItem';
|
||||
|
||||
if (layoutManager.tv) {
|
||||
listItemClass += ' listItem-button listItem-focusscale';
|
||||
}
|
||||
|
||||
html += '<' + tagName + typeAttribute + ' class="' + listItemClass + '" data-id="' + job.Id + '" data-status="' + job.Status + '">';
|
||||
|
||||
var progress = job.Progress || 0;
|
||||
|
||||
|
@ -126,9 +135,11 @@ globalize.translate('sharedcomponents#CancelSyncJobConfirmation');
|
|||
|
||||
html += '</div>';
|
||||
|
||||
html += '<button type="button" is="paper-icon-button-light" class="btnJobMenu listItemButton"><i class="md-icon">more_vert</i></button>';
|
||||
if (!layoutManager.tv) {
|
||||
html += '<button type="button" is="paper-icon-button-light" class="btnJobMenu listItemButton"><i class="md-icon">more_vert</i></button>';
|
||||
}
|
||||
|
||||
html += '</div>';
|
||||
html += '</' + tagName + '>';
|
||||
|
||||
return html;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue