diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index 844ef7c23..ad473866a 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -334,10 +334,12 @@ .overflowPortraitCard { width: 40%; + max-width: 200px; } .overflowBackdropCard { width: 80%; + max-width: 400px; } .cardProgress { diff --git a/dashboard-ui/mypreferencesdisplay.html b/dashboard-ui/mypreferencesdisplay.html index 023b3dcd6..2349d1c44 100644 --- a/dashboard-ui/mypreferencesdisplay.html +++ b/dashboard-ui/mypreferencesdisplay.html @@ -48,16 +48,6 @@ -
-

- ${HeaderSync} -

-
- ${OptionSyncToSDCard} - -
-
-

${HeaderDisplay}* diff --git a/dashboard-ui/mypreferencesmenu.html b/dashboard-ui/mypreferencesmenu.html index e1f43f06f..f51a60747 100644 --- a/dashboard-ui/mypreferencesmenu.html +++ b/dashboard-ui/mypreferencesmenu.html @@ -83,6 +83,16 @@ + + + + + +
${ButtonSyncSettings}
+
${ButtonSyncHelp}
+
+
+

diff --git a/dashboard-ui/mysyncsettings.html b/dashboard-ui/mysyncsettings.html new file mode 100644 index 000000000..8671082d5 --- /dev/null +++ b/dashboard-ui/mysyncsettings.html @@ -0,0 +1,32 @@ + + + + + Emby + + +
+ +
+
+ +

+ ${HeaderSync} +

+
+ +
+ ${OptionSyncToSDCard} + +
+ +
+
+ +
+
+
+ + diff --git a/dashboard-ui/scripts/mypreferencescommon.js b/dashboard-ui/scripts/mypreferencescommon.js index c1993b5b9..c5a8ee4bd 100644 --- a/dashboard-ui/scripts/mypreferencescommon.js +++ b/dashboard-ui/scripts/mypreferencescommon.js @@ -8,4 +8,11 @@ $('.lnkLanguagePreferences', page).attr('href', 'mypreferenceslanguages.html?userId=' + userId); $('.lnkHomeScreenPreferences', page).attr('href', 'mypreferenceshome.html?userId=' + userId); $('.lnkMyProfile', page).attr('href', 'myprofile.html?userId=' + userId); + $('.lnkSync', page).attr('href', 'mysyncsettings.html?userId=' + userId); + + if (AppInfo.supportsSyncPathSetting) { + page.querySelector('.lnkSync').classList.remove('hide'); + } else { + page.querySelector('.lnkSync').classList.add('hide'); + } }); \ No newline at end of file diff --git a/dashboard-ui/scripts/mypreferencesdisplay.js b/dashboard-ui/scripts/mypreferencesdisplay.js index daeb28cd8..9849d9e22 100644 --- a/dashboard-ui/scripts/mypreferencesdisplay.js +++ b/dashboard-ui/scripts/mypreferencesdisplay.js @@ -11,7 +11,6 @@ $('#selectBackdrop', page).val(appStorage.getItem('enableBackdrops-' + user.Id) || '').selectmenu("refresh"); page.querySelector('.chkEnableFullScreen').checked = AppSettings.enableFullScreen(); - page.querySelector('.chkSyncToExternalCard').checked = AppSettings.enableSyncToExternalStorage(); Dashboard.hideLoadingMsg(); } @@ -28,8 +27,6 @@ appStorage.setItem('enableThemeSongs-' + user.Id, $('#selectThemeSong', page).val()); appStorage.setItem('enableBackdrops-' + user.Id, $('#selectBackdrop', page).val()); - AppSettings.enableSyncToExternalStorage(page.querySelector('.chkSyncToExternalCard').checked); - ApiClient.updateUserConfiguration(user.Id, user.Configuration).done(function () { Dashboard.alert(Globalize.translate('SettingsSaved')); @@ -61,15 +58,6 @@ $('.displayPreferencesForm').off('submit', onSubmit).on('submit', onSubmit); - $('.btnSelectSyncPath', page).on('click', function () { - - require(['nativedirectorychooser'], function () { - NativeDirectoryChooser.chooseDirectory().done(function (path) { - $('#txtSyncPath', page).val(path); - }); - }); - }); - }).on('pageshowready', "#displayPreferencesPage", function () { var page = this; @@ -96,12 +84,6 @@ } else { $('.fldFullscreen', page).hide(); } - - if (AppInfo.supportsSyncPathSetting) { - $('.syncSettingsSection', page).show(); - } else { - $('.syncSettingsSection', page).hide(); - } }); })(jQuery, window, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/mysyncsettings.js b/dashboard-ui/scripts/mysyncsettings.js new file mode 100644 index 000000000..01f4ae2a9 --- /dev/null +++ b/dashboard-ui/scripts/mysyncsettings.js @@ -0,0 +1,64 @@ +(function ($, window, document) { + + function loadForm(page, user) { + + page.querySelector('.chkSyncToExternalCard').checked = AppSettings.enableSyncToExternalStorage(); + + Dashboard.hideLoadingMsg(); + } + + function saveUser(page, user) { + + AppSettings.enableSyncToExternalStorage(page.querySelector('.chkSyncToExternalCard').checked); + Dashboard.hideLoadingMsg(); + Dashboard.alert(Globalize.translate('SettingsSaved')); + } + + function onSubmit() { + + var page = $(this).parents('.page')[0]; + + Dashboard.showLoadingMsg(); + + var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); + + ApiClient.getUser(userId).done(function (user) { + + saveUser(page, user); + + }); + + // Disable default form submission + return false; + } + + $(document).on('pageinitdepends', "#syncPreferencesPage", function () { + + var page = this; + + $('form').off('submit', onSubmit).on('submit', onSubmit); + + $('.btnSelectSyncPath', page).on('click', function () { + + require(['nativedirectorychooser'], function () { + NativeDirectoryChooser.chooseDirectory().done(function (path) { + $('#txtSyncPath', page).val(path); + }); + }); + }); + + }).on('pageshowready', "#syncPreferencesPage", function () { + + var page = this; + + Dashboard.showLoadingMsg(); + + var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); + + ApiClient.getUser(userId).done(function (user) { + + loadForm(page, user); + }); + }); + +})(jQuery, window, document); \ No newline at end of file diff --git a/dashboard-ui/strings/html/server.json b/dashboard-ui/strings/html/server.json index 93b9f2725..4471a1a88 100644 --- a/dashboard-ui/strings/html/server.json +++ b/dashboard-ui/strings/html/server.json @@ -1509,7 +1509,9 @@ "ButtonHomeScreenSettingsHelp": "Configure the display of your home screen", "ButtonPlaybackSettingsHelp": "Specify your audio and subtitle preferences, streaming quality, and more.", "ButtonProfileHelp": "Set your profile image and password.", - "HeaderHomeScreenSettings": "Home Screen Settings", + "HeaderHomeScreenSettings": "Home Screen settings", "HeaderProfile": "Profile", - "HeaderLanguage": "Language" + "HeaderLanguage": "Language", + "ButtonSyncSettings": "Sync settings", + "ButtonSyncSettingsHelp": "Configure your sync settings" }