mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
make backdrops optional
This commit is contained in:
parent
0a7b7a14e3
commit
2c7636b291
@ -493,7 +493,7 @@ a.itemTag:hover {
|
||||
|
||||
.detailSectionHeader {
|
||||
background-clip: border-box;
|
||||
background-color: rgb(51, 51, 51);
|
||||
background-color: rgb(20, 20, 20);
|
||||
border-bottom-color: rgb(31, 31, 31);
|
||||
border-bottom-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
|
@ -12,6 +12,56 @@
|
||||
<a href="#" class="ui-btn-active lnkWebClientPreferences">${TabWebClient}</a>
|
||||
</div>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<form class="webClientPreferencesForm" style="margin: 0 auto;">
|
||||
|
||||
<div class="detailSectionHeader" style="margin: 0 .5em;">
|
||||
${HeaderAllDevices}
|
||||
</div>
|
||||
|
||||
<br />
|
||||
|
||||
<div class="detailSectionHeader" style="margin: 0 .5em;">
|
||||
${HeaderThisDevice}
|
||||
</div>
|
||||
<br />
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<label for="selectThemeSong">${LabelEnableThemeSongs}</label>
|
||||
<select id="selectThemeSong" data-mini="true">
|
||||
<option value="">${OptionAuto}</option>
|
||||
<option value="1">${OptionYes}</option>
|
||||
<option value="0">${OptionNo}</option>
|
||||
</select>
|
||||
<div class="fieldDescription">${LabelEnableThemeSongsHelp}</div>
|
||||
</li>
|
||||
<li>
|
||||
<label for="selectBackdrop">${LabelEnableBackdrops}</label>
|
||||
<select id="selectBackdrop" data-mini="true">
|
||||
<option value="">${OptionAuto}</option>
|
||||
<option value="1">${OptionYes}</option>
|
||||
<option value="0">${OptionNo}</option>
|
||||
</select>
|
||||
<div class="fieldDescription">${LabelEnableBackdropsHelp}</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul data-role="listview" class="ulForm">
|
||||
<li>
|
||||
<button type="submit" data-theme="a" data-icon="check" data-mini="true">
|
||||
${ButtonOk}
|
||||
</button>
|
||||
<button type="button" onclick="history.back();" data-icon="delete" data-mini="true">
|
||||
${ButtonCancel}
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
$('.webClientPreferencesForm').off('submit', WebClientPreferencesPage.onSubmit).on('submit', WebClientPreferencesPage.onSubmit);
|
||||
</script>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -87,18 +87,32 @@
|
||||
$('.backdropContainer').css('backgroundImage', '');
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', ".backdropPage", function () {
|
||||
|
||||
var page = this;
|
||||
function enabled() {
|
||||
|
||||
// Gets real messy and jumps around the page when scrolling
|
||||
// Can be reviewed later.
|
||||
if ($.browser.msie) {
|
||||
$(page).removeClass('backdropPage');
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
var val = LocalSettings.val('enableBackdrops', userId);
|
||||
|
||||
return val != '0';
|
||||
}
|
||||
|
||||
$(document).on('pagebeforeshow', ".backdropPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
if (enabled()) {
|
||||
var type = page.getAttribute('data-backdroptype');
|
||||
|
||||
showBackdrop(type);
|
||||
} else {
|
||||
$(page).removeClass('backdropPage');
|
||||
clearBackdrop();
|
||||
}
|
||||
|
||||
});
|
||||
|
30
dashboard-ui/scripts/localsettings.js
Normal file
30
dashboard-ui/scripts/localsettings.js
Normal file
@ -0,0 +1,30 @@
|
||||
(function ($, window, document) {
|
||||
|
||||
function get(key, userId) {
|
||||
|
||||
return localStorage.getItem(key + '-' + userId);
|
||||
}
|
||||
|
||||
function set(key, userId, value) {
|
||||
|
||||
localStorage.setItem(key + '-' + userId, value);
|
||||
}
|
||||
|
||||
function localSettings() {
|
||||
|
||||
var self = this;
|
||||
|
||||
self.val = function (key, userId, value) {
|
||||
|
||||
if (arguments.length < 3) {
|
||||
|
||||
return get(key, userId);
|
||||
}
|
||||
|
||||
set(key, userId, value);
|
||||
};
|
||||
}
|
||||
|
||||
window.LocalSettings = new localSettings();
|
||||
|
||||
})(jQuery, window, document);
|
@ -69,6 +69,12 @@
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectSubtitlePlaybackMode', page).on('change', function () {
|
||||
|
||||
$('.subtitlesHelp', page).hide();
|
||||
$('.subtitles' + this.value + 'Help', page).show();
|
||||
});
|
||||
|
||||
}).on('pageshow', "#languagePreferencesPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
@ -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);
|
@ -40,20 +40,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
function enabled(isEnabled) {
|
||||
function enabled() {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
var val = LocalSettings.val('enableThemeSongs', userId);
|
||||
|
||||
var key = userId + '-themesongs';
|
||||
|
||||
if (isEnabled == null) {
|
||||
return localStorage.getItem(key) == '1';
|
||||
}
|
||||
|
||||
|
||||
var val = isEnabled ? '1' : '0';
|
||||
|
||||
localStorage.setItem(key, val);
|
||||
return val == '1';
|
||||
}
|
||||
|
||||
function getPlayer() {
|
||||
@ -73,10 +64,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
window.ThemeSongManager = {
|
||||
enabled: function (isEnabled) {
|
||||
return enabled(isEnabled);
|
||||
}
|
||||
};
|
||||
|
||||
})(document, jQuery, window.localStorage);
|
Loading…
Reference in New Issue
Block a user