From 6978a9d9dfa9444622a17fa39ec24e751649e411 Mon Sep 17 00:00:00 2001 From: dkanada Date: Fri, 16 Aug 2019 00:25:31 -0700 Subject: [PATCH] clean up playback settings pages --- src/controllers/encodingsettings.js | 16 +++++++++++++++- src/controllers/playbackconfiguration.js | 7 ++++++- src/controllers/streamingsettings.js | 7 ++++++- src/encodingsettings.html | 7 ++----- src/playbackconfiguration.html | 8 +++----- src/scripts/librarymenu.js | 7 +------ src/streamingsettings.html | 6 ------ 7 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/controllers/encodingsettings.js b/src/controllers/encodingsettings.js index 20ca44ffad..a66c5a49a4 100644 --- a/src/controllers/encodingsettings.js +++ b/src/controllers/encodingsettings.js @@ -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"; 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") } + 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() { var page = this; 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) }).on("pageshow", "#encodingSettingsPage", function() { loading.show(); + libraryMenu.setTabs("playback", 0, getTabs); var page = this; ApiClient.getNamedConfiguration("encoding").then(function(config) { ApiClient.getSystemInfo().then(function(systemInfo) { diff --git a/src/controllers/playbackconfiguration.js b/src/controllers/playbackconfiguration.js index 64b1870183..35a780949d 100644 --- a/src/controllers/playbackconfiguration.js +++ b/src/controllers/playbackconfiguration.js @@ -15,6 +15,9 @@ define(["jQuery", "loading", "libraryMenu"], function($, loading, libraryMenu) { function getTabs() { return [{ + href: "encodingsettings.html", + name: Globalize.translate("Transcoding") + }, { href: "playbackconfiguration.html", name: Globalize.translate("TabResumeSettings") }, { @@ -22,10 +25,12 @@ define(["jQuery", "loading", "libraryMenu"], function($, loading, libraryMenu) { name: Globalize.translate("TabStreaming") }] } + $(document).on("pageinit", "#playbackConfigurationPage", function() { $(".playbackConfigurationForm").off("submit", onSubmit).on("submit", onSubmit) }).on("pageshow", "#playbackConfigurationPage", function() { - libraryMenu.setTabs("playback", 0, getTabs), loading.show(); + loading.show(); + libraryMenu.setTabs("playback", 1, getTabs); var page = this; ApiClient.getServerConfiguration().then(function(config) { loadPage(page, config) diff --git a/src/controllers/streamingsettings.js b/src/controllers/streamingsettings.js index 4295a2b421..6f19a68422 100644 --- a/src/controllers/streamingsettings.js +++ b/src/controllers/streamingsettings.js @@ -15,6 +15,9 @@ define(["jQuery", "libraryMenu", "loading"], function($, libraryMenu, loading) { function getTabs() { return [{ + href: "encodingsettings.html", + name: Globalize.translate("Transcoding") + }, { href: "playbackconfiguration.html", name: Globalize.translate("TabResumeSettings") }, { @@ -22,6 +25,7 @@ define(["jQuery", "libraryMenu", "loading"], function($, libraryMenu, loading) { name: Globalize.translate("TabStreaming") }] } + $(document).on("pageinit", "#streamingSettingsPage", function() { var page = this; $("#btnSelectTranscodingTempPath", page).on("click.selectDirectory", function() { @@ -38,7 +42,8 @@ define(["jQuery", "libraryMenu", "loading"], function($, libraryMenu, loading) { }) }), $(".streamingSettingsForm").off("submit", onSubmit).on("submit", onSubmit) }).on("pageshow", "#streamingSettingsPage", function() { - loading.show(), libraryMenu.setTabs("playback", 1, getTabs); + loading.show(); + libraryMenu.setTabs("playback", 2, getTabs); var page = this; ApiClient.getServerConfiguration().then(function(config) { loadPage(page, config) diff --git a/src/encodingsettings.html b/src/encodingsettings.html index c58fb109de..ade2d41715 100644 --- a/src/encodingsettings.html +++ b/src/encodingsettings.html @@ -1,10 +1,7 @@ -
- +
-
-

${TabTranscoding}

@@ -150,4 +147,4 @@
-
+
\ No newline at end of file diff --git a/src/playbackconfiguration.html b/src/playbackconfiguration.html index 98e302a5c3..81a42231e4 100644 --- a/src/playbackconfiguration.html +++ b/src/playbackconfiguration.html @@ -1,9 +1,10 @@
-
-
+
+

${TabResumeSettings}

+
@@ -22,9 +23,6 @@ ${LabelMinResumeDurationHelp}
- - -
diff --git a/src/scripts/librarymenu.js b/src/scripts/librarymenu.js index 0381fa2aa7..9c303d3bde 100644 --- a/src/scripts/librarymenu.js +++ b/src/scripts/librarymenu.js @@ -288,13 +288,8 @@ define(["dom", "layoutManager", "inputManager", "connectionManager", "events", " }, { name: globalize.translate("TabPlayback"), icon: "play_arrow", - href: "playbackconfiguration.html", - pageIds: ["playbackConfigurationPage", "streamingSettingsPage"] - }, { - name: globalize.translate("TabTranscoding"), - icon: "swap_horiz", href: "encodingsettings.html", - pageIds: ["encodingSettingsPage"] + pageIds: ["encodingSettingsPage", "playbackConfigurationPage", "streamingSettingsPage"] }]; addPluginPagesToMainMenu(links, pluginItems, "server"); links.push({ diff --git a/src/streamingsettings.html b/src/streamingsettings.html index 7130480beb..7efb4a3966 100644 --- a/src/streamingsettings.html +++ b/src/streamingsettings.html @@ -1,22 +1,16 @@
-
-
-

${TabStreaming}

- ${Help}
-
${LabelRemoteClientBitrateLimitHelp}
-