2014-01-07 11:39:35 -07:00
|
|
|
|
(function ($, document, window) {
|
|
|
|
|
|
|
|
|
|
function loadPage(page, config) {
|
|
|
|
|
|
|
|
|
|
$('#chkEnableDebugEncodingLogging', page).checked(config.EnableDebugEncodingLogging).checkboxradio('refresh');
|
|
|
|
|
|
|
|
|
|
$('.radioEncodingQuality', page).each(function() {
|
|
|
|
|
|
|
|
|
|
this.checked = config.MediaEncodingQuality == this.value;
|
|
|
|
|
|
|
|
|
|
}).checkboxradio('refresh');
|
|
|
|
|
|
2014-02-02 08:19:29 -07:00
|
|
|
|
$('#chkAllowUpscaling', page).checked(config.AllowVideoUpscaling).checkboxradio("refresh");
|
|
|
|
|
|
2014-01-07 11:39:35 -07:00
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-25 14:13:55 -07:00
|
|
|
|
$(document).on('pageshow', "#encodingSettingsPage", function () {
|
2014-01-07 11:39:35 -07:00
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2014-01-11 11:58:50 -07:00
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
2014-01-07 11:39:35 -07:00
|
|
|
|
|
|
|
|
|
loadPage(page, config);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
window.EncodingSettingsPage = {
|
|
|
|
|
|
|
|
|
|
onSubmit: function () {
|
|
|
|
|
|
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
|
|
|
|
|
|
var form = this;
|
|
|
|
|
|
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
|
|
2014-02-02 08:19:29 -07:00
|
|
|
|
config.AllowVideoUpscaling = $('#chkAllowUpscaling', form).checked();
|
2014-01-07 11:39:35 -07:00
|
|
|
|
config.EnableDebugEncodingLogging = $('#chkEnableDebugEncodingLogging', form).checked();
|
|
|
|
|
config.MediaEncodingQuality = $('.radioEncodingQuality:checked', form).val();
|
|
|
|
|
|
|
|
|
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// Disable default form submission
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
})(jQuery, document, window);
|