mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update more controller locations
This commit is contained in:
parent
6c8884583d
commit
4beac3f7f4
16 changed files with 16 additions and 16 deletions
48
src/controllers/dashboard/playback.js
Normal file
48
src/controllers/dashboard/playback.js
Normal file
|
@ -0,0 +1,48 @@
|
|||
define(['jQuery', 'loading', 'libraryMenu', 'globalize'], function ($, loading, libraryMenu, globalize) {
|
||||
'use strict';
|
||||
|
||||
function loadPage(page, config) {
|
||||
$('#txtMinResumePct', page).val(config.MinResumePct);
|
||||
$('#txtMaxResumePct', page).val(config.MaxResumePct);
|
||||
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
|
||||
loading.hide();
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
loading.show();
|
||||
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);
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function getTabs() {
|
||||
return [{
|
||||
href: 'encodingsettings.html',
|
||||
name: globalize.translate('Transcoding')
|
||||
}, {
|
||||
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 () {
|
||||
loading.show();
|
||||
libraryMenu.setTabs('playback', 1, getTabs);
|
||||
var page = this;
|
||||
ApiClient.getServerConfiguration().then(function (config) {
|
||||
loadPage(page, config);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue