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
|
@ -34,6 +34,7 @@
|
||||||
- [Ryan Hartzell](https://github.com/ryan-hartzell)
|
- [Ryan Hartzell](https://github.com/ryan-hartzell)
|
||||||
- [Thibault Nocchi](https://github.com/ThibaultNocchi)
|
- [Thibault Nocchi](https://github.com/ThibaultNocchi)
|
||||||
- [MrTimscampi](https://github.com/MrTimscampi)
|
- [MrTimscampi](https://github.com/MrTimscampi)
|
||||||
|
- [ConfusedPolarBear](https://github.com/ConfusedPolarBear)
|
||||||
|
|
||||||
# Emby Contributors
|
# Emby Contributors
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,14 @@ define(['require', 'apphost', 'layoutManager', 'focusManager', 'globalize', 'loa
|
||||||
}
|
}
|
||||||
|
|
||||||
function list(apiClient) {
|
function list(apiClient) {
|
||||||
|
console.debug("getting json");
|
||||||
|
apiClient.getJSON("/QuickConnect/List").then(json => {
|
||||||
var elem = $("#quickConnectIncoming");
|
var elem = $("#quickConnectIncoming");
|
||||||
elem.html("");
|
elem.html("");
|
||||||
apiClient.getJSON("/QuickConnect/List").then(json => {
|
console.debug("raw json", json, "length is", json.length);
|
||||||
console.debug("raw json", json);
|
|
||||||
for(var i = 0; i < json.length; i++) {
|
for(var i = 0; i < json.length; i++) {
|
||||||
var current = json[i];
|
var current = json[i];
|
||||||
|
console.debug("current is", current);
|
||||||
var html = "<li>" + current.Code + " - " + current.FriendlyName + " - ";
|
var html = "<li>" + current.Code + " - " + current.FriendlyName + " - ";
|
||||||
|
|
||||||
if(!current.Authenticated) {
|
if(!current.Authenticated) {
|
||||||
|
|
|
@ -2,12 +2,14 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked"], function ($, loading,
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function loadPage(page, status) {
|
function loadPage(page, status) {
|
||||||
|
console.debug("status is \"" + status + "\"");
|
||||||
|
|
||||||
var active = (status == "Active");
|
var active = (status == "Active");
|
||||||
var available = (status == "Available") || active;
|
var available = (status == "Available") || active;
|
||||||
|
|
||||||
$("#quickConnectStatus").text(status.toLocaleLowerCase());
|
page.querySelector("#quickConnectStatus").textContent = status.toLocaleLowerCase();
|
||||||
$("#chkQuickConnectAvailable").checked(available);
|
page.querySelector("#chkQuickConnectAvailable").checked = available;
|
||||||
$("#chkQuickConnectActive").checked(active);
|
page.querySelector("#chkQuickConnectActive").checked = active;
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
}
|
}
|
||||||
|
@ -44,8 +46,8 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked"], function ($, loading,
|
||||||
}
|
}
|
||||||
|
|
||||||
$(document).on("pageinit", "#quickConnectPage", function () {
|
$(document).on("pageinit", "#quickConnectPage", function () {
|
||||||
$("#quickConnectPage").off("submit", onSubmit).on("submit", onSubmit);
|
document.querySelector("#quickConnectPage").onsubmit = onSubmit;
|
||||||
$("#btnQuickConnectSubmit").click(onSubmit);
|
document.querySelector("#btnQuickConnectSubmit").onclick = onSubmit;
|
||||||
}).on("pageshow", "#quickConnectPage", function () {
|
}).on("pageshow", "#quickConnectPage", function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
|
@ -2,6 +2,13 @@ define(["quickConnectSettings", "dom", "globalize", "loading", "userSettings", "
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
return function (view, params) {
|
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 quickConnectSettingsInstance = null;
|
||||||
var hasChanges;
|
var hasChanges;
|
||||||
var userId = params.userId || ApiClient.getCurrentUserId();
|
var userId = params.userId || ApiClient.getCurrentUserId();
|
||||||
|
@ -9,6 +16,8 @@ define(["quickConnectSettings", "dom", "globalize", "loading", "userSettings", "
|
||||||
view.addEventListener("viewshow", function () {
|
view.addEventListener("viewshow", function () {
|
||||||
console.debug("defining instance");
|
console.debug("defining instance");
|
||||||
|
|
||||||
|
$("#btnQuickConnectActivate").click(notImplemented);
|
||||||
|
|
||||||
quickConnectSettingsInstance = new QuickConnectSettings({
|
quickConnectSettingsInstance = new QuickConnectSettings({
|
||||||
serverId: ApiClient.serverId(),
|
serverId: ApiClient.serverId(),
|
||||||
userId: userId,
|
userId: userId,
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div id="quickConnectPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage noSecondaryNavPage" data-title="${HeaderHome}" data-backbutton="true">
|
<div id="quickConnectPreferencesPage" data-role="page" class="page libraryPage userPreferencesPage noSecondaryNavPage" data-title="${HeaderHome}" data-backbutton="true">
|
||||||
<button is="emby-button" id="btnQuickConnectActivate" type="button" class="raised button-submit block" disabled>
|
<button is="emby-button" id="btnQuickConnectActivate" type="button" class="raised button-submit block">
|
||||||
<span>Activate</span>
|
<span>Activate</span>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
</label>
|
</label>
|
||||||
<label>
|
<label>
|
||||||
<input type="checkbox" is="emby-checkbox" id="chkQuickConnectActive" />
|
<input type="checkbox" is="emby-checkbox" id="chkQuickConnectActive" />
|
||||||
<span>Always accept quick connect login requests</span>
|
<span>Make quick connect always active (always accept login requests)</span>
|
||||||
</label>
|
</label>
|
||||||
<div class="fieldDescription checkboxFieldDescription">If unchecked, users will have to click the Activate button in their profile before initiating a quick connect login.</div>
|
<div class="fieldDescription checkboxFieldDescription">If unchecked, users will have to click the Activate button in their profile before initiating a quick connect login.</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue