mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
make backdrops optional
This commit is contained in:
parent
0a7b7a14e3
commit
2c7636b291
7 changed files with 173 additions and 25 deletions
|
@ -1 +1,64 @@
|
|||
|
||||
(function ($, window, document) {
|
||||
|
||||
function loadForm(page, user) {
|
||||
|
||||
$('#selectThemeSong', page).val(LocalSettings.val('enableThemeSongs', user.Id) || '').selectmenu("refresh");
|
||||
$('#selectBackdrop', page).val(LocalSettings.val('enableBackdrops', user.Id) || '').selectmenu("refresh");
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
}
|
||||
|
||||
function saveUser(page, user) {
|
||||
|
||||
LocalSettings.val('enableThemeSongs', user.Id, $('#selectThemeSong', page).val());
|
||||
LocalSettings.val('enableBackdrops', user.Id, $('#selectBackdrop', page).val());
|
||||
|
||||
//ApiClient.updateUser(user).done(function () {
|
||||
//Dashboard.alert(Globalize.translate("SettingsSaved"));
|
||||
//});
|
||||
Dashboard.alert(Globalize.translate("SettingsSaved"));
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
|
||||
var page = $(this).parents('.page');
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getUser(userId).done(function (result) {
|
||||
|
||||
saveUser(page, result);
|
||||
|
||||
});
|
||||
|
||||
// Disable default form submission
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#webClientPreferencesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
}).on('pagebeforeshow', "#webClientPreferencesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var userId = getParameterByName('userId') || Dashboard.getCurrentUserId();
|
||||
|
||||
ApiClient.getUser(userId).done(function (user) {
|
||||
|
||||
loadForm(page, user);
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
window.WebClientPreferencesPage = {
|
||||
onSubmit: onSubmit
|
||||
};
|
||||
|
||||
})(jQuery, window, document);
|
Loading…
Add table
Add a link
Reference in a new issue