mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
wizardremoteaccess.js
This commit is contained in:
parent
3464b847a6
commit
f9b6b10ef4
1 changed files with 24 additions and 16 deletions
|
@ -1,31 +1,39 @@
|
||||||
define(["loading", "emby-checkbox", "emby-button", "emby-select"], function(loading) {
|
define(["loading", "emby-checkbox", "emby-button", "emby-select"], function (loading) {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function save(page) {
|
function save(page) {
|
||||||
loading.show();
|
loading.show();
|
||||||
var apiClient = ApiClient,
|
var apiClient = ApiClient;
|
||||||
config = {};
|
var config = {};
|
||||||
config.EnableRemoteAccess = page.querySelector("#chkRemoteAccess").checked, config.EnableAutomaticPortMapping = page.querySelector("#chkEnableUpnp").checked, apiClient.ajax({
|
config.EnableRemoteAccess = page.querySelector("#chkRemoteAccess").checked;
|
||||||
|
config.EnableAutomaticPortMapping = page.querySelector("#chkEnableUpnp").checked;
|
||||||
|
apiClient.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
data: config,
|
data: config,
|
||||||
url: apiClient.getUrl("Startup/RemoteAccess")
|
url: apiClient.getUrl("Startup/RemoteAccess")
|
||||||
}).then(function() {
|
}).then(function () {
|
||||||
loading.hide(), navigateToNextPage()
|
loading.hide();
|
||||||
})
|
navigateToNextPage();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function navigateToNextPage() {
|
function navigateToNextPage() {
|
||||||
Dashboard.navigate("wizardfinish.html")
|
Dashboard.navigate("wizardfinish.html");
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit(e) {
|
function onSubmit(e) {
|
||||||
return save(this), e.preventDefault(), !1
|
save(this);
|
||||||
}
|
e.preventDefault();
|
||||||
return function(view, params) {
|
return false;
|
||||||
view.querySelector(".wizardSettingsForm").addEventListener("submit", onSubmit), view.addEventListener("viewshow", function() {
|
|
||||||
document.querySelector(".skinHeader").classList.add("noHomeButtonHeader")
|
|
||||||
}), view.addEventListener("viewhide", function() {
|
|
||||||
document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return function (view, params) {
|
||||||
|
view.querySelector(".wizardSettingsForm").addEventListener("submit", onSubmit);
|
||||||
|
view.addEventListener("viewshow", function () {
|
||||||
|
document.querySelector(".skinHeader").classList.add("noHomeButtonHeader");
|
||||||
|
});
|
||||||
|
view.addEventListener("viewhide", function () {
|
||||||
|
document.querySelector(".skinHeader").classList.remove("noHomeButtonHeader");
|
||||||
|
});
|
||||||
|
};
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue