From 6d6cce02afba784ee778e56b3a0a07761dea02e0 Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Sat, 1 Feb 2020 23:55:07 +0300 Subject: [PATCH] Add server select support for NativeShell --- src/controllers/auth/login.js | 3 +++ src/controllers/user/menu.js | 4 ++++ src/login.html | 4 ++-- src/mypreferencesmenu.html | 2 +- src/scripts/site.js | 7 +++++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/src/controllers/auth/login.js b/src/controllers/auth/login.js index ceecb2aba3..4296b8bfb3 100644 --- a/src/controllers/auth/login.js +++ b/src/controllers/auth/login.js @@ -187,6 +187,9 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout view.querySelector("#txtManualName").value = ""; showManualForm(view, true); }); + view.querySelector(".btnSelectServer").addEventListener("click", function () { + Dashboard.selectServer(); + }); view.addEventListener("viewshow", function (e) { loading.show(); diff --git a/src/controllers/user/menu.js b/src/controllers/user/menu.js index 4e0a7824b7..6087beadfe 100644 --- a/src/controllers/user/menu.js +++ b/src/controllers/user/menu.js @@ -6,6 +6,10 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-button"], functio Dashboard.logout(); }); + view.querySelector(".selectServer").addEventListener("click", function () { + Dashboard.selectServer(); + }); + view.addEventListener("viewshow", function() { // this page can also be used by admins to change user preferences from the user edit page var userId = params.userId || Dashboard.getCurrentUserId(); diff --git a/src/login.html b/src/login.html index 21c9d8a347..955ce3879e 100644 --- a/src/login.html +++ b/src/login.html @@ -47,9 +47,9 @@ ${ButtonForgotPassword} - +

diff --git a/src/mypreferencesmenu.html b/src/mypreferencesmenu.html index 96e9626899..cb63322f31 100644 --- a/src/mypreferencesmenu.html +++ b/src/mypreferencesmenu.html @@ -69,7 +69,7 @@

${HeaderUser}

- +
wifi
diff --git a/src/scripts/site.js b/src/scripts/site.js index 3a10dc85a1..c34b3e475d 100644 --- a/src/scripts/site.js +++ b/src/scripts/site.js @@ -221,6 +221,13 @@ var Dashboard = { }; appHost.getPushTokenInfo(); return capabilities = Object.assign(capabilities, appHost.getPushTokenInfo()); + }, + selectServer: function () { + if (window.NativeShell && typeof window.NativeShell.selectServer === "function") { + window.NativeShell.selectServer(); + } else { + Dashboard.navigate("selectserver.html"); + } } };