mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Switch off of jQuery
This commit is contained in:
parent
fa9e2b476b
commit
fdfdcd60fe
8 changed files with 35 additions and 21 deletions
|
@ -153,10 +153,10 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout
|
|||
function loginQuickConnect() {
|
||||
var apiClient = getApiClient();
|
||||
var friendlyName = "test";
|
||||
|
||||
var url = apiClient.getUrl("/QuickConnect/Initiate?FriendlyName=" + friendlyName);
|
||||
apiClient.getJSON(url)
|
||||
.then(json => {
|
||||
|
||||
var url = apiClient.getUrl("/QuickConnect/Initiate?FriendlyName=" + friendlyName);
|
||||
apiClient.getJSON(url)
|
||||
.then(json => {
|
||||
if (!json.Secret || !json.Code) {
|
||||
Dashboard.alert({
|
||||
message: json.Error,
|
||||
|
@ -173,9 +173,9 @@ define(["apphost", "appSettings", "dom", "connectionManager", "loading", "layout
|
|||
loading.show();
|
||||
|
||||
var interval = setInterval(() => {
|
||||
var url = apiClient.getUrl('/QuickConnect/Connect?Secret=' + json.Secret);
|
||||
var url = apiClient.getUrl('/QuickConnect/Connect?Secret=' + json.Secret);
|
||||
apiClient.getJSON(url)
|
||||
.then(data => {
|
||||
.then(data => {
|
||||
if(data.Authenticated) {
|
||||
apiClient.quickConnect(data.Authentication).then((result) => {
|
||||
var user = result.User;
|
||||
|
|
|
@ -2,13 +2,15 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked"], function ($, loading,
|
|||
"use strict";
|
||||
|
||||
function loadPage(page, status) {
|
||||
console.debug("status is \"" + status + "\"");
|
||||
|
||||
var active = (status == "Active");
|
||||
var available = (status == "Available") || active;
|
||||
|
||||
$("#quickConnectStatus").text(status.toLocaleLowerCase());
|
||||
$("#chkQuickConnectAvailable").checked(available);
|
||||
$("#chkQuickConnectActive").checked(active);
|
||||
|
||||
|
||||
page.querySelector("#quickConnectStatus").textContent = status.toLocaleLowerCase();
|
||||
page.querySelector("#chkQuickConnectAvailable").checked = available;
|
||||
page.querySelector("#chkQuickConnectActive").checked = active;
|
||||
|
||||
loading.hide();
|
||||
}
|
||||
|
||||
|
@ -44,8 +46,8 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked"], function ($, loading,
|
|||
}
|
||||
|
||||
$(document).on("pageinit", "#quickConnectPage", function () {
|
||||
$("#quickConnectPage").off("submit", onSubmit).on("submit", onSubmit);
|
||||
$("#btnQuickConnectSubmit").click(onSubmit);
|
||||
document.querySelector("#quickConnectPage").onsubmit = onSubmit;
|
||||
document.querySelector("#btnQuickConnectSubmit").onclick = onSubmit;
|
||||
}).on("pageshow", "#quickConnectPage", function () {
|
||||
loading.show();
|
||||
var page = this;
|
||||
|
|
|
@ -24,7 +24,7 @@ define(["apphost", "connectionManager", "layoutManager", "listViewStyle", "emby-
|
|||
page.querySelector(".lnkHomePreferences").setAttribute("href", "mypreferenceshome.html?userId=" + userId);
|
||||
page.querySelector(".lnkPlaybackPreferences").setAttribute("href", "mypreferencesplayback.html?userId=" + userId);
|
||||
page.querySelector(".lnkSubtitlePreferences").setAttribute("href", "mypreferencessubtitles.html?userId=" + userId);
|
||||
page.querySelector(".lnkQuickConnectPreferences").setAttribute("href", "mypreferencesquickconnect.html?userId=" + userId);
|
||||
page.querySelector(".lnkQuickConnectPreferences").setAttribute("href", "mypreferencesquickconnect.html?userId=" + userId);
|
||||
|
||||
if (window.NativeShell && window.NativeShell.AppHost.supports("clientsettings")) {
|
||||
page.querySelector(".clientSettings").classList.remove("hide");
|
||||
|
|
|
@ -2,6 +2,13 @@ define(["quickConnectSettings", "dom", "globalize", "loading", "userSettings", "
|
|||
"use strict";
|
||||
|
||||
return function (view, params) {
|
||||
function notImplemented() {
|
||||
Dashboard.alert({
|
||||
message: "This button is not implemented yet, you must check the checkbox labeled \"Always accept quick connect login requests\" in the dashboard",
|
||||
title: "Not implemented"
|
||||
});
|
||||
}
|
||||
|
||||
var quickConnectSettingsInstance = null;
|
||||
var hasChanges;
|
||||
var userId = params.userId || ApiClient.getCurrentUserId();
|
||||
|
@ -9,6 +16,8 @@ define(["quickConnectSettings", "dom", "globalize", "loading", "userSettings", "
|
|||
view.addEventListener("viewshow", function () {
|
||||
console.debug("defining instance");
|
||||
|
||||
$("#btnQuickConnectActivate").click(notImplemented);
|
||||
|
||||
quickConnectSettingsInstance = new QuickConnectSettings({
|
||||
serverId: ApiClient.serverId(),
|
||||
userId: userId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue