mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
67 lines
1.8 KiB
JavaScript
67 lines
1.8 KiB
JavaScript
define(['jQuery'], function ($) {
|
|
'use strict';
|
|
|
|
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().then(function (config) {
|
|
|
|
config.MinResumePct = $('#txtMinResumePct', form).val();
|
|
config.MaxResumePct = $('#txtMaxResumePct', form).val();
|
|
config.MinResumeDurationSeconds = $('#txtMinResumeDuration', form).val();
|
|
|
|
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
|
});
|
|
|
|
// Disable default form submission
|
|
return false;
|
|
}
|
|
|
|
function getTabs() {
|
|
return [
|
|
{
|
|
href: 'cinemamodeconfiguration.html',
|
|
name: Globalize.translate('TabCinemaMode')
|
|
},
|
|
{
|
|
href: 'playbackconfiguration.html',
|
|
name: Globalize.translate('TabResumeSettings')
|
|
},
|
|
{
|
|
href: 'streamingsettings.html',
|
|
name: Globalize.translate('TabStreaming')
|
|
}];
|
|
}
|
|
|
|
$(document).on('pageinit', "#playbackConfigurationPage", function () {
|
|
|
|
$('.playbackConfigurationForm').off('submit', onSubmit).on('submit', onSubmit);
|
|
|
|
}).on('pageshow', "#playbackConfigurationPage", function () {
|
|
|
|
LibraryMenu.setTabs('playback', 1, getTabs);
|
|
Dashboard.showLoadingMsg();
|
|
|
|
var page = this;
|
|
|
|
ApiClient.getServerConfiguration().then(function (config) {
|
|
|
|
loadPage(page, config);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|