diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 943b1857b..6fb226cf0 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -221,7 +221,7 @@ background-size: cover; vertical-align: top; position: relative; - top: -1px; + top: -2px; } .halfStarRating { @@ -232,6 +232,13 @@ background-position: right center; } +.starRatingValue { + display: inline-block; + margin-left: 1px; + position: relative; + top: -2px; +} + .rottentomatoesicon { display: inline-block; width: 17px; @@ -241,17 +248,13 @@ background-repeat: no-repeat; vertical-align: top; position: relative; - top: -1px; + top: -2px; } -.starRating + .rottentomatoesicon { +.starRatingValue + .rottentomatoesicon { margin-left: 1em; } -.smallPosterTileItem .starRating + .rottentomatoesicon { - margin-left: .5em; -} - .fresh { background-image: url(images/fresh.png); } @@ -260,6 +263,36 @@ background-image: url(images/rotten.png); } +.metascore { + font-family: Arial; + color: #fff; + font-weight: bold; + display: inline-block; + font-size: 12px; + text-align: center; + width: 24px; + height: 20px; + line-height: 20px; + position: relative; + top: -2px; +} + +.metascorehigh { + background-color: rgba(102, 204, 51, .75); +} + +.metascoremid { + background-color: rgba(255, 204, 51, .75); +} + +.metascorelow { + background-color: rgba(240, 0, 0, .75); +} + +.criticRating + .metascore, .starRatingValue + .metascore { + margin-left: 1em; +} + .criticReview { margin: 1.5em 0; background: #222; @@ -277,11 +310,10 @@ } .criticRating { - color: #ccc; - vertical-align: top; - margin-left: 5px; display: inline-block; - vertical-align: top; + margin-left: 1px; + position: relative; + top: -2px; } .criticRatingSummary { @@ -346,7 +378,7 @@ a.itemTag:hover { } .itemCommunityRating + .userDataIcons { - margin-left: 1.5em; + margin-left: 1.25em; } .itemBackdrop { diff --git a/dashboard-ui/css/posteritem.css b/dashboard-ui/css/posteritem.css index 01e8b6695..ce1cededa 100644 --- a/dashboard-ui/css/posteritem.css +++ b/dashboard-ui/css/posteritem.css @@ -14,10 +14,25 @@ transition: all 500ms ease; } -.posterItemOverlayTarget { +/*.posterItemOverlayTarget { position: absolute; right: 0; top: 50%; + z-index: 999; +}*/ + +.posterItemOverlayTarget { + position: absolute; + right: 0; + left: 0; + bottom: 0; + background: #111; + z-index: 999; + display: none; +} + +.posterItemOverlayInner { + padding: 15px; } .smallBackdropPosterItem, .smallPosterItem { diff --git a/dashboard-ui/edititemmetadata.html b/dashboard-ui/edititemmetadata.html index adb7ad3dc..93c192de1 100644 --- a/dashboard-ui/edititemmetadata.html +++ b/dashboard-ui/edititemmetadata.html @@ -100,12 +100,16 @@ + +
diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html index b4709f50d..47326226e 100644 --- a/dashboard-ui/movies.html +++ b/dashboard-ui/movies.html @@ -63,6 +63,9 @@ + + + diff --git a/dashboard-ui/scripts/dashboardpage.js b/dashboard-ui/scripts/dashboardpage.js index 8b2e2ab91..2787fe3e5 100644 --- a/dashboard-ui/scripts/dashboardpage.js +++ b/dashboard-ui/scripts/dashboardpage.js @@ -501,7 +501,7 @@ html += '

A new version of ' + update.name + ' is available!

'; - html += ''; + html += ''; } elem.html(html).trigger('create'); diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index 3ed423582..09858c63c 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -585,6 +585,18 @@ $('#fldRottenTomatoes', page).hide(); } + if (item.Type == "Movie") { + $('#fldAwardSummary', page).show(); + } else { + $('#fldAwardSummary', page).hide(); + } + + if (item.Type == "Movie" || item.Type == "Trailer") { + $('#fldMetascore', page).show(); + } else { + $('#fldMetascore', page).hide(); + } + if (item.Type == "Movie" || item.Type == "Trailer" || item.Type == "Person" || item.Type == "BoxSet" || item.Type == "MusicAlbum") { $('#fldTmdb', page).show(); } else { @@ -859,6 +871,9 @@ $('#txtCommunityVoteCount', page).val(item.VoteCount || ""); $('#txtHomePageUrl', page).val(item.HomePageUrl || ""); + $('#txtAwardSummary', page).val(item.AwardSummary || ""); + $('#txtMetascore', page).val(item.Metascore || ""); + $('#txtBudget', page).val(item.Budget || ""); $('#txtRevenue', page).val(item.Revenue || ""); @@ -1153,6 +1168,8 @@ Album: $('#txtAlbum', form).val(), AlbumArtist: $('#txtAlbumArtist', form).val(), Artists: $('#txtArtist', form).val().split(';'), + Metascore: $('#txtMetascore', form).val(), + AwardSummary: $('#txtAwardSummary', form).val(), Overview: $('#txtOverview', form).val(), Status: $('#selectStatus', form).val(), AirDays: editableListViewValues($("#listAirDays", form)), diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js index 7c53ddb15..838c4a3e6 100644 --- a/dashboard-ui/scripts/episodes.js +++ b/dashboard-ui/scripts/episodes.js @@ -44,7 +44,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; diff --git a/dashboard-ui/scripts/extensions.js b/dashboard-ui/scripts/extensions.js index 98d572d10..1772df5a1 100644 --- a/dashboard-ui/scripts/extensions.js +++ b/dashboard-ui/scripts/extensions.js @@ -407,4 +407,57 @@ function ticks_to_human(str) { time += ":" + seconds.substr(-2); return time; -}; \ No newline at end of file +}; + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +(function () { + + // based on easing equations from Robert Penner (http://www.robertpenner.com/easing) + + var baseEasings = {}; + + $.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function (i, name) { + baseEasings[name] = function (p) { + return Math.pow(p, i + 2); + }; + }); + + $.extend(baseEasings, { + Sine: function (p) { + return 1 - Math.cos(p * Math.PI / 2); + }, + Circ: function (p) { + return 1 - Math.sqrt(1 - p * p); + }, + Elastic: function (p) { + return p === 0 || p === 1 ? p : + -Math.pow(2, 8 * (p - 1)) * Math.sin(((p - 1) * 80 - 7.5) * Math.PI / 15); + }, + Back: function (p) { + return p * p * (3 * p - 2); + }, + Bounce: function (p) { + var pow2, + bounce = 4; + + while (p < ((pow2 = Math.pow(2, --bounce)) - 1) / 11) { } + return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow((pow2 * 3 - 2) / 22 - p, 2); + } + }); + + $.each(baseEasings, function (name, easeIn) { + $.easing["easeIn" + name] = easeIn; + $.easing["easeOut" + name] = function (p) { + return 1 - easeIn(1 - p); + }; + $.easing["easeInOut" + name] = function (p) { + return p < 0.5 ? + easeIn(p * 2) / 2 : + 1 - easeIn(p * -2 + 2) / 2; + }; + }); + +})(); \ No newline at end of file diff --git a/dashboard-ui/scripts/gamespage.js b/dashboard-ui/scripts/gamespage.js index 6b8b78023..0a4b8a725 100644 --- a/dashboard-ui/scripts/gamespage.js +++ b/dashboard-ui/scripts/gamespage.js @@ -41,7 +41,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js index 1ec3a34bb..e678d9c0e 100644 --- a/dashboard-ui/scripts/itembynamedetailpage.js +++ b/dashboard-ui/scripts/itembynamedetailpage.js @@ -436,7 +436,8 @@ shape: "portrait", context: 'movies', useAverageAspectRatio: true, - showTitle: true + showTitle: true, + centerText: true }); } @@ -485,7 +486,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 0ee9ce182..9972fddf4 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -470,6 +470,7 @@ useAverageAspectRatio: item.MediaType != "Game", shape: item.Type == "MusicAlbum" ? "square" : "portrait", showParentTitle: item.Type == "MusicAlbum", + centerText: item.Type != "MusicAlbum", showTitle: item.Type == "MusicAlbum" || item.Type == "Game", borderless: item.Type == "Game" }); @@ -588,7 +589,8 @@ items: result.Items, shape: "portrait", useAverageAspectRatio: true, - showTitle: true + showTitle: true, + centerText: true }); } else if (item.Type == "Season") { @@ -606,7 +608,8 @@ shape: "auto", context: 'games', useAverageAspectRatio: false, - showTitle: true + showTitle: true, + centerText: true }); } else { @@ -619,7 +622,7 @@ }); } - $('#childrenContent', page).html(html); + $('#childrenContent', page).html(html).createPosterItemHoverMenu(); } }); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 5632810b5..d1c4c0913 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -916,12 +916,12 @@ imageCssClass += " coveredPosterItemImage"; } - html += '
'; - var progressHtml = LibraryBrowser.getItemProgressBarHtml(item); html += '
'; + html += '
'; + if (item.LocationType == "Offline" || item.LocationType == "Virtual") { if (options.showLocationTypeIndicator !== false) { html += LibraryBrowser.getOfflineIndicatorHtml(item); @@ -1503,19 +1503,25 @@ var html = ""; if (item.CommunityRating) { - var rating = item.CommunityRating / 2; - for (var i = 1; i <= 5; i++) { - if (rating <= i - 1) { - html += "
"; - } - else if (rating < i) { - html += "
"; - } - else { - html += "
"; - } - } + html += "
"; + html += '
'; + html += item.CommunityRating.toFixed(1); + html += '
'; + + //var rating = item.CommunityRating / 2; + + //for (var i = 1; i <= 5; i++) { + // if (rating <= i - 1) { + // html += "
"; + // } + // else if (rating < i) { + // html += "
"; + // } + // else { + // html += "
"; + // } + //} } if (item.CriticRating != null) { @@ -1529,6 +1535,18 @@ html += '
' + item.CriticRating + '%
'; } + if (item.Metascore) { + + if (item.Metascore >= 60) { + html += '
' + item.Metascore + '
'; + } + else if (item.Metascore >= 40) { + html += '
' + item.Metascore + '
'; + } else { + html += '
' + item.Metascore + '
'; + } + } + return html; }, @@ -1536,10 +1554,10 @@ if (item.Type == "Recording" && item.CompletionPercentage) { - + return ''; } - + if (item.UserData && item.UserData.PlaybackPositionTicks && item.RunTimeTicks) { var tooltip = Dashboard.getDisplayTime(item.UserData.PlaybackPositionTicks) + " / " + Dashboard.getDisplayTime(item.RunTimeTicks); @@ -2503,7 +2521,7 @@ var popup = $('.itemFlyout').on('mouseenter', onOverlayMouseOver).on('mouseleave', onOverlayMouseOut).popup({ positionTo: $('.posterItemOverlayTarget', elem) - + }).trigger('create').popup("open").on("popupafterclose", function () { $(this).off("popupafterclose").off("mouseenter").off("mouseleave").remove(); @@ -2594,11 +2612,11 @@ onShowTimerExpired(elem); - }, 500); + }, 300); } // https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/ - + if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) { /* browser with either Touch Events of Pointer Events running on touch-capable device */ @@ -2612,3 +2630,120 @@ })(jQuery, document, window); +(function ($, document, window) { + + var showOverlayTimeout; + + function onHoverOut() { + + if (showOverlayTimeout) { + clearTimeout(showOverlayTimeout); + showOverlayTimeout = null; + } + + $('.posterItemOverlayTarget:visible', this).each(function () { + + var elem = this; + + $(this).animate({ "height": "0" }, function () { + + $(elem).hide(); + + }); + + }); + + $('.posterItemOverlayTarget:visible', this).stop().animate({ "height": "0" }, function () { + + $(this).hide(); + + }); + } + + function getOverlayHtml(item) { + + var html = ''; + + html += '
'; + + html += '
'; + html += LibraryBrowser.getPosterViewDisplayName(item, true); + html += '
'; + + //html += '

'; + //html += LibraryBrowser.getMiscInfoHtml(item); + //html += '

'; + + //html += '

'; + //html += ''; + //html += LibraryBrowser.getRatingHtml(item); + //html += ''; + //html += '

'; + + html += '

'; + html += ''; + html += LibraryBrowser.getUserDataIconsHtml(item); + html += ''; + html += '

'; + + //html += '

'; + //html += (item.OverviewHtml || item.Overview || ''); + //html += '

'; + + html += ''; + html += ''; + html += ''; + html += ''; + + html += '
'; + + return html; + } + + $.fn.createPosterItemHoverMenu = function () { + + function onShowTimerExpired(elem) { + + var innerElem = $('.posterItemOverlayTarget', elem); + var id = elem.getAttribute('data-itemid'); + + ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { + + innerElem.html(getOverlayHtml(item)).trigger('create'); + }); + + innerElem.show().each(function () { + + this.style.height = 0; + + }).animate({ "height": "100%" }); + } + + function onHoverIn() { + + if (showOverlayTimeout) { + clearTimeout(showOverlayTimeout); + showOverlayTimeout = null; + } + + var elem = this; + + showOverlayTimeout = setTimeout(function () { + + onShowTimerExpired(elem); + + }, 300); + } + + // https://hacks.mozilla.org/2013/04/detecting-touch-its-the-why-not-the-how/ + + if (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)) { + /* browser with either Touch Events of Pointer Events + running on touch-capable device */ + return this; + } + + return this.on('mouseenter', '.posterItem', onHoverIn).on('mouseleave', '.posterItem', onHoverOut); + }; + +})(jQuery, document, window); \ No newline at end of file diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js index 874e12697..d3a193815 100644 --- a/dashboard-ui/scripts/moviecollections.js +++ b/dashboard-ui/scripts/moviecollections.js @@ -40,7 +40,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index 6f69a9bfe..c656b3dc6 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -66,7 +66,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; diff --git a/dashboard-ui/scripts/movietrailers.js b/dashboard-ui/scripts/movietrailers.js index 36e6bb1ef..3c57ed440 100644 --- a/dashboard-ui/scripts/movietrailers.js +++ b/dashboard-ui/scripts/movietrailers.js @@ -40,7 +40,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index ade6a9ec9..f5cd211d3 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -70,7 +70,7 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); - $('#items', page).html(html).trigger('create'); + $('#items', page).html(html).trigger('create').createPosterItemHoverMenu(); $('.selectPage', page).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; diff --git a/dashboard-ui/scripts/tvupcoming.js b/dashboard-ui/scripts/tvupcoming.js index 752a8f49d..014a87bda 100644 --- a/dashboard-ui/scripts/tvupcoming.js +++ b/dashboard-ui/scripts/tvupcoming.js @@ -58,7 +58,7 @@ showPremiereDate: true, showPremiereDateIndex: true, preferThumb: true - })); + })).createPosterItemHoverMenu(); }); });