From e560b1ba826b1935b71d6b4f65152c9f7cea82f5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 6 Jan 2016 15:11:32 -0500 Subject: [PATCH 1/9] make auto saving conditional --- dashboard-ui/mypreferencesdisplay.html | 4 +++ dashboard-ui/mypreferenceshome.html | 4 +++ dashboard-ui/mypreferenceslanguages.html | 5 +++ dashboard-ui/scripts/mypreferencesdisplay.js | 27 +++++++++++++-- dashboard-ui/scripts/mypreferenceshome.js | 33 ++++++++++++++++--- .../scripts/mypreferenceslanguages.js | 27 +++++++++++++-- dashboard-ui/scripts/site.js | 1 + 7 files changed, 90 insertions(+), 11 deletions(-) diff --git a/dashboard-ui/mypreferencesdisplay.html b/dashboard-ui/mypreferencesdisplay.html index 9bf1064dca..b1a9eba34f 100644 --- a/dashboard-ui/mypreferencesdisplay.html +++ b/dashboard-ui/mypreferencesdisplay.html @@ -115,6 +115,10 @@ + +

*${LegendTheseSettingsShared}

diff --git a/dashboard-ui/mypreferenceshome.html b/dashboard-ui/mypreferenceshome.html index 88b4d8c3fc..f2199371e0 100644 --- a/dashboard-ui/mypreferenceshome.html +++ b/dashboard-ui/mypreferenceshome.html @@ -138,6 +138,10 @@ + +

*${LegendTheseSettingsShared}

diff --git a/dashboard-ui/mypreferenceslanguages.html b/dashboard-ui/mypreferenceslanguages.html index 9c4087a5ac..b99b90b45e 100644 --- a/dashboard-ui/mypreferenceslanguages.html +++ b/dashboard-ui/mypreferenceslanguages.html @@ -88,6 +88,11 @@ + + +

*${LegendTheseSettingsShared}

diff --git a/dashboard-ui/scripts/mypreferencesdisplay.js b/dashboard-ui/scripts/mypreferencesdisplay.js index e36f479771..174e8b6eac 100644 --- a/dashboard-ui/scripts/mypreferencesdisplay.js +++ b/dashboard-ui/scripts/mypreferencesdisplay.js @@ -25,16 +25,29 @@ appStorage.setItem('enableThemeSongs-' + user.Id, $('#selectThemeSong', page).val()); appStorage.setItem('enableBackdrops-' + user.Id, $('#selectBackdrop', page).val()); - ApiClient.updateUserConfiguration(user.Id, user.Configuration); + return ApiClient.updateUserConfiguration(user.Id, user.Configuration); } function save(page) { var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); + if (!AppInfo.enableAutoSave) { + Dashboard.showLoadingMsg(); + } + ApiClient.getUser(userId).then(function (user) { - saveUser(page, user); + saveUser(page, user).then(function () { + + Dashboard.hideLoadingMsg(); + if (!AppInfo.enableAutoSave) { + Dashboard.alert(Globalize.translate('SettingsSaved')); + } + + }, function () { + Dashboard.hideLoadingMsg(); + }); }); } @@ -55,6 +68,12 @@ $('.displayPreferencesForm').off('submit', onSubmit).on('submit', onSubmit); + if (AppInfo.enableAutoSave) { + page.querySelector('.btnSave').classList.add('hide'); + } else { + page.querySelector('.btnSave').classList.remove('hide'); + } + }); pageIdOn('pageshow', "displayPreferencesPage", function () { @@ -88,7 +107,9 @@ var page = this; - save(page); + if (AppInfo.enableAutoSave) { + save(page); + } }); diff --git a/dashboard-ui/scripts/mypreferenceshome.js b/dashboard-ui/scripts/mypreferenceshome.js index a54d610de1..b2cc9a0af3 100644 --- a/dashboard-ui/scripts/mypreferenceshome.js +++ b/dashboard-ui/scripts/mypreferenceshome.js @@ -197,21 +197,36 @@ displayPreferences.CustomPrefs.home2 = $('#selectHomeSection3', page).val(); displayPreferences.CustomPrefs.home3 = $('#selectHomeSection4', page).val(); - ApiClient.updateDisplayPreferences('home', displayPreferences, user.Id, AppSettings.displayPreferencesKey()).then(function () { + return ApiClient.updateDisplayPreferences('home', displayPreferences, user.Id, AppSettings.displayPreferencesKey()).then(function () { - ApiClient.updateUserConfiguration(user.Id, user.Configuration); + return ApiClient.updateUserConfiguration(user.Id, user.Configuration); }); } function save(page) { + Dashboard.showLoadingMsg(); + var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); + if (!AppInfo.enableAutoSave) { + Dashboard.showLoadingMsg(); + } + ApiClient.getUser(userId).then(function (user) { ApiClient.getDisplayPreferences('home', user.Id, AppSettings.displayPreferencesKey()).then(function (displayPreferences) { - saveUser(page, user, displayPreferences); + saveUser(page, user, displayPreferences).then(function () { + + Dashboard.hideLoadingMsg(); + if (!AppInfo.enableAutoSave) { + Dashboard.alert(Globalize.translate('SettingsSaved')); + } + + }, function () { + Dashboard.hideLoadingMsg(); + }); }); }); @@ -270,6 +285,12 @@ $('.homeScreenPreferencesForm').off('submit', onSubmit).on('submit', onSubmit); + if (AppInfo.enableAutoSave) { + page.querySelector('.btnSave').classList.add('hide'); + } else { + page.querySelector('.btnSave').classList.remove('hide'); + } + }); pageIdOn('pageshow', "homeScreenPreferencesPage", function () { @@ -293,8 +314,10 @@ pageIdOn('pagebeforehide', "homeScreenPreferencesPage", function () { var page = this; - - save(page); + + if (AppInfo.enableAutoSave) { + save(page); + } }); })(jQuery, window, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/mypreferenceslanguages.js b/dashboard-ui/scripts/mypreferenceslanguages.js index f8a4c7aa6f..f3f8133e2b 100644 --- a/dashboard-ui/scripts/mypreferenceslanguages.js +++ b/dashboard-ui/scripts/mypreferenceslanguages.js @@ -96,7 +96,7 @@ AppSettings.enableCinemaMode(page.querySelector('.chkEnableCinemaMode').checked); - ApiClient.updateUserConfiguration(user.Id, user.Configuration); + return ApiClient.updateUserConfiguration(user.Id, user.Configuration); } function save(page) { @@ -113,9 +113,22 @@ var userId = getParameterByName('userId') || Dashboard.getCurrentUserId(); + if (!AppInfo.enableAutoSave) { + Dashboard.showLoadingMsg(); + } + ApiClient.getUser(userId).then(function (result) { - saveUser(page, result); + saveUser(page, result).then(function () { + + Dashboard.hideLoadingMsg(); + if (!AppInfo.enableAutoSave) { + Dashboard.alert(Globalize.translate('SettingsSaved')); + } + + }, function () { + Dashboard.hideLoadingMsg(); + }); }); } @@ -141,6 +154,12 @@ }); $('.languagePreferencesForm').off('submit', onSubmit).on('submit', onSubmit); + + if (AppInfo.enableAutoSave) { + page.querySelector('.btnSave').classList.add('hide'); + } else { + page.querySelector('.btnSave').classList.remove('hide'); + } }); pageIdOn('pageshow', "languagePreferencesPage", function () { @@ -168,7 +187,9 @@ var page = this; - save(page); + if (AppInfo.enableAutoSave) { + save(page); + } }); })(jQuery, window, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index de51a00fa8..f919c61b7c 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1555,6 +1555,7 @@ var AppInfo = {}; AppInfo.enableNowPlayingBar = true; AppInfo.enableHomeTabs = true; AppInfo.enableNowPlayingPageBottomTabs = true; + AppInfo.enableAutoSave = browserInfo.mobile; AppInfo.enableAppStorePolicy = isCordova; From e0416d33e0683f9890b301c20743c14b8417cef2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 7 Jan 2016 11:34:48 -0500 Subject: [PATCH 2/9] fix song sorting --- dashboard-ui/scripts/secondaryitems.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dashboard-ui/scripts/secondaryitems.js b/dashboard-ui/scripts/secondaryitems.js index 8f54b5ba9c..381416c95d 100644 --- a/dashboard-ui/scripts/secondaryitems.js +++ b/dashboard-ui/scripts/secondaryitems.js @@ -48,6 +48,10 @@ var type = getParameterByName('type'); if (type) { pageData.query.IncludeItemTypes = type; + + if (type == 'Audio') { + pageData.query.SortBy = 'Album,SortName'; + } } var filters = getParameterByName('filters'); From a0ecaf90b0bdfcea4b64fe67d0037a1f09a439d6 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 8 Jan 2016 23:28:09 -0500 Subject: [PATCH 3/9] update chromecast loading --- dashboard-ui/scripts/chromecast.js | 18 ++++++++++++++---- dashboard-ui/scripts/site.js | 6 ++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/dashboard-ui/scripts/chromecast.js b/dashboard-ui/scripts/chromecast.js index 04e81a81a5..2374731633 100644 --- a/dashboard-ui/scripts/chromecast.js +++ b/dashboard-ui/scripts/chromecast.js @@ -1,4 +1,4 @@ -(function (window, chrome, console) { +define(['https://www.gstatic.com/cv/js/sender/v1/cast_sender.js'], function () { // Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js var currentResolve; @@ -90,6 +90,8 @@ */ CastPlayer.prototype.initializeCastPlayer = function () { + var chrome = window.chrome; + if (!chrome) { return; } @@ -861,9 +863,17 @@ castPlayer = new CastPlayer(); - MediaController.registerPlayer(new chromecastPlayer()); + var registeredPlayer = new chromecastPlayer(); + MediaController.registerPlayer(registeredPlayer); + + // To allow the native android app to override + document.dispatchEvent(new CustomEvent("chromecastloaded", { + detail: { + player: registeredPlayer + } + })); } - requirejs(["https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"], initializeChromecast); + initializeChromecast(); -})(window, window.chrome, console); \ No newline at end of file +}); \ No newline at end of file diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index f919c61b7c..6a3d21641c 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -2276,16 +2276,18 @@ var AppInfo = {}; if (Dashboard.isRunningInCordova()) { - postInitDependencies.push('cordova/connectsdk'); - if (browserInfo.android) { postInitDependencies.push('cordova/android/mediasession'); + postInitDependencies.push('cordova/android/chromecast'); + } else { postInitDependencies.push('cordova/volume'); } if (browserInfo.safari) { + postInitDependencies.push('cordova/connectsdk/connectsdk'); + postInitDependencies.push('cordova/ios/orientation'); if (Dashboard.capabilities().SupportsSync) { From a07950902f6197663d6b041c0244f10737aadbdf Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 10 Jan 2016 12:36:20 -0500 Subject: [PATCH 4/9] remove theater from plugin catalog --- dashboard-ui/plugincatalog.html | 2 -- 1 file changed, 2 deletions(-) diff --git a/dashboard-ui/plugincatalog.html b/dashboard-ui/plugincatalog.html index cf096821e3..bafc6d34e1 100644 --- a/dashboard-ui/plugincatalog.html +++ b/dashboard-ui/plugincatalog.html @@ -22,8 +22,6 @@ - -
From 59dc086d9b75508147af797d8b8d799a2db33ce4 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 10 Jan 2016 12:37:02 -0500 Subject: [PATCH 5/9] fix unveil event listeners --- dashboard-ui/thirdparty/jquery.unveil-custom.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dashboard-ui/thirdparty/jquery.unveil-custom.js b/dashboard-ui/thirdparty/jquery.unveil-custom.js index ce5e66414b..7083bbc462 100644 --- a/dashboard-ui/thirdparty/jquery.unveil-custom.js +++ b/dashboard-ui/thirdparty/jquery.unveil-custom.js @@ -85,9 +85,9 @@ images = remaining; if (!images.length) { - document.removeEventListener('scroll', unveil); - document.removeEventListener(wheelEvent, unveil); - window.removeEventListener('resize', unveil); + document.removeEventListener('scroll', unveil, true); + document.removeEventListener(wheelEvent, unveil, true); + window.removeEventListener('resize', unveil, true); } } From 03596f11381650fe2887beea4c54c8cb94cfd6e2 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 11 Jan 2016 11:51:53 -0500 Subject: [PATCH 6/9] adjust nowplayingbar.css --- dashboard-ui/css/nowplayingbar.css | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dashboard-ui/css/nowplayingbar.css b/dashboard-ui/css/nowplayingbar.css index ae1e4bd7e7..8d845aa2ab 100644 --- a/dashboard-ui/css/nowplayingbar.css +++ b/dashboard-ui/css/nowplayingbar.css @@ -238,18 +238,21 @@ } -@media all and (max-width: 1300px) { +@media all and (max-width: 1400px) { .nowPlayingBarUserDataButtons { display: none; } } -@media all and (max-width: 1000px) { +@media all and (max-width: 1100px) { .nowPlayingBarVolumeSlider, .nowPlayingBar .muteButton, .nowPlayingBar .unmuteButton { display: none !important; } +} + +@media all and (max-width: 1000px) { .nowPlayingBar .playlistButton { display: none !important; From 0bc0eb8a3fbc24b59f4d3bda4172e6b54de944cd Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Mon, 11 Jan 2016 21:38:58 -0500 Subject: [PATCH 7/9] fix recording alignment --- .../recordingcreator/recordingcreator.template.html | 4 ++-- dashboard-ui/css/livetv.css | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dashboard-ui/components/recordingcreator/recordingcreator.template.html b/dashboard-ui/components/recordingcreator/recordingcreator.template.html index 2cf6123e35..7347d5eb19 100644 --- a/dashboard-ui/components/recordingcreator/recordingcreator.template.html +++ b/dashboard-ui/components/recordingcreator/recordingcreator.template.html @@ -7,7 +7,7 @@
-
+
${ButtonAdvanced}
@@ -16,7 +16,7 @@


-