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

43 lines
1.2 KiB
JavaScript
Raw Normal View History

2013-04-16 21:58:32 -07:00
(function ($, document, window) {
2013-12-25 20:44:26 -07:00
$(document).on('pageshow', "#appsPlaybackPage", function () {
2013-04-16 21:58:32 -07:00
Dashboard.showLoadingMsg();
var page = this;
ApiClient.getServerConfiguration().done(function (config) {
$('#txtMinResumePct', page).val(config.MinResumePct);
$('#txtMaxResumePct', page).val(config.MaxResumePct);
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
$('input:first', page).focus();
Dashboard.hideLoadingMsg();
});
});
2013-12-25 20:44:26 -07:00
window.AppsPlaybackPage = {
2013-04-16 21:58:32 -07:00
2013-12-25 20:44:26 -07:00
onSubmit: function () {
2013-04-16 21:58:32 -07:00
var form = this;
Dashboard.showLoadingMsg();
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;
2013-12-25 20:44:26 -07:00
}
2013-04-16 21:58:32 -07:00
2013-12-25 20:44:26 -07:00
};
2013-04-16 21:58:32 -07:00
2013-06-24 07:06:25 -07:00
})($, document, window);