jellyfin-web/dashboard-ui/scripts/dlnasettings.js

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-03-10 10:38:53 -07:00
(function ($, document, window) {
function loadPage(page, config) {
$('#chkEnablePlayTo', page).checked(config.DlnaOptions.EnablePlayTo).checkboxradio("refresh");
2014-03-23 13:49:05 -07:00
$('#chkEnableDlnaDebugLogging', page).checked(config.DlnaOptions.EnableDebugLogging).checkboxradio("refresh");
$('#txtClientDiscoveryInterval', page).val(config.DlnaOptions.ClientDiscoveryIntervalSeconds);
2014-03-10 10:38:53 -07:00
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#dlnaSettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
loadPage(page, config);
});
});
function onSubmit() {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.DlnaOptions.EnablePlayTo = $('#chkEnablePlayTo', form).checked();
2014-03-23 13:49:05 -07:00
config.DlnaOptions.EnableDebugLogging = $('#chkEnableDlnaDebugLogging', form).checked();
config.DlnaOptions.ClientDiscoveryIntervalSeconds = $('#txtClientDiscoveryInterval', form).val();
2014-03-10 10:38:53 -07:00
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
}
window.DlnaSettingsPage = {
onSubmit: onSubmit
};
})(jQuery, document, window);