diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index f4aa554d05..3a053f1af0 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -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; diff --git a/dashboard-ui/mypreferenceswebclient.html b/dashboard-ui/mypreferenceswebclient.html index 7cccf8c9f5..1f2dc4064c 100644 --- a/dashboard-ui/mypreferenceswebclient.html +++ b/dashboard-ui/mypreferenceswebclient.html @@ -12,6 +12,56 @@ ${TabWebClient} +
+
+
+ +
+ ${HeaderAllDevices} +
+ +
+ +
+ ${HeaderThisDevice} +
+
+ + + + +
+ diff --git a/dashboard-ui/scripts/backdrops.js b/dashboard-ui/scripts/backdrops.js index 64ea63d6b6..c5e0a61bb2 100644 --- a/dashboard-ui/scripts/backdrops.js +++ b/dashboard-ui/scripts/backdrops.js @@ -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(); } }); diff --git a/dashboard-ui/scripts/localsettings.js b/dashboard-ui/scripts/localsettings.js new file mode 100644 index 0000000000..b06d11bf77 --- /dev/null +++ b/dashboard-ui/scripts/localsettings.js @@ -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); \ No newline at end of file diff --git a/dashboard-ui/scripts/mypreferenceslanguages.js b/dashboard-ui/scripts/mypreferenceslanguages.js index cd71777a71..5f103f2e43 100644 --- a/dashboard-ui/scripts/mypreferenceslanguages.js +++ b/dashboard-ui/scripts/mypreferenceslanguages.js @@ -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; diff --git a/dashboard-ui/scripts/mypreferenceswebclient.js b/dashboard-ui/scripts/mypreferenceswebclient.js index 5f282702bb..cf6b87d987 100644 --- a/dashboard-ui/scripts/mypreferenceswebclient.js +++ b/dashboard-ui/scripts/mypreferenceswebclient.js @@ -1 +1,64 @@ - \ No newline at end of file +(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); \ No newline at end of file diff --git a/dashboard-ui/scripts/thememediaplayer.js b/dashboard-ui/scripts/thememediaplayer.js index cfc1e0f518..6767664c75 100644 --- a/dashboard-ui/scripts/thememediaplayer.js +++ b/dashboard-ui/scripts/thememediaplayer.js @@ -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); \ No newline at end of file