clean up playback settings pages

This commit is contained in:
dkanada 2019-08-16 00:25:31 -07:00
parent 8bec0ad63d
commit 6978a9d9df
7 changed files with 33 additions and 25 deletions

View File

@ -1,4 +1,4 @@
define(["jQuery", "loading", "globalize", "dom"], function($, loading, globalize, dom) { define(["jQuery", "loading", "globalize", "dom", "libraryMenu"], function($, loading, globalize, dom, libraryMenu) {
"use strict"; "use strict";
function loadPage(page, config, systemInfo) { function loadPage(page, config, systemInfo) {
@ -70,6 +70,19 @@ define(["jQuery", "loading", "globalize", "dom"], function($, loading, globalize
}), any ? context.querySelector(".decodingCodecsList").classList.remove("hide") : context.querySelector(".decodingCodecsList").classList.add("hide") }), any ? context.querySelector(".decodingCodecsList").classList.remove("hide") : context.querySelector(".decodingCodecsList").classList.add("hide")
} }
function getTabs() {
return [{
href: "encodingsettings.html",
name: Globalize.translate("Transcoding")
}, {
href: "playbackconfiguration.html",
name: Globalize.translate("TabResumeSettings")
}, {
href: "streamingsettings.html",
name: Globalize.translate("TabStreaming")
}]
}
$(document).on("pageinit", "#encodingSettingsPage", function() { $(document).on("pageinit", "#encodingSettingsPage", function() {
var page = this; var page = this;
page.querySelector("#selectVideoDecoder").addEventListener("change", function() { page.querySelector("#selectVideoDecoder").addEventListener("change", function() {
@ -99,6 +112,7 @@ define(["jQuery", "loading", "globalize", "dom"], function($, loading, globalize
}), $(".encodingSettingsForm").off("submit", onSubmit).on("submit", onSubmit) }), $(".encodingSettingsForm").off("submit", onSubmit).on("submit", onSubmit)
}).on("pageshow", "#encodingSettingsPage", function() { }).on("pageshow", "#encodingSettingsPage", function() {
loading.show(); loading.show();
libraryMenu.setTabs("playback", 0, getTabs);
var page = this; var page = this;
ApiClient.getNamedConfiguration("encoding").then(function(config) { ApiClient.getNamedConfiguration("encoding").then(function(config) {
ApiClient.getSystemInfo().then(function(systemInfo) { ApiClient.getSystemInfo().then(function(systemInfo) {

View File

@ -15,6 +15,9 @@ define(["jQuery", "loading", "libraryMenu"], function($, loading, libraryMenu) {
function getTabs() { function getTabs() {
return [{ return [{
href: "encodingsettings.html",
name: Globalize.translate("Transcoding")
}, {
href: "playbackconfiguration.html", href: "playbackconfiguration.html",
name: Globalize.translate("TabResumeSettings") name: Globalize.translate("TabResumeSettings")
}, { }, {
@ -22,10 +25,12 @@ define(["jQuery", "loading", "libraryMenu"], function($, loading, libraryMenu) {
name: Globalize.translate("TabStreaming") name: Globalize.translate("TabStreaming")
}] }]
} }
$(document).on("pageinit", "#playbackConfigurationPage", function() { $(document).on("pageinit", "#playbackConfigurationPage", function() {
$(".playbackConfigurationForm").off("submit", onSubmit).on("submit", onSubmit) $(".playbackConfigurationForm").off("submit", onSubmit).on("submit", onSubmit)
}).on("pageshow", "#playbackConfigurationPage", function() { }).on("pageshow", "#playbackConfigurationPage", function() {
libraryMenu.setTabs("playback", 0, getTabs), loading.show(); loading.show();
libraryMenu.setTabs("playback", 1, getTabs);
var page = this; var page = this;
ApiClient.getServerConfiguration().then(function(config) { ApiClient.getServerConfiguration().then(function(config) {
loadPage(page, config) loadPage(page, config)

View File

@ -15,6 +15,9 @@ define(["jQuery", "libraryMenu", "loading"], function($, libraryMenu, loading) {
function getTabs() { function getTabs() {
return [{ return [{
href: "encodingsettings.html",
name: Globalize.translate("Transcoding")
}, {
href: "playbackconfiguration.html", href: "playbackconfiguration.html",
name: Globalize.translate("TabResumeSettings") name: Globalize.translate("TabResumeSettings")
}, { }, {
@ -22,6 +25,7 @@ define(["jQuery", "libraryMenu", "loading"], function($, libraryMenu, loading) {
name: Globalize.translate("TabStreaming") name: Globalize.translate("TabStreaming")
}] }]
} }
$(document).on("pageinit", "#streamingSettingsPage", function() { $(document).on("pageinit", "#streamingSettingsPage", function() {
var page = this; var page = this;
$("#btnSelectTranscodingTempPath", page).on("click.selectDirectory", function() { $("#btnSelectTranscodingTempPath", page).on("click.selectDirectory", function() {
@ -38,7 +42,8 @@ define(["jQuery", "libraryMenu", "loading"], function($, libraryMenu, loading) {
}) })
}), $(".streamingSettingsForm").off("submit", onSubmit).on("submit", onSubmit) }), $(".streamingSettingsForm").off("submit", onSubmit).on("submit", onSubmit)
}).on("pageshow", "#streamingSettingsPage", function() { }).on("pageshow", "#streamingSettingsPage", function() {
loading.show(), libraryMenu.setTabs("playback", 1, getTabs); loading.show();
libraryMenu.setTabs("playback", 2, getTabs);
var page = this; var page = this;
ApiClient.getServerConfiguration().then(function(config) { ApiClient.getServerConfiguration().then(function(config) {
loadPage(page, config) loadPage(page, config)

View File

@ -1,10 +1,7 @@
<div id="encodingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage"> <div id="encodingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs">
<div> <div>
<div class="content-primary"> <div class="content-primary">
<form class="encodingSettingsForm"> <form class="encodingSettingsForm">
<div class="verticalSection"> <div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center"> <div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${TabTranscoding}</h2> <h2 class="sectionTitle">${TabTranscoding}</h2>

View File

@ -1,9 +1,10 @@
<div id="playbackConfigurationPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs"> <div id="playbackConfigurationPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs">
<div> <div>
<div class="content-primary"> <div class="content-primary">
<form class="playbackConfigurationForm"> <form class="playbackConfigurationForm">
<div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${TabResumeSettings}</h2>
</div>
<div class="inputContainer"> <div class="inputContainer">
<input is="emby-input" type="number" id="txtMinResumePct" name="txtMinResumePct" pattern="[0-9]*" required min="0" max="100" label="${LabelMinResumePercentage}"></input> <input is="emby-input" type="number" id="txtMinResumePct" name="txtMinResumePct" pattern="[0-9]*" required min="0" max="100" label="${LabelMinResumePercentage}"></input>
<div class="fieldDescription"> <div class="fieldDescription">
@ -22,9 +23,6 @@
${LabelMinResumeDurationHelp} ${LabelMinResumeDurationHelp}
</div> </div>
</div> </div>
<br />
<div><button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button></div> <div><button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button></div>
</form> </form>
</div> </div>

View File

@ -288,13 +288,8 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", "
}, { }, {
name: globalize.translate("TabPlayback"), name: globalize.translate("TabPlayback"),
icon: "play_arrow", icon: "play_arrow",
href: "playbackconfiguration.html",
pageIds: ["playbackConfigurationPage", "streamingSettingsPage"]
}, {
name: globalize.translate("TabTranscoding"),
icon: "swap_horiz",
href: "encodingsettings.html", href: "encodingsettings.html",
pageIds: ["encodingSettingsPage"] pageIds: ["encodingSettingsPage", "playbackConfigurationPage", "streamingSettingsPage"]
}]; }];
addPluginPagesToMainMenu(links, pluginItems, "server"); addPluginPagesToMainMenu(links, pluginItems, "server");
links.push({ links.push({

View File

@ -1,22 +1,16 @@
<div id="streamingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs"> <div id="streamingSettingsPage" data-role="page" class="page type-interior playbackConfigurationPage withTabs">
<div> <div>
<div class="content-primary"> <div class="content-primary">
<form class="streamingSettingsForm"> <form class="streamingSettingsForm">
<div class="verticalSection"> <div class="verticalSection">
<div class="sectionTitleContainer flex align-items-center"> <div class="sectionTitleContainer flex align-items-center">
<h2 class="sectionTitle">${TabStreaming}</h2> <h2 class="sectionTitle">${TabStreaming}</h2>
<a is="emby-linkbutton" class="raised button-alt headerHelpButton" target="_blank" href="https://web.archive.org/web/20181216120305/https://github.com/MediaBrowser/Wiki/wiki/Streaming">${Help}</a>
</div> </div>
<div class="inputContainer"> <div class="inputContainer">
<input is="emby-input" type="number" id="txtRemoteClientBitrateLimit" pattern="[0-9]*" min="0" step=".25" label="${LabelRemoteClientBitrateLimit}" /> <input is="emby-input" type="number" id="txtRemoteClientBitrateLimit" pattern="[0-9]*" min="0" step=".25" label="${LabelRemoteClientBitrateLimit}" />
<div class="fieldDescription">${LabelRemoteClientBitrateLimitHelp}</div> <div class="fieldDescription">${LabelRemoteClientBitrateLimitHelp}</div>
</div> </div>
</div> </div>
<button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button> <button is="emby-button" type="submit" class="raised button-submit block"><span>${ButtonSave}</span></button>
</form> </form>
</div> </div>