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

Deminify part 2 (#509)

This de-minifies and de-uglifies `controllers` subdirectory
This commit is contained in:
grafixeyehero 2019-11-06 13:43:39 +03:00 committed by Vasily
parent f98a43f06f
commit 23677db990
66 changed files with 8296 additions and 4227 deletions

View file

@ -1,20 +1,34 @@
define(["jQuery", "loading", "libraryMenu", "fnchecked"], function($, loading, libraryMenu) {
define(["jQuery", "loading", "libraryMenu", "fnchecked"], function ($, loading, libraryMenu) {
"use strict";
function loadPage(page, config, users) {
page.querySelector("#chkEnablePlayTo").checked = config.EnablePlayTo, page.querySelector("#chkEnableDlnaDebugLogging").checked = config.EnableDebugLog, $("#txtClientDiscoveryInterval", page).val(config.ClientDiscoveryIntervalSeconds), $("#chkEnableServer", page).checked(config.EnableServer), $("#chkBlastAliveMessages", page).checked(config.BlastAliveMessages), $("#txtBlastInterval", page).val(config.BlastAliveMessageIntervalSeconds);
var usersHtml = users.map(function(u) {
return '<option value="' + u.Id + '">' + u.Name + "</option>"
page.querySelector("#chkEnablePlayTo").checked = config.EnablePlayTo;
page.querySelector("#chkEnableDlnaDebugLogging").checked = config.EnableDebugLog;
$("#txtClientDiscoveryInterval", page).val(config.ClientDiscoveryIntervalSeconds);
$("#chkEnableServer", page).checked(config.EnableServer);
$("#chkBlastAliveMessages", page).checked(config.BlastAliveMessages);
$("#txtBlastInterval", page).val(config.BlastAliveMessageIntervalSeconds);
var usersHtml = users.map(function (u) {
return '<option value="' + u.Id + '">' + u.Name + "</option>";
}).join("");
$("#selectUser", page).html(usersHtml).val(config.DefaultUserId || ""), loading.hide()
$("#selectUser", page).html(usersHtml).val(config.DefaultUserId || "");
loading.hide();
}
function onSubmit() {
loading.show();
var form = this;
return ApiClient.getNamedConfiguration("dlna").then(function(config) {
config.EnablePlayTo = form.querySelector("#chkEnablePlayTo").checked, config.EnableDebugLog = form.querySelector("#chkEnableDlnaDebugLogging").checked, config.ClientDiscoveryIntervalSeconds = $("#txtClientDiscoveryInterval", form).val(), config.EnableServer = $("#chkEnableServer", form).checked(), config.BlastAliveMessages = $("#chkBlastAliveMessages", form).checked(), config.BlastAliveMessageIntervalSeconds = $("#txtBlastInterval", form).val(), config.DefaultUserId = $("#selectUser", form).val(), ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult)
}), !1
ApiClient.getNamedConfiguration("dlna").then(function (config) {
config.EnablePlayTo = form.querySelector("#chkEnablePlayTo").checked;
config.EnableDebugLog = form.querySelector("#chkEnableDlnaDebugLogging").checked;
config.ClientDiscoveryIntervalSeconds = $("#txtClientDiscoveryInterval", form).val();
config.EnableServer = $("#chkEnableServer", form).checked();
config.BlastAliveMessages = $("#chkBlastAliveMessages", form).checked();
config.BlastAliveMessageIntervalSeconds = $("#txtBlastInterval", form).val();
config.DefaultUserId = $("#selectUser", form).val();
ApiClient.updateNamedConfiguration("dlna", config).then(Dashboard.processServerConfigurationUpdateResult);
});
return false;
}
function getTabs() {
@ -24,17 +38,19 @@ define(["jQuery", "loading", "libraryMenu", "fnchecked"], function($, loading, l
}, {
href: "dlnaprofiles.html",
name: Globalize.translate("TabProfiles")
}]
}];
}
$(document).on("pageinit", "#dlnaSettingsPage", function() {
$(".dlnaSettingsForm").off("submit", onSubmit).on("submit", onSubmit)
}).on("pageshow", "#dlnaSettingsPage", function() {
libraryMenu.setTabs("dlna", 0, getTabs), loading.show();
var page = this,
promise1 = ApiClient.getNamedConfiguration("dlna"),
promise2 = ApiClient.getUsers();
Promise.all([promise1, promise2]).then(function(responses) {
loadPage(page, responses[0], responses[1])
})
})
});
$(document).on("pageinit", "#dlnaSettingsPage", function () {
$(".dlnaSettingsForm").off("submit", onSubmit).on("submit", onSubmit);
}).on("pageshow", "#dlnaSettingsPage", function () {
libraryMenu.setTabs("dlna", 0, getTabs);
loading.show();
var page = this;
var promise1 = ApiClient.getNamedConfiguration("dlna");
var promise2 = ApiClient.getUsers();
Promise.all([promise1, promise2]).then(function (responses) {
loadPage(page, responses[0], responses[1]);
});
});
});