1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Merge branch 'master' into synchronize-subtitles

This commit is contained in:
redSpoutnik 2019-04-30 20:58:51 +02:00 committed by GitHub
commit 4d8ec5b466
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
105 changed files with 2914 additions and 870 deletions

View file

@ -210,7 +210,7 @@ define(["connectionManager", "listView", "cardBuilder", "imageLoader", "libraryB
}
function getMoreItemsHref(item, type) {
return "Genre" == item.Type ? "list/list.html?type=" + type + "&genreId=" + item.Id + "&serverId=" + item.ServerId : "MusicGenre" == item.Type ? "list/list.html?type=" + type + "&musicGenreId=" + item.Id + "&serverId=" + item.ServerId : "Studio" == item.Type ? "list/list.html?type=" + type + "&studioId=" + item.Id + "&serverId=" + item.ServerId : "MusicArtist" == item.Type ? "list/list.html?type=" + type + "&artistId=" + item.Id + "&serverId=" + item.ServerId : "Person" == item.Type ? "list/list.html?type=" + type + "&personId=" + item.Id + "&serverId=" + item.ServerId : "list/list.html?type=" + type + "&parentId=" + item.Id + "&serverId=" + item.ServerId
return "Genre" == item.Type ? "list.html?type=" + type + "&genreId=" + item.Id + "&serverId=" + item.ServerId : "MusicGenre" == item.Type ? "list.html?type=" + type + "&musicGenreId=" + item.Id + "&serverId=" + item.ServerId : "Studio" == item.Type ? "list.html?type=" + type + "&studioId=" + item.Id + "&serverId=" + item.ServerId : "MusicArtist" == item.Type ? "list.html?type=" + type + "&artistId=" + item.Id + "&serverId=" + item.ServerId : "Person" == item.Type ? "list.html?type=" + type + "&personId=" + item.Id + "&serverId=" + item.ServerId : "list.html?type=" + type + "&parentId=" + item.Id + "&serverId=" + item.ServerId
}
function addCurrentItemToQuery(query, item) {

View file

@ -193,12 +193,11 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
html += "</div>";
}
html += '<div class="userMenuOptions">';
html += '<h3 class="sidebarHeader">';
html += globalize.translate("HeaderUser");
html += "</h3>";
if (user.localUser) {
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder lnkMySettings" href="mypreferencesmenu.html"><i class="md-icon navMenuOptionIcon">settings</i><span class="navMenuOptionText">' + globalize.translate("ButtonSettings") + "</span></a>";
html += '<div class="userMenuOptions">';
html += '<h3 class="sidebarHeader">';
html += globalize.translate("HeaderUser");
html += "</h3>";
if (appHost.supports("multiserver")) {
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder" data-itemid="selectserver" href="selectserver.html?showuser=1"><i class="md-icon navMenuOptionIcon">wifi</i><span class="navMenuOptionText">' + globalize.translate("ButtonSelectServer") + "</span></a>";
}
@ -308,7 +307,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
});
links.push({
name: globalize.translate("TabDevices"),
href: "devices/devices.html",
href: "devices.html",
pageIds: ["devicesPage", "devicePage"],
icon: "devices"
});
@ -362,7 +361,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
name: globalize.translate("TabPlugins"),
icon: "shopping_cart",
color: "#9D22B1",
href: "plugins.html",
href: "installedplugins.html",
pageIds: ["pluginsPage", "pluginCatalogPage"]
});
links.push({

View file

@ -45,7 +45,7 @@ define(["layoutManager", "loading", "cardBuilder", "apphost", "imageLoader", "sc
serverId = ApiClient.serverId();
switch (type) {
case "latest":
Dashboard.navigate("list/list.html?type=Recordings&serverId=" + serverId)
Dashboard.navigate("list.html?type=Recordings&serverId=" + serverId)
}
}
return function(view, params, tabContent) {

View file

@ -1,145 +0,0 @@
define(["loading", "libraryMenu", "dom", "globalize", "cardStyle", "emby-button"], function(loading, libraryMenu, dom, globalize) {
"use strict";
function deletePlugin(page, uniqueid, name) {
var msg = globalize.translate("UninstallPluginConfirmation").replace("{0}", name);
require(["confirm"], function(confirm) {
confirm({
title: globalize.translate("UninstallPluginHeader"),
text: msg,
primary: "cancel",
confirmText: globalize.translate("UninstallPluginHeader")
}).then(function() {
loading.show(), ApiClient.uninstallPlugin(uniqueid).then(function() {
reloadList(page)
})
})
})
}
function showNoConfigurationMessage() {
Dashboard.alert({
message: globalize.translate("NoPluginConfigurationMessage")
})
}
function showConnectMessage() {
Dashboard.alert({
message: globalize.translate("MessagePluginConfigurationRequiresLocalAccess")
})
}
function getPluginCardHtml(plugin, pluginConfigurationPages) {
var configPage = pluginConfigurationPages.filter(function(pluginConfigurationPage) {
return pluginConfigurationPage.PluginId == plugin.Id
})[0];
var configPageUrl = configPage ? Dashboard.getConfigurationPageUrl(configPage.Name) : null;
var html = "";
html += "<div data-id='" + plugin.Id + "' data-name='" + plugin.Name + "' class='card backdropCard'>";
html += '<div class="cardBox visualCardBox">';
html += '<div class="cardScalable">';
html += '<div class="cardPadder cardPadder-backdrop"></div>';
html += configPageUrl ? '<a class="cardContent cardImageContainer" is="emby-linkbutton" href="' + configPageUrl + '">' : '<div class="cardContent noConfigPluginCard noHoverEffect cardImageContainer">';
if (plugin.ImageUrl) {
html += '<div class="cardImage coveredImage" style="background-image:url(\'' + plugin.ImageUrl + "');\">";
html += "</div>";
} else {
html += '<i class="cardImageIcon md-icon">&#xE2C7;</i>';
}
html += configPageUrl ? "</a>" : "</div>";
html += "</div>";
html += '<div class="cardFooter">';
html += '<div style="text-align:right; float:right;padding-top:5px;">';
html += '<button type="button" is="paper-icon-button-light" class="btnCardMenu autoSize"><i class="md-icon">more_horiz</i></button>';
html += "</div>";
html += "<div class='cardText'>";
html += configPage ? configPage.DisplayName || plugin.Name : plugin.Name;
html += "</div>";
html += "<div class='cardText cardText-secondary'>";
html += plugin.Version;
html += "</div>";
html += "</div>";
html += "</div>";
html += "</div>";
return html;
}
function renderPlugins(page, plugins, showNoPluginsMessage) {
ApiClient.getJSON(ApiClient.getUrl("web/configurationpages") + "?pageType=PluginConfiguration").then(function(configPages) {
populateList(page, plugins, configPages, showNoPluginsMessage)
})
}
function populateList(page, plugins, pluginConfigurationPages, showNoPluginsMessage) {
plugins = plugins.sort(function(plugin1, plugin2) {
return plugin1.Name > plugin2.Name ? 1 : -1
});
var html = plugins.map(function(p) {
return getPluginCardHtml(p, pluginConfigurationPages)
}).join(""),
installedPluginsElement = page.querySelector(".installedPlugins");
installedPluginsElement.removeEventListener("click", onInstalledPluginsClick), installedPluginsElement.addEventListener("click", onInstalledPluginsClick), plugins.length ? (installedPluginsElement.classList.add("itemsContainer"), installedPluginsElement.classList.add("vertical-wrap"), installedPluginsElement.innerHTML = html) : (showNoPluginsMessage && (html += '<div style="padding:5px;">', html += "<p>" + globalize.translate("MessageNoPluginsInstalled") + "</p>", html += '<p><a is="emby-linkbutton" class="button-link" href="plugincatalog.html">', html += globalize.translate("BrowsePluginCatalogMessage"), html += "</a></p>", html += "</div>"), installedPluginsElement.innerHTML = html), loading.hide()
}
function showPluginMenu(page, elem) {
var card = dom.parentWithClass(elem, "card"),
id = card.getAttribute("data-id"),
name = card.getAttribute("data-name"),
configHref = card.querySelector(".cardContent").getAttribute("href"),
menuItems = [];
configHref && menuItems.push({
name: globalize.translate("ButtonSettings"),
id: "open",
ironIcon: "mode-edit"
}), menuItems.push({
name: globalize.translate("ButtonUninstall"),
id: "delete",
ironIcon: "delete"
}), require(["actionsheet"], function(actionsheet) {
actionsheet.show({
items: menuItems,
positionTo: elem,
callback: function(resultId) {
switch (resultId) {
case "open":
Dashboard.navigate(configHref);
break;
case "delete":
deletePlugin(page, id, name)
}
}
})
})
}
function reloadList(page) {
loading.show(), ApiClient.getInstalledPlugins().then(function(plugins) {
renderPlugins(page, plugins, !0)
})
}
function getTabs() {
return [{
href: "plugins.html",
name: globalize.translate("TabMyPlugins")
}, {
href: "plugincatalog.html",
name: globalize.translate("TabCatalog")
}]
}
function onInstalledPluginsClick(e) {
if (dom.parentWithClass(e.target, "noConfigPluginCard")) showNoConfigurationMessage();
else if (dom.parentWithClass(e.target, "connectModePluginCard")) showConnectMessage();
else {
var btnCardMenu = dom.parentWithClass(e.target, "btnCardMenu");
btnCardMenu && showPluginMenu(dom.parentWithClass(btnCardMenu, "page"), btnCardMenu)
}
}
pageIdOn("pageshow", "pluginsPage", function() {
libraryMenu.setTabs("plugins", 0, getTabs), reloadList(this)
}), window.PluginsPage = {
renderPlugins: renderPlugins
}
});

View file

@ -62,13 +62,13 @@ define([
controller: "dashboardhosting"
});
defineRoute({
path: "/devices/devices.html",
path: "/devices.html",
autoFocus: false,
roles: "admin",
controller: "devices"
});
defineRoute({
path: "/devices/device.html",
path: "/device.html",
autoFocus: false,
roles: "admin",
controller: "device"
@ -119,7 +119,7 @@ define([
type: "home"
});
defineRoute({
path: "/list/list.html",
path: "/list.html",
autoFocus: false,
controller: "list",
transition: "fade"
@ -284,15 +284,16 @@ define([
roles: "admin"
});
defineRoute({
path: "/plugincatalog.html",
path: "/availableplugins.html",
autoFocus: false,
roles: "admin",
controller: "plugincatalogpage"
controller: "availableplugins"
});
defineRoute({
path: "/plugins.html",
path: "/installedplugins.html",
autoFocus: false,
roles: "admin"
roles: "admin",
controller: "installedplugins"
});
defineRoute({
path: "/scheduledtask.html",

View file

@ -993,11 +993,11 @@ var AppInfo = {};
}
if ("nextup" === item) {
return "list/list.html?type=nextup&serverId=" + options.serverId;
return "list.html?type=nextup&serverId=" + options.serverId;
}
if ("list" === item) {
var url = "list/list.html?serverId=" + options.serverId + "&type=" + options.itemTypes;
var url = "list.html?serverId=" + options.serverId + "&type=" + options.itemTypes;
if (options.isFavorite) {
url += "&IsFavorite=true";
@ -1012,27 +1012,27 @@ var AppInfo = {};
}
if ("movies" === options.section) {
return "list/list.html?type=Programs&IsMovie=true&serverId=" + options.serverId;
return "list.html?type=Programs&IsMovie=true&serverId=" + options.serverId;
}
if ("shows" === options.section) {
return "list/list.html?type=Programs&IsSeries=true&IsMovie=false&IsNews=false&serverId=" + options.serverId;
return "list.html?type=Programs&IsSeries=true&IsMovie=false&IsNews=false&serverId=" + options.serverId;
}
if ("sports" === options.section) {
return "list/list.html?type=Programs&IsSports=true&serverId=" + options.serverId;
return "list.html?type=Programs&IsSports=true&serverId=" + options.serverId;
}
if ("kids" === options.section) {
return "list/list.html?type=Programs&IsKids=true&serverId=" + options.serverId;
return "list.html?type=Programs&IsKids=true&serverId=" + options.serverId;
}
if ("news" === options.section) {
return "list/list.html?type=Programs&IsNews=true&serverId=" + options.serverId;
return "list.html?type=Programs&IsNews=true&serverId=" + options.serverId;
}
if ("onnow" === options.section) {
return "list/list.html?type=Programs&IsAiring=true&serverId=" + options.serverId;
return "list.html?type=Programs&IsAiring=true&serverId=" + options.serverId;
}
if ("dvrschedule" === options.section) {
@ -1051,7 +1051,7 @@ var AppInfo = {};
}
if ("Genre" === item.Type) {
url = "list/list.html?genreId=" + item.Id + "&serverId=" + serverId;
url = "list.html?genreId=" + item.Id + "&serverId=" + serverId;
if ("livetv" === context) {
url += "&type=Programs";
@ -1065,7 +1065,7 @@ var AppInfo = {};
}
if ("MusicGenre" === item.Type) {
url = "list/list.html?musicGenreId=" + item.Id + "&serverId=" + serverId;
url = "list.html?musicGenreId=" + item.Id + "&serverId=" + serverId;
if (options.parentId) {
url += "&parentId=" + options.parentId;
@ -1075,7 +1075,7 @@ var AppInfo = {};
}
if ("Studio" === item.Type) {
url = "list/list.html?studioId=" + item.Id + "&serverId=" + serverId;
url = "list.html?studioId=" + item.Id + "&serverId=" + serverId;
if (options.parentId) {
url += "&parentId=" + options.parentId;
@ -1124,7 +1124,7 @@ var AppInfo = {};
if (item.IsFolder) {
if (id) {
return "list/list.html?parentId=" + id + "&serverId=" + serverId;
return "list.html?parentId=" + id + "&serverId=" + serverId;
}
return "#";