2013-05-21 13:36:26 -07:00
|
|
|
|
(function ($, document, window) {
|
|
|
|
|
|
|
|
|
|
function loadPage(page, config) {
|
|
|
|
|
|
2013-05-24 08:01:53 -07:00
|
|
|
|
$('#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) {
|
|
|
|
|
|
2013-05-24 08:01:53 -07:00
|
|
|
|
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);
|