mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update branch with upstream
This commit is contained in:
commit
4fefa4f9b6
61 changed files with 20278 additions and 19332 deletions
|
@ -1,56 +0,0 @@
|
|||
define(["loading", "libraryMenu"], function(loading, libraryMenu) {
|
||||
"use strict";
|
||||
|
||||
function reloadList(page) {
|
||||
loading.show();
|
||||
var promise1 = ApiClient.getAvailablePlugins({
|
||||
TargetSystems: "Server"
|
||||
}),
|
||||
promise2 = ApiClient.getInstalledPlugins();
|
||||
Promise.all([promise1, promise2]).then(function(responses) {
|
||||
renderInstalled(page, responses[0], responses[1]), renderCatalog(page, responses[0], responses[1])
|
||||
})
|
||||
}
|
||||
|
||||
function getCategories() {
|
||||
var context = getParameterByName("context"),
|
||||
categories = [];
|
||||
return "sync" == context ? categories.push("Sync") : "livetv" == context ? categories.push("Live TV") : "notifications" == context && categories.push("Notifications"), categories
|
||||
}
|
||||
|
||||
function renderInstalled(page, availablePlugins, installedPlugins) {
|
||||
requirejs(["scripts/pluginspage"], function() {
|
||||
var category = getCategories()[0];
|
||||
installedPlugins = installedPlugins.filter(function(i) {
|
||||
var catalogEntry = availablePlugins.filter(function(a) {
|
||||
return (a.guid || "").toLowerCase() == (i.Id || "").toLowerCase()
|
||||
})[0];
|
||||
return !!catalogEntry && catalogEntry.category == category
|
||||
}), PluginsPage.renderPlugins(page, installedPlugins)
|
||||
})
|
||||
}
|
||||
|
||||
function renderCatalog(page, availablePlugins, installedPlugins) {
|
||||
requirejs(["scripts/plugincatalogpage"], function() {
|
||||
var categories = getCategories();
|
||||
PluginCatalog.renderCatalog({
|
||||
catalogElement: page.querySelector(".catalog"),
|
||||
availablePlugins: availablePlugins,
|
||||
installedPlugins: installedPlugins,
|
||||
categories: categories,
|
||||
showCategory: !1,
|
||||
context: getParameterByName("context"),
|
||||
targetSystem: "Server"
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
function onPageShow() {
|
||||
var page = this,
|
||||
context = getParameterByName("context");
|
||||
"sync" == context ? (libraryMenu.setTitle(Globalize.translate("TitleSync")), page.querySelector(".headerHelpButton").setAttribute("href", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Sync")) : "livetv" == context ? (libraryMenu.setTitle(Globalize.translate("TitleLiveTV")), page.querySelector(".headerHelpButton").setAttribute("href", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Live-TV")) : "notifications" == context && (libraryMenu.setTitle(Globalize.translate("TitleNotifications")), page.querySelector(".headerHelpButton").setAttribute("href", "https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications"))
|
||||
}
|
||||
pageIdOn("pagebeforeshow", "appServicesPage", onPageShow), pageIdOn("pageshow", "appServicesPage", onPageShow), pageIdOn("pageshow", "appServicesPage", function() {
|
||||
reloadList(this)
|
||||
})
|
||||
});
|
|
@ -4,8 +4,19 @@ define(["jQuery", "loading", "globalize", "dom"], function($, loading, globalize
|
|||
function loadPage(page, config, systemInfo) {
|
||||
Array.prototype.forEach.call(page.querySelectorAll(".chkDecodeCodec"), function(c) {
|
||||
c.checked = -1 !== (config.HardwareDecodingCodecs || []).indexOf(c.getAttribute("data-codec"))
|
||||
}), page.querySelector("#chkHardwareEncoding").checked = config.EnableHardwareEncoding, $("#selectVideoDecoder", page).val(config.HardwareAccelerationType), $("#selectThreadCount", page).val(config.EncodingThreadCount), $("#txtDownMixAudioBoost", page).val(config.DownMixAudioBoost), page.querySelector(".txtEncoderPath").value = config.EncoderAppPath || "", $("#txtTranscodingTempPath", page).val(config.TranscodingTempPath || ""), $("#txtVaapiDevice", page).val(config.VaapiDevice || ""), page.querySelector("#selectH264Preset").value = config.H264Preset || "", page.querySelector("#txtH264Crf").value = config.H264Crf || "", page.querySelector("#chkEnableSubtitleExtraction").checked = config.EnableSubtitleExtraction || !1, page.querySelector("#selectVideoDecoder").dispatchEvent(new CustomEvent("change", {
|
||||
bubbles: !0
|
||||
});
|
||||
page.querySelector("#chkHardwareEncoding").checked = config.EnableHardwareEncoding;
|
||||
$("#selectVideoDecoder", page).val(config.HardwareAccelerationType);
|
||||
$("#selectThreadCount", page).val(config.EncodingThreadCount);
|
||||
$("#txtDownMixAudioBoost", page).val(config.DownMixAudioBoost);
|
||||
page.querySelector(".txtEncoderPath").value = config.EncoderAppPathDisplay || "";
|
||||
$("#txtTranscodingTempPath", page).val(config.TranscodingTempPath || "");
|
||||
$("#txtVaapiDevice", page).val(config.VaapiDevice || "");
|
||||
page.querySelector("#selectH264Preset").value = config.H264Preset || "";
|
||||
page.querySelector("#txtH264Crf").value = config.H264Crf || "";
|
||||
page.querySelector("#chkEnableSubtitleExtraction").checked = config.EnableSubtitleExtraction || false;
|
||||
page.querySelector("#selectVideoDecoder").dispatchEvent(new CustomEvent("change", {
|
||||
bubbles: true
|
||||
})), loading.hide()
|
||||
}
|
||||
|
||||
|
@ -90,8 +101,8 @@ define(["jQuery", "loading", "globalize", "dom"], function($, loading, globalize
|
|||
var page = this;
|
||||
ApiClient.getNamedConfiguration("encoding").then(function(config) {
|
||||
ApiClient.getSystemInfo().then(function(systemInfo) {
|
||||
"External" == systemInfo.EncoderLocationType ? (page.querySelector(".fldEncoderPath").classList.add("hide"), page.querySelector(".txtEncoderPath").removeAttribute("required")) : (page.querySelector(".fldEncoderPath").classList.remove("hide"), page.querySelector(".txtEncoderPath").setAttribute("required", "required")), loadPage(page, config, systemInfo)
|
||||
loadPage(page, config, systemInfo);
|
||||
})
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
|
|
|
@ -189,6 +189,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
html += globalize.translate("HeaderAdmin");
|
||||
html += "</h3>";
|
||||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder lnkManageServer" data-itemid="dashboard" href="dashboard.html"><i class="md-icon navMenuOptionIcon">dashboard</i><span class="navMenuOptionText">' + globalize.translate("TabDashboard") + "</span></a>";
|
||||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder editorViewMenu" data-itemid="editor" href="edititemmetadata.html"><i class="md-icon navMenuOptionIcon">mode_edit</i><span class="navMenuOptionText">' + globalize.translate("Metadata") + "</span></a>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
|
@ -198,7 +199,9 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
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 += '<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>";
|
||||
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>";
|
||||
}
|
||||
if (!user.localUser.EnableAutoLogin) {
|
||||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder btnLogout" data-itemid="logout" href="#"><i class="md-icon navMenuOptionIcon">exit_to_app</i><span class="navMenuOptionText">' + globalize.translate("ButtonSignOut") + "</span></a>";
|
||||
}
|
||||
|
@ -271,7 +274,7 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
pageIds: ["dashboardPage", "serverActivityPage"],
|
||||
icon: "dashboard"
|
||||
}, {
|
||||
name: globalize.translate("TabSettings"),
|
||||
name: globalize.translate("General"),
|
||||
href: "dashboardgeneral.html",
|
||||
pageIds: ["dashboardGeneralPage"],
|
||||
icon: "settings"
|
||||
|
@ -297,11 +300,6 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
icon: "swap_horiz",
|
||||
href: "encodingsettings.html",
|
||||
pageIds: ["encodingSettingsPage"]
|
||||
}, {
|
||||
name: "Open Subtitles",
|
||||
href: "opensubtitles.html",
|
||||
pageIds: ["openSubtitlesPage"],
|
||||
icon: "closed_caption"
|
||||
}];
|
||||
addPluginPagesToMainMenu(links, pluginItems, "server");
|
||||
links.push({
|
||||
|
@ -373,12 +371,6 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
|
|||
pageIds: ["scheduledTasksPage", "scheduledTaskPage"],
|
||||
icon: "schedule"
|
||||
});
|
||||
links.push({
|
||||
name: globalize.translate("MetadataManager"),
|
||||
href: "edititemmetadata.html",
|
||||
pageIds: [],
|
||||
icon: "mode_edit"
|
||||
});
|
||||
addPluginPagesToMainMenu(links, pluginItems);
|
||||
return links;
|
||||
}
|
||||
|
|
|
@ -188,16 +188,6 @@ define(["jQuery", "globalize", "scripts/taskbutton", "dom", "libraryMenu", "layo
|
|||
Dashboard.navigate("livetvtuner.html")
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [{
|
||||
href: "livetvstatus.html",
|
||||
name: globalize.translate("TabDevices")
|
||||
}, {
|
||||
href: "appservices.html?context=livetv",
|
||||
name: globalize.translate("TabServices")
|
||||
}]
|
||||
}
|
||||
|
||||
function showDeviceMenu(button, tunerDeviceId) {
|
||||
var items = [];
|
||||
items.push({
|
||||
|
@ -240,7 +230,6 @@ define(["jQuery", "globalize", "scripts/taskbutton", "dom", "libraryMenu", "layo
|
|||
addProvider(this)
|
||||
}), page.querySelector(".devicesList").addEventListener("click", onDevicesListClick)
|
||||
}).on("pageshow", "#liveTvStatusPage", function() {
|
||||
libraryMenu.setTabs("livetvadmin", 0, getTabs);
|
||||
var page = this;
|
||||
reload(page), taskButton({
|
||||
mode: "on",
|
||||
|
|
|
@ -2,29 +2,59 @@ define(["loading", "libraryMenu", "globalize", "listViewStyle", "emby-linkbutton
|
|||
"use strict";
|
||||
|
||||
function reload(page) {
|
||||
loading.show(), ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list) {
|
||||
var html = "",
|
||||
lastCategory = "",
|
||||
showHelp = !0;
|
||||
html += list.map(function(i) {
|
||||
loading.show();
|
||||
ApiClient.getJSON(ApiClient.getUrl("Notifications/Types")).then(function(list) {
|
||||
var html = "";
|
||||
var lastCategory = "";
|
||||
var showHelp = true;
|
||||
html += list.map(function(notification) {
|
||||
var itemHtml = "";
|
||||
return i.Category != lastCategory && (lastCategory = i.Category, lastCategory && (itemHtml += "</div>", itemHtml += "</div>"), itemHtml += '<div class="verticalSection verticalSection-extrabottompadding">', itemHtml += '<div class="sectionTitleContainer" style="margin-bottom:1em;">', itemHtml += '<h2 class="sectionTitle">', itemHtml += i.Category, itemHtml += "</h2>", showHelp && (showHelp = !1, itemHtml += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications">' + globalize.translate("Help") + "</a>"), itemHtml += "</div>", itemHtml += '<div class="paperList">'), itemHtml += '<a class="listItem listItem-border" is="emby-linkbutton" data-ripple="false" href="notificationsetting.html?type=' + i.Type + '">', i.Enabled ? itemHtml += '<i class="listItemIcon md-icon">notifications_active</i>' : itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>', itemHtml += '<div class="listItemBody">', itemHtml += '<div class="listItemBodyText">' + i.Name + "</div>", itemHtml += "</div>", itemHtml += '<button type="button" is="paper-icon-button-light"><i class="md-icon">mode_edit</i></button>', itemHtml += "</a>"
|
||||
}).join(""), list.length && (html += "</div>", html += "</div>"), page.querySelector(".notificationList").innerHTML = html, loading.hide()
|
||||
if (notification.Category !== lastCategory) {
|
||||
lastCategory = notification.Category;
|
||||
if (lastCategory) {
|
||||
itemHtml += "</div>";
|
||||
itemHtml += "</div>";
|
||||
}
|
||||
itemHtml += '<div class="verticalSection verticalSection-extrabottompadding">';
|
||||
itemHtml += '<div class="sectionTitleContainer" style="margin-bottom:1em;">';
|
||||
itemHtml += '<h2 class="sectionTitle">';
|
||||
itemHtml += notification.Category;
|
||||
itemHtml += "</h2>";
|
||||
if (showHelp) {
|
||||
showHelp = false;
|
||||
itemHtml += '<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Notifications">';
|
||||
itemHtml += globalize.translate("Help");
|
||||
itemHtml += "</a>";
|
||||
}
|
||||
itemHtml += "</div>";
|
||||
itemHtml += '<div class="paperList">';
|
||||
}
|
||||
itemHtml += '<a class="listItem listItem-border" is="emby-linkbutton" data-ripple="false" href="notificationsetting.html?type=' + notification.Type + '">';
|
||||
if (notification.Enabled) {
|
||||
itemHtml += '<i class="listItemIcon md-icon">notifications_active</i>';
|
||||
} else {
|
||||
itemHtml += '<i class="listItemIcon md-icon" style="background-color:#999;">notifications_off</i>';
|
||||
}
|
||||
itemHtml += '<div class="listItemBody">';
|
||||
itemHtml += '<div class="listItemBodyText">' + notification.Name + "</div>";
|
||||
itemHtml += "</div>";
|
||||
itemHtml += '<button type="button" is="paper-icon-button-light"><i class="md-icon">mode_edit</i></button>';
|
||||
itemHtml += "</a>";
|
||||
return itemHtml;
|
||||
}).join("");
|
||||
|
||||
if (list.length) {
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
page.querySelector(".notificationList").innerHTML = html;
|
||||
loading.hide();
|
||||
})
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [{
|
||||
href: "notificationsettings.html",
|
||||
name: globalize.translate("TabNotifications")
|
||||
}, {
|
||||
href: "appservices.html?context=notifications",
|
||||
name: globalize.translate("TabServices")
|
||||
}]
|
||||
}
|
||||
return function(view, params) {
|
||||
view.addEventListener("viewshow", function() {
|
||||
libraryMenu.setTabs("notifications", 0, getTabs), reload(view)
|
||||
})
|
||||
reload(view);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
define(["loading", "fnchecked", "emby-linkbutton", "emby-input", "emby-checkbox", "emby-button"], function (loading) {
|
||||
"use strict";
|
||||
|
||||
function loadPage(page, config) {
|
||||
page.querySelector("#txtOpenSubtitleUsername").value = config.OpenSubtitlesUsername;
|
||||
page.querySelector("#txtOpenSubtitlePassword").value = config.OpenSubtitlesPasswordHash || "";
|
||||
loading.hide();
|
||||
}
|
||||
|
||||
function onSubmit(evt) {
|
||||
evt.preventDefault();
|
||||
loading.show();
|
||||
var form = this;
|
||||
ApiClient.getNamedConfiguration("subtitles").then(function (config) {
|
||||
config.OpenSubtitlesUsername = form.querySelector("#txtOpenSubtitleUsername").value;
|
||||
var newPassword = form.querySelector("#txtOpenSubtitlePassword").value;
|
||||
|
||||
if (newPassword) {
|
||||
config.OpenSubtitlesPasswordHash = newPassword;
|
||||
}
|
||||
|
||||
ApiClient.updateNamedConfiguration("subtitles", config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on("pageinit", "#openSubtitlesPage", function() {
|
||||
$(".metadataSubtitlesForm").off("submit", onSubmit).on("submit", onSubmit)
|
||||
}).on("pageshow", "#openSubtitlesPage", function() {
|
||||
loading.show();
|
||||
var page = this;
|
||||
ApiClient.getNamedConfiguration("subtitles").then(function (response) {
|
||||
loadPage(page, response);
|
||||
});
|
||||
});
|
||||
});
|
|
@ -41,84 +41,37 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
|||
if (!options.targetSystem || plugin.targetSystem == options.targetSystem) {
|
||||
return "UserInstalled" == plugin.type;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
availablePlugins = allPlugins.sort(function (a__e, b__r) {
|
||||
var aName = a__e.category;
|
||||
var bName = b__r.category;
|
||||
|
||||
if (aName > bName) {
|
||||
availablePlugins = allPlugins.sort(function (a, b) {
|
||||
if (a.category > b.category) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (bName > aName) {
|
||||
} else if (b.category > a.category) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
aName = a__e.name;
|
||||
bName = b__r.name;
|
||||
|
||||
if (aName > bName) {
|
||||
if (a.name > b.name) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (bName > aName) {
|
||||
} else if (b.name > a.name) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
var i__q;
|
||||
|
||||
var length;
|
||||
var plugin;
|
||||
var currentCategory;
|
||||
var html = "";
|
||||
|
||||
if (!options.categories) {
|
||||
currentCategory = globalize.translate("HeaderTopPlugins");
|
||||
html += '<div class="verticalSection">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">' + currentCategory + "</h2>";
|
||||
var topPlugins = allPlugins.slice(0).sort(function (a__t, b__y) {
|
||||
if (a__t.installs > b__y.installs) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (b__y.installs > a__t.installs) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
var aName = a__t.name;
|
||||
var bName = b__y.name;
|
||||
|
||||
if (aName > bName) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (bName > aName) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
});
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
var limit = screen.availWidth >= 1920 ? 15 : 12;
|
||||
|
||||
for (i__q = 0, length = Math.min(topPlugins.length, limit); i__q < length; i__q++) {
|
||||
html += getPluginHtml(topPlugins[i__q], options, installedPlugins);
|
||||
}
|
||||
|
||||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
var hasOpenTag = false;
|
||||
|
||||
for (currentCategory = null, false === options.showCategory && (html += '<div class="itemsContainer vertical-wrap">', hasOpenTag = true), i__q = 0, length = availablePlugins.length; i__q < length; i__q++) {
|
||||
plugin = availablePlugins[i__q];
|
||||
currentCategory = null;
|
||||
if (options.showCategory === false) {
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
hasOpenTag = true;
|
||||
}
|
||||
for (var i = 0; i < availablePlugins.length; i++) {
|
||||
plugin = availablePlugins[i];
|
||||
var category = plugin.categoryDisplayName;
|
||||
|
||||
if (category != currentCategory) {
|
||||
|
@ -128,16 +81,13 @@ define(["loading", "libraryMenu", "globalize", "cardStyle", "emby-linkbutton", "
|
|||
html += "</div>";
|
||||
html += "</div>";
|
||||
}
|
||||
|
||||
html += '<div class="verticalSection">';
|
||||
html += '<h2 class="sectionTitle sectionTitle-cards">' + category + "</h2>";
|
||||
html += '<div class="itemsContainer vertical-wrap">';
|
||||
hasOpenTag = true;
|
||||
}
|
||||
|
||||
currentCategory = category;
|
||||
}
|
||||
|
||||
html += getPluginHtml(plugin, options, installedPlugins);
|
||||
}
|
||||
|
||||
|
|
|
@ -644,12 +644,6 @@ var AppInfo = {};
|
|||
roles: "admin",
|
||||
controller: "scripts/addpluginpage"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/appservices.html",
|
||||
dependencies: [],
|
||||
autoFocus: false,
|
||||
roles: "admin"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/autoorganizelog.html",
|
||||
dependencies: [],
|
||||
|
@ -739,12 +733,6 @@ var AppInfo = {};
|
|||
autoFocus: false,
|
||||
roles: "admin"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/opensubtitles.html",
|
||||
dependencies: [],
|
||||
autoFocus: false,
|
||||
roles: "admin"
|
||||
});
|
||||
defineRoute({
|
||||
path: "/forgotpassword.html",
|
||||
dependencies: ["emby-input", "emby-button"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue