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

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2014-03-10 13:38:53 -04:00
(function ($, document, window) {
function loadPage(page, config) {
2014-06-29 13:35:05 -04:00
$('#chkEnablePlayTo', page).checked(config.EnablePlayTo).checkboxradio("refresh");
$('#chkEnableDlnaDebugLogging', page).checked(config.EnableDebugLogging).checkboxradio("refresh");
$('#txtClientDiscoveryInterval', page).val(config.ClientDiscoveryIntervalSeconds);
2014-03-23 16:49:05 -04:00
2014-03-10 13:38:53 -04:00
Dashboard.hideLoadingMsg();
}
function onSubmit() {
2015-06-07 21:23:56 -04:00
2014-03-10 13:38:53 -04:00
Dashboard.showLoadingMsg();
var form = this;
2014-06-29 13:35:05 -04:00
ApiClient.getNamedConfiguration("dlna").done(function (config) {
2014-03-10 13:38:53 -04:00
2014-06-29 13:35:05 -04:00
config.EnablePlayTo = $('#chkEnablePlayTo', form).checked();
config.EnableDebugLogging = $('#chkEnableDlnaDebugLogging', form).checked();
config.ClientDiscoveryIntervalSeconds = $('#txtClientDiscoveryInterval', form).val();
2014-03-10 13:38:53 -04:00
2014-06-29 13:35:05 -04:00
ApiClient.updateNamedConfiguration("dlna", config).done(Dashboard.processServerConfigurationUpdateResult);
2014-03-10 13:38:53 -04:00
});
// Disable default form submission
return false;
}
2015-09-01 10:01:59 -04:00
$(document).on('pageinit', "#dlnaSettingsPage", function () {
2015-06-07 21:23:56 -04:00
$('.dlnaSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
2015-09-24 13:08:10 -04:00
}).on('pageshow', "#dlnaSettingsPage", function () {
2015-06-07 21:23:56 -04:00
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getNamedConfiguration("dlna").done(function (config) {
loadPage(page, config);
});
});
2014-03-10 13:38:53 -04:00
})(jQuery, document, window);