mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 11:28:23 -07:00
49 lines
1.3 KiB
JavaScript
49 lines
1.3 KiB
JavaScript
(function ($, document, window) {
|
|
|
|
function loadPage(page, config) {
|
|
|
|
$('#txtMinResumePct', page).val(config.MinResumePct);
|
|
$('#txtMaxResumePct', page).val(config.MaxResumePct);
|
|
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
|
|
|
|
Dashboard.hideLoadingMsg();
|
|
}
|
|
|
|
function onSubmit() {
|
|
Dashboard.showLoadingMsg();
|
|
|
|
var form = this;
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
config.MinResumePct = $('#txtMinResumePct', form).val();
|
|
config.MaxResumePct = $('#txtMaxResumePct', form).val();
|
|
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();
|
|
|
|
ApiClient.updateServerConfiguration(config).done(Dashboard.processServerConfigurationUpdateResult);
|
|
});
|
|
|
|
// Disable default form submission
|
|
return false;
|
|
}
|
|
|
|
$(document).on('pageinit', "#playbackConfigurationPage", function () {
|
|
|
|
$('.playbackConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
|
|
|
|
}).on('pageshow', "#playbackConfigurationPage", function () {
|
|
|
|
Dashboard.showLoadingMsg();
|
|
|
|
var page = this;
|
|
|
|
ApiClient.getServerConfiguration().done(function (config) {
|
|
|
|
loadPage(page, config);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
})(jQuery, document, window);
|