diff --git a/dashboard-ui/boxset.html b/dashboard-ui/boxset.html index f7280ecbb5..0ffc3dacd6 100644 --- a/dashboard-ui/boxset.html +++ b/dashboard-ui/boxset.html @@ -34,7 +34,7 @@

-

+

diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index db8540ea90..b599e724a7 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -20,7 +20,6 @@ } .libraryPage, .itemListContent { - background: #262626!important; background: #494949 url(images/bgflip.png) repeat-x!important; background-attachment: fixed!important; } @@ -29,6 +28,10 @@ color: #fff; } +.listPage { + background: #262626!important; +} + .listHeader { margin-top: 1em; margin-bottom: 5px; @@ -106,7 +109,7 @@ @media all and (min-width: 650px) { .libraryPage .ui-content { - padding: 15px 30px 100px; + padding: 10px 15px 100px; } } @@ -158,6 +161,11 @@ padding: 0 10px; } +.itemMiscInfo { + color: #ddd; + font-size: 14px; +} + .mediaInfoStream { display: inline-block; vertical-align: top; @@ -189,6 +197,7 @@ background-color: #008FBB; padding: 3px 10px; border-bottom-left-radius: 10px; + color: #fff; } /* Firefox and Polyfill */ @@ -196,13 +205,8 @@ border: solid #222222 1px; background: #444444 !important; /* !important only needed in polyfill */ border-radius: 0!important; - height: 12px; + height: 14px; opacity: .7; - position: absolute; - left: 10%; - right: 10%; - bottom: 61px; - width: 80%; } /* Chrome */ @@ -235,3 +239,91 @@ background-image: -ms-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); background-image: -o-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); } + +.posterDetailViewItem { + background: #333; + padding: 10px 10px 3px; + margin: 3px 0; + text-shadow: none; + cursor: pointer; + font-weight: normal!important; + display: block; + font-size: 14px; + position: relative; +} + + .posterDetailViewItem .starRating { + width: 15px; + height: 13px; + } + +.posterDetailViewImage { + max-height: 90px; + max-width: 47%; +} + +.posterDetailViewItem p { + margin: .75em 0; +} + +.posterDetailViewItem .imgUserItemRating { + height: 18px; + width: 18px; +} + +.posterDetailViewContentContainer { + display: inline-block; + width: 50%; + padding-left: 10px; + color: #fff; + text-align: left; + vertical-align: top; +} + +.posterDetailViewName { + font-weight: bold; +} + +.posterDetailViewItem .userDataIcons { + display: none; +} + +@media all and (min-width: 850px) { + .posterDetailViewItem { + width: 46%; + display: inline-block; + margin-left: 3px; + margin-right: 3px; + } + + .posterDetailViewImage { + max-height: 140px; + } +} + +@media all and (min-width: 1200px) { + .posterDetailViewItem { + width: 31%; + } + + .posterDetailViewItem .userDataIcons { + display: block; + } +} + +@media all and (min-width: 1440px) { + .posterDetailViewImage { + max-height: 170px; + } +} + + +@media all and (min-width: 1920px) { + .posterDetailViewItem { + width: 31.5%; + } + + .posterDetailViewImage { + max-height: 200px; + } +} diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index 8d28c42a8a..a97ba7b273 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -472,7 +472,7 @@ form, .readOnlyContent { bottom: 28px; } -.posterViewItem:hover, .userItem:hover { +.posterViewItem:hover, .userItem:hover, .posterDetailViewItem:hover { -moz-box-shadow: 0 0 20px 3px #2572EB; -webkit-box-shadow: 0 0 20px 3px #2572EB; box-shadow: 0 0 20px 3px #2572EB; diff --git a/dashboard-ui/itembynamedetails.html b/dashboard-ui/itembynamedetails.html index 788c08292f..e1af6b459c 100644 --- a/dashboard-ui/itembynamedetails.html +++ b/dashboard-ui/itembynamedetails.html @@ -15,7 +15,7 @@
-

+

diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index d4d04b142a..2c04774928 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -36,7 +36,7 @@

-

+

diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html index b062696756..3a33281ffa 100644 --- a/dashboard-ui/movies.html +++ b/dashboard-ui/movies.html @@ -4,7 +4,7 @@ Media Browser -
+

Movies

@@ -19,6 +19,7 @@
diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 7341370cef..410c94afda 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -10,6 +10,135 @@ return 25; }, + getPosterDetailViewHtml: function (options) { + + var items = options.items; + + var primaryImageAspectRatio = options.useAverageAspectRatio ? LibraryBrowser.getAveragePrimaryImageAspectRatio(items) : null; + + var html = ''; + + for (var i = 0, length = items.length; i < length; i++) { + + var item = items[i]; + + html += ''; + + if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { + + html += ""; + + } + else if (options.preferBackdrop && item.ImageTags && item.ImageTags.Thumb) { + + html += ""; + + } + else if (item.ImageTags && item.ImageTags.Primary) { + + var height = 300; + var width = primaryImageAspectRatio ? parseInt(height * primaryImageAspectRatio) : null; + + html += ""; + + } + else if (item.BackdropImageTags && item.BackdropImageTags.length) { + html += ""; + } + else if (item.MediaType == "Audio" || item.Type == "MusicAlbum" || item.Type == "MusicArtist") { + + html += ""; + } + else if (item.MediaType == "Video" || item.Type == "Season" || item.Type == "Series") { + + html += ""; + } + else { + + html += ""; + } + + html += '
'; + + if (item.SeriesName || item.Album) { + var seriesName = item.SeriesName || item.Album; + html += '
' + seriesName + '
'; + } + + var name = item.Name; + + if (item.IndexNumber != null) { + name = item.IndexNumber + " - " + name; + } + if (item.ParentIndexNumber != null) { + name = item.ParentIndexNumber + "." + name; + } + + html += '
' + name + '
'; + + if (item.CommunityRating) { + html += '

' + LibraryBrowser.getFiveStarRatingHtml(item) + '

'; + } + + html += '

' + LibraryBrowser.getMiscInfoHtml(item, false) + '

'; + + html += '

' + LibraryBrowser.getUserDataIconsHtml(item) + '

'; + + if (item.PlayedPercentage || (item.UserData && item.UserData.PlaybackPositionTicks)) { + html += '

' + LibraryBrowser.getProgressBarHtml(item) + '

'; + } + + html += '
'; + + html += LibraryBrowser.getNewIndicatorHtml(item); + + html += "
"; + } + + return html; + }, + + getHref: function (item) { + + if (item.url) { + return item.url; + } + + if (item.Type == "Series") { + return "tvseries.html?id=" + item.Id; + } + if (item.Type == "BoxSet") { + return "boxset.html?id=" + item.Id; + } + + return item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemdetails.html?id=" + item.Id; + + }, + getPosterViewHtml: function (options) { var items = options.items; @@ -23,13 +152,11 @@ var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary; - var href = item.url || (item.IsFolder ? (item.Id ? "itemList.html?parentId=" + item.Id : "#") : "itemdetails.html?id=" + item.Id); - var showText = options.showTitle || !hasPrimaryImage; var cssClass = showText ? "posterViewItem" : "posterViewItem posterViewItemWithNoText"; - html += "
"; + html += "
"; if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { html += ""; + html += "
"; if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { html += ""; + html += ""; - } - - return html; - }, - getNewIndicatorHtml: function (item) { if (item.RecentlyAddedItemCount) { @@ -346,11 +383,20 @@ getProgressBarHtml: function (item) { - return ''; var html = ''; - if (item.PlayedPercentage && item.PlayedPercentage < 100) { - html += ''; + var tooltip; + + if (item.PlayedPercentage) { + + tooltip = parseInt(item.PlayedPercentage) + '% watched'; + html += ''; + } + else if (item.UserData && item.UserData.PlaybackPositionTicks && item.RunTimeTicks) { + + tooltip = DashboardPage.getDisplayText(item.UserData.PlaybackPositionTicks) + " / " + DashboardPage.getDisplayText(item.RunTimeTicks); + + html += ''; } return html; @@ -504,6 +550,26 @@ return html; }, + getFiveStarRatingHtml: function (item) { + + var rating = item.CommunityRating / 2; + + var html = ""; + for (var i = 1; i <= 5; i++) { + if (rating < i - 1) { + html += "
"; + } + else if (rating < i) { + html += "
"; + } + else { + html += "
"; + } + } + + return html; + }, + getUserDataIconsHtml: function (item) { var html = ''; @@ -515,29 +581,29 @@ if (item.MediaType) { if (userData.Played) { - html += 'Played'; + html += 'Played'; } else { - html += 'Played'; + html += 'Played'; } } if (typeof userData.Likes == "undefined") { - html += 'Dislike'; - html += 'Like'; + html += 'Dislike'; + html += 'Like'; } else if (userData.Likes) { - html += 'Dislike'; - html += 'Like'; + html += 'Dislike'; + html += 'Like'; } else { - html += 'Dislike'; - html += 'Like'; + html += 'Dislike'; + html += 'Like'; } if (userData.IsFavorite) { - html += 'Favorite'; + html += 'Favorite'; } else { - html += 'Favorite'; + html += 'Favorite'; } return html; @@ -720,7 +786,7 @@ return html; }, - getMiscInfoHtml: function (item) { + getMiscInfoHtml: function (item, includeMediaInfo) { var miscInfo = []; @@ -741,13 +807,16 @@ miscInfo.push(parseInt(minutes) + "min"); } - if (item.DisplayMediaType) { - miscInfo.push(item.DisplayMediaType); + if (includeMediaInfo !== false) { + if (item.DisplayMediaType) { + miscInfo.push(item.DisplayMediaType); + } + + if (item.VideoFormat && item.VideoFormat !== 'Standard') { + miscInfo.push(item.VideoFormat); + } } - if (item.VideoFormat && item.VideoFormat !== 'Standard') { - miscInfo.push(item.VideoFormat); - } return miscInfo.join('     '); }, diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index 6aa6b44bd4..c3dec5fe79 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -1,6 +1,6 @@ (function ($, document) { - var view = "Poster"; + var view = "Tile"; // The base query options var query = { @@ -118,7 +118,7 @@ function reloadItems(page) { Dashboard.showLoadingMsg(); - + ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { var html = ''; @@ -129,7 +129,14 @@ html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); } - if (view == "Poster") { + if (view == "Tile") { + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + useAverageAspectRatio: true, + preferBackdrop: true + }); + } + else if (view == "Poster") { html += LibraryBrowser.getPosterViewHtml({ items: result.Items, useAverageAspectRatio: true @@ -150,7 +157,7 @@ elem.html(html).trigger('create'); - $('select', elem).on('change', function() { + $('select', elem).on('change', function () { query.StartIndex = (parseInt(this.value) - 1) * query.Limit; reloadItems(page); }); diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 7fa337de84..fb596ff90b 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -1,5 +1,7 @@ (function ($, document) { + var view = "Tile"; + // The base query options var query = { @@ -7,91 +9,57 @@ SortOrder: "Ascending", IncludeItemTypes: "Series", Recursive: true, - Fields: "PrimaryImageAspectRatio,SeriesInfo,ItemCounts,DateCreated" + Fields: "PrimaryImageAspectRatio,SeriesInfo,ItemCounts,DateCreated", + Limit: LibraryBrowser.getDetaultPageSize(), + StartIndex: 0 }; - function getTableHtml(items) { - - var html = '
'; - - html += ''; - - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - html += ''; - - html += ''; - - html += ''; - - for (var i = 0, length = items.length; i < length; i++) { - - html += getRowHtml(items[i]); - } - - html += ''; - - html += '
 NameYearOfficial RatingRuntimeCommunity Rating
'; - - return html; - } - - function getRowHtml(item) { - - var html = ''; - - html += ''; - - var url = "tvseries.html?id=" + item.Id; - - var imageTags = item.ImageTags; - - html += ''; - - if (imageTags.Primary) { - - html += ''; - - } - else { - html += ''; - } - - html += ''; - - html += '' + item.Name + ''; - - html += '' + (item.ProductionYear || "") + ''; - - html += '' + (item.OfficialRating || "") + ''; - html += '' + (item.RunTimeTicks || "") + ''; - html += '' + (item.CommunityRating || "") + ''; - - html += ''; - return html; - } - function reloadItems(page) { Dashboard.showLoadingMsg(); ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) { - $('#items', page).html(LibraryBrowser.getSeriesPosterViewHtml({ + var html = ''; - items: result.Items, - useAverageAspectRatio: true + var showPaging = result.TotalRecordCount > query.Limit; - }))/*.html(getTableHtml(result.Items)).trigger('create')*/; + if (showPaging) { + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + } + + if (view == "Tile") { + html += LibraryBrowser.getPosterDetailViewHtml({ + items: result.Items, + useAverageAspectRatio: true, + preferBackdrop: true + }); + } + else if (view == "Poster") { + html += LibraryBrowser.getPosterViewHtml({ + items: result.Items, + useAverageAspectRatio: true + }); + } + else if (view == "Grid") { + html += getTableHtml(result); + } + + if (showPaging) { + html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount); + } + + var elem = $('#items', page); + + // cleanup existing event handlers + $('select', elem).off('change'); + + elem.html(html).trigger('create'); + + $('select', elem).on('change', function () { + query.StartIndex = (parseInt(this.value) - 1) * query.Limit; + reloadItems(page); + }); Dashboard.hideLoadingMsg(); }); @@ -159,6 +127,13 @@ reloadItems(page); }); + $('#selectView', this).on('change', function () { + + view = this.value; + + reloadItems(page); + }); + }).on('pagebeforeshow', "#tvShowsPage", function () { reloadItems(this); @@ -204,6 +179,8 @@ this.checked = filters.indexOf(',' + filterName) != -1; }).checkboxradio('refresh'); + + $('#selectView', this).val(view).selectmenu('refresh'); }); })(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/tvseries.html b/dashboard-ui/tvseries.html index 4147dc87f0..37ca6ef7e2 100644 --- a/dashboard-ui/tvseries.html +++ b/dashboard-ui/tvseries.html @@ -31,7 +31,7 @@

-

+

diff --git a/dashboard-ui/tvshows.html b/dashboard-ui/tvshows.html index c9f4adcd61..e0546805c3 100644 --- a/dashboard-ui/tvshows.html +++ b/dashboard-ui/tvshows.html @@ -4,7 +4,7 @@ Media Browser -
+

TV Shows

@@ -15,6 +15,12 @@ Actors
+
+ +