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

52 lines
1.3 KiB
JavaScript
Raw Normal View History

2013-05-21 13:36:26 -07:00
(function ($, document, window) {
function loadPage(page, config) {
$('#txtSeasonZeroName', page).val(config.SeasonZeroDisplayName);
2014-01-29 13:30:26 -07:00
$('#chkEnableRealtimeMonitor', page).checked(config.EnableRealtimeMonitor).checkboxradio("refresh");
2013-05-21 13:36:26 -07:00
Dashboard.hideLoadingMsg();
}
$(document).on('pageshow', "#librarySettingsPage", function () {
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
loadPage(page, config);
});
});
function librarySettingsPage() {
var self = this;
self.onSubmit = function () {
Dashboard.showLoadingMsg();
var form = this;
ApiClient.getServerConfiguration().done(function (config) {
config.SeasonZeroDisplayName = $('#txtSeasonZeroName', form).val();
2014-01-29 13:30:26 -07:00
config.EnableRealtimeMonitor = $('#chkEnableRealtimeMonitor', form).checked();
2013-05-21 13:36:26 -07:00
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
});
// Disable default form submission
return false;
};
}
window.LibrarySettingsPage = new librarySettingsPage();
})(jQuery, document, window);