From fdb4dc593c5f67a02dfe903965dcfc304b46b97e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 24 Jun 2016 13:30:29 -0400 Subject: [PATCH] update detail page --- dashboard-ui/itemdetails.html | 10 ++-- dashboard-ui/scripts/itemdetailpage.js | 17 ++++--- dashboard-ui/scripts/nowplayingbar.js | 65 ++++++++++++++------------ dashboard-ui/scripts/site.js | 4 +- 4 files changed, 50 insertions(+), 46 deletions(-) diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index 2640c99db9..6e57ca8a74 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -129,14 +129,14 @@

- +
- +
TOMATOMETER®
-
- - +
+
+
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 8cd249b9d7..38f458ccf4 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -1215,13 +1215,12 @@ var html = ''; var reviews = result.Items; - for (var i = 0, length = reviews.length; i < length; i++) { var review = reviews[i]; html += '
'; - html += ''; + html += '
'; if (review.Score != null) { //html += review.Score; @@ -1229,13 +1228,13 @@ else if (review.Likes != null) { if (review.Likes) { - html += ''; + html += '
'; } else { - html += ''; + html += '
'; } } - html += ''; + html += '
'; html += '
' + review.Caption + '
'; @@ -1248,7 +1247,7 @@ vals.push(review.Publisher); } - html += '
' + vals.join(', ') + '.'; + html += '
' + vals.join(', ') + '.'; if (review.Date) { try { @@ -1265,12 +1264,12 @@ html += '
'; if (review.Url) { - html += ''; + html += ''; } - html += ''; + html += '
'; - html += ''; + html += '
'; html += '
'; } diff --git a/dashboard-ui/scripts/nowplayingbar.js b/dashboard-ui/scripts/nowplayingbar.js index e3e3203cf9..414677a2f7 100644 --- a/dashboard-ui/scripts/nowplayingbar.js +++ b/dashboard-ui/scripts/nowplayingbar.js @@ -9,6 +9,7 @@ var unmuteButton; var muteButton; var volumeSlider; + var volumeSliderContainer; var unpauseButtons; var pauseButtons; var positionSlider; @@ -51,7 +52,7 @@ html += ''; html += ''; - html += '
'; + html += '
'; html += ''; html += '
'; @@ -229,46 +230,50 @@ toggleRepeatButtonIcon = toggleRepeatButton.querySelector('i'); - // Unfortunately this is necessary because the polymer elements might not be ready immediately and there doesn't seem to be an event-driven way to find out when - setTimeout(function () { + volumeSlider = elem.querySelector('.nowPlayingBarVolumeSlider'); + volumeSliderContainer = elem.querySelector('.nowPlayingBarVolumeSliderContainer'); - volumeSlider = elem.querySelector('.nowPlayingBarVolumeSlider'); - volumeSlider.addEventListener('change', function () { + if (AppInfo.hasPhysicalVolumeButtons) { + volumeSliderContainer.classList.add('hide'); + } else { + volumeSliderContainer.classList.remove('hide'); + } - if (currentPlayer) { - currentPlayer.setVolume(this.value); - } + volumeSlider.addEventListener('change', function () { - }); + if (currentPlayer) { + currentPlayer.setVolume(this.value); + } - positionSlider = elem.querySelector('.nowPlayingBarPositionSlider'); - positionSlider.addEventListener('change', function () { + }); - if (currentPlayer && lastPlayerState) { + positionSlider = elem.querySelector('.nowPlayingBarPositionSlider'); + positionSlider.addEventListener('change', function () { - var newPercent = parseFloat(this.value); - var newPositionTicks = (newPercent / 100) * lastPlayerState.NowPlayingItem.RunTimeTicks; + if (currentPlayer && lastPlayerState) { - currentPlayer.seek(Math.floor(newPositionTicks)); - } + var newPercent = parseFloat(this.value); + var newPositionTicks = (newPercent / 100) * lastPlayerState.NowPlayingItem.RunTimeTicks; - }); + currentPlayer.seek(Math.floor(newPositionTicks)); + } - positionSlider.getBubbleText = function (value) { + }); - var state = lastPlayerState; + positionSlider.getBubbleText = function (value) { - if (!state || !state.NowPlayingItem || !state.NowPlayingItem.RunTimeTicks) { - return '--:--'; - } + var state = lastPlayerState; - var ticks = state.NowPlayingItem.RunTimeTicks; - ticks /= 100; - ticks *= value; + if (!state || !state.NowPlayingItem || !state.NowPlayingItem.RunTimeTicks) { + return '--:--'; + } - return datetime.getDisplayRunningTime(ticks); - }; - }, 300); + var ticks = state.NowPlayingItem.RunTimeTicks; + ticks /= 100; + ticks *= value; + + return datetime.getDisplayRunningTime(ticks); + }; } function showRemoteControl(tabIndex) { @@ -488,9 +493,9 @@ if (volumeSlider) { if (showVolumeSlider) { - volumeSlider.classList.remove('hide'); + volumeSliderContainer.classList.remove('hide'); } else { - volumeSlider.classList.add('hide'); + volumeSliderContainer.classList.add('hide'); } if (!volumeSlider.dragging) { diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js index 5551fa9852..2dcb7322fc 100644 --- a/dashboard-ui/scripts/site.js +++ b/dashboard-ui/scripts/site.js @@ -1524,7 +1524,7 @@ var AppInfo = {}; AppInfo.supportsFileInput = !(AppInfo.isNativeApp && isAndroid); AppInfo.hasPhysicalVolumeButtons = isCordova || isMobile; - AppInfo.hasPhysicalVolumeButtons = true; + AppInfo.enableBackButton = isIOS && (window.navigator.standalone || AppInfo.isNativeApp); AppInfo.supportsSyncPathSetting = isCordova && isAndroid; @@ -2556,7 +2556,7 @@ var AppInfo = {}; defineRoute({ path: '/itemdetails.html', - dependencies: ['emby-button', 'tileitemcss', 'scripts/livetvcomponents', 'paper-item-body', 'paper-icon-item', 'paper-icon-button-light'], + dependencies: ['emby-button', 'tileitemcss', 'scripts/livetvcomponents', 'paper-icon-button-light', 'listViewStyle'], controller: 'scripts/itemdetailpage', autoFocus: false, transition: 'fade'