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

Merge pull request #755 from dmitrylyzo/native_select_server

Add server select support for NativeShell
This commit is contained in:
dkanada 2020-02-13 16:48:58 +09:00 committed by GitHub
commit c62976845e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 3 deletions

View file

@ -187,6 +187,9 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout
view.querySelector("#txtManualName").value = ""; view.querySelector("#txtManualName").value = "";
showManualForm(view, true); showManualForm(view, true);
}); });
view.querySelector(".btnSelectServer").addEventListener("click", function () {
Dashboard.selectServer();
});
view.addEventListener("viewshow", function (e) { view.addEventListener("viewshow", function (e) {
loading.show(); loading.show();

View file

@ -6,6 +6,10 @@ define(["apphost", "connectionManager", "listViewStyle", "emby-button"], functio
Dashboard.logout(); Dashboard.logout();
}); });
view.querySelector(".selectServer").addEventListener("click", function () {
Dashboard.selectServer();
});
view.addEventListener("viewshow", function() { view.addEventListener("viewshow", function() {
// this page can also be used by admins to change user preferences from the user edit page // this page can also be used by admins to change user preferences from the user edit page
var userId = params.userId || Dashboard.getCurrentUserId(); var userId = params.userId || Dashboard.getCurrentUserId();

View file

@ -47,9 +47,9 @@
<span>${ButtonForgotPassword}</span> <span>${ButtonForgotPassword}</span>
</button> </button>
<a is="emby-linkbutton" href="selectserver.html" class="raised block btnSelectServer"> <button is="emby-button" type="button" class="raised block btnSelectServer">
<span>${ButtonChangeServer}</span> <span>${ButtonChangeServer}</span>
</a> </button>
<p class="disclaimer" style="text-align: center; margin-top: 2em;"></p> <p class="disclaimer" style="text-align: center; margin-top: 2em;"></p>
</div> </div>

View file

@ -69,7 +69,7 @@
</div> </div>
<div class="userSection verticalSection verticalSection-extrabottompadding"> <div class="userSection verticalSection verticalSection-extrabottompadding">
<h2 class="sectionTitle" style="padding-left:.25em;">${HeaderUser}</h2> <h2 class="sectionTitle" style="padding-left:.25em;">${HeaderUser}</h2>
<a is="emby-linkbutton" data-ripple="false" href="selectserver.html" style="display:block;padding:0;margin:0;" class="selectServer hide listItem-border"> <a is="emby-linkbutton" data-ripple="false" href="#" style="display:block;padding:0;margin:0;" class="selectServer hide listItem-border">
<div class="listItem"> <div class="listItem">
<i class="material-icons listItemIcon listItemIcon-transparent">wifi</i> <i class="material-icons listItemIcon listItemIcon-transparent">wifi</i>
<div class="listItemBody"> <div class="listItemBody">

View file

@ -221,6 +221,13 @@ var Dashboard = {
}; };
appHost.getPushTokenInfo(); appHost.getPushTokenInfo();
return capabilities = Object.assign(capabilities, 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");
}
} }
}; };