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

32 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-10-23 01:05:09 +03:00
define(["loading", "emby-checkbox", "emby-button", "emby-select"], function(loading) {
"use strict";
function save(page) {
loading.show();
var apiClient = ApiClient,
config = {};
config.EnableRemoteAccess = page.querySelector("#chkRemoteAccess").checked, config.EnableAutomaticPortMapping = page.querySelector("#chkEnableUpnp").checked, apiClient.ajax({
type: "POST",
data: config,
url: apiClient.getUrl("Startup/RemoteAccess")
}).then(function() {
loading.hide(), navigateToNextPage()
})
}
function navigateToNextPage() {
2018-12-11 00:46:50 -05:00
Dashboard.navigate("wizardfinish.html")
2018-10-23 01:05:09 +03:00
}
function onSubmit(e) {
return save(this), e.preventDefault(), !1
}
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")
})
}
2018-12-11 00:46:50 -05:00
});