mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
made saving consistent
This commit is contained in:
parent
dcea852799
commit
a6767f5cbc
10 changed files with 121 additions and 118 deletions
50
dashboard-ui/scripts/clientsettings.js
Normal file
50
dashboard-ui/scripts/clientsettings.js
Normal file
|
@ -0,0 +1,50 @@
|
|||
(function ($, document, window) {
|
||||
|
||||
$(document).on('pageshow', "#clientSettingsPage", function () {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var page = this;
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
$('#txtWeatherLocation', page).val(config.WeatherLocation);
|
||||
$('#txtMinResumePct', page).val(config.MinResumePct);
|
||||
$('#txtMaxResumePct', page).val(config.MaxResumePct);
|
||||
$('#txtMinResumeDuration', page).val(config.MinResumeDurationSeconds);
|
||||
$('#selectWeatherUnit', page).val(config.WeatherUnit).selectmenu("refresh");
|
||||
|
||||
$('input:first', page).focus();
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
});
|
||||
});
|
||||
|
||||
function clientSettingsPage() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.onSubmit = function () {
|
||||
var form = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
ApiClient.getServerConfiguration().done(function (config) {
|
||||
|
||||
config.WeatherLocation = $('#txtWeatherLocation', form).val();
|
||||
config.WeatherUnit = $('#selectWeatherUnit', form).val();
|
||||
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;
|
||||
};
|
||||
}
|
||||
|
||||
window.ClientSettingsPage = new clientSettingsPage();
|
||||
|
||||
})($, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue