From 4457c0b81821988cb5b2ae280b5b9fa911643c35 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 28 Apr 2013 14:30:58 -0400 Subject: [PATCH 1/4] renamed video backdrops to theme videos --- ApiClient.js | 4 ++-- dashboard-ui/css/posteritem.css | 2 +- dashboard-ui/itemdetails.html | 6 +++--- dashboard-ui/scripts/Itemdetailpage.js | 12 ++++++------ dashboard-ui/scripts/gamesrecommendedpage.js | 6 ++++-- dashboard-ui/scripts/librarybrowser.js | 19 +++++++++++++++++-- packages.config | 2 +- 7 files changed, 34 insertions(+), 17 deletions(-) diff --git a/ApiClient.js b/ApiClient.js index 9999c0fe0f..3c53077836 100644 --- a/ApiClient.js +++ b/ApiClient.js @@ -1733,7 +1733,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { }); }; - self.getVideoBackdrops = function (userId, itemId) { + self.getThemeVideos = function (userId, itemId) { if (!userId) { throw new Error("null userId"); @@ -1742,7 +1742,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) { throw new Error("null itemId"); } - var url = self.getUrl("Users/" + userId + "/Items/" + itemId + "/VideoBackdrops"); + var url = self.getUrl("Users/" + userId + "/Items/" + itemId + "/ThemeVideos"); return self.ajax({ type: "GET", diff --git a/dashboard-ui/css/posteritem.css b/dashboard-ui/css/posteritem.css index 93646f2ad5..1ea96a043b 100644 --- a/dashboard-ui/css/posteritem.css +++ b/dashboard-ui/css/posteritem.css @@ -21,7 +21,7 @@ background-size: contain; background-repeat: no-repeat; background-position: center bottom; - background-color: #000; + background-color: #333; } .transparentPosterItem .posterItemImage { diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index f429743365..d4f06c06b1 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -171,9 +171,9 @@
-
diff --git a/dashboard-ui/scripts/Itemdetailpage.js b/dashboard-ui/scripts/Itemdetailpage.js index c8f1471999..0cb677d2f6 100644 --- a/dashboard-ui/scripts/Itemdetailpage.js +++ b/dashboard-ui/scripts/Itemdetailpage.js @@ -221,14 +221,14 @@ } $('#themeSongsCollapsible', page).hide(); - $('#videoBackdropsCollapsible', page).hide(); + $('#themeVideosCollapsible', page).hide(); ApiClient.getThemeSongs(Dashboard.getCurrentUserId(), item.Id).done(function (result) { renderThemeSongs(page, item, result); }); - ApiClient.getVideoBackdrops(Dashboard.getCurrentUserId(), item.Id).done(function (result) { - renderVideoBackdrops(page, item, result); + ApiClient.getThemeVideos(Dashboard.getCurrentUserId(), item.Id).done(function (result) { + renderThemeVideos(page, item, result); }); } @@ -315,13 +315,13 @@ } } - function renderVideoBackdrops(page, item, result) { + function renderThemeVideos(page, item, result) { if (result.Items.length) { - $('#videoBackdropsCollapsible', page).show(); + $('#themeVideosCollapsible', page).show(); - $('#videoBackdropsContent', page).html(getVideosHtml(result.Items)).trigger('create'); + $('#themeVideosContent', page).html(getVideosHtml(result.Items)).trigger('create'); } } diff --git a/dashboard-ui/scripts/gamesrecommendedpage.js b/dashboard-ui/scripts/gamesrecommendedpage.js index 37f77492e1..62ebfc51c5 100644 --- a/dashboard-ui/scripts/gamesrecommendedpage.js +++ b/dashboard-ui/scripts/gamesrecommendedpage.js @@ -20,7 +20,8 @@ $('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({ items: result.Items, useAverageAspectRatio: true, - showNewIndicator: false + showNewIndicator: false, + transparent: true })); }); @@ -40,7 +41,8 @@ $('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({ items: result.Items, - useAverageAspectRatio: true + useAverageAspectRatio: true, + transparent: true })); }); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index d5b60c11fc..8a50cb4d1c 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -163,6 +163,12 @@ html += '

' + childText + '

'; } + else if (item.Type == "GamePlatform") { + + childText = item.ChildCount == 1 ? "1 Game" : item.ChildCount + " Games"; + + html += '

' + childText + '

'; + } else if (item.Type == "MusicAlbum") { childText = item.ChildCount == 1 ? "1 Song" : item.ChildCount + " Songs"; @@ -425,7 +431,16 @@ } } - html += ''; + + var cssClass = "posterItem"; + + if (options.transparent) { + cssClass += " transparentPosterItem"; + } + + cssClass += ' ' + options.shape + 'PosterItem'; + + html += ''; var style = ""; @@ -1093,7 +1108,7 @@ else { url = "css/images/items/detail/video.png"; useBackgroundColor = true; - maxwidth = 150; + maxwidth = 150;p } if (url) { diff --git a/packages.config b/packages.config index 56ad5f6568..ef2a6b2f1d 100644 --- a/packages.config +++ b/packages.config @@ -1,6 +1,6 @@  - + \ No newline at end of file From 045ad64eb5fe4f5576413dcdd44425326f8d1b02 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 28 Apr 2013 14:39:38 -0400 Subject: [PATCH 2/4] better game context --- dashboard-ui/css/posteritem.css | 2 +- dashboard-ui/itembynamedetails.html | 18 ++++++++++++++++++ dashboard-ui/scripts/itembynamedetailpage.js | 6 ++++++ dashboard-ui/scripts/librarybrowser.js | 3 +++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/dashboard-ui/css/posteritem.css b/dashboard-ui/css/posteritem.css index 1ea96a043b..93646f2ad5 100644 --- a/dashboard-ui/css/posteritem.css +++ b/dashboard-ui/css/posteritem.css @@ -21,7 +21,7 @@ background-size: contain; background-repeat: no-repeat; background-position: center bottom; - background-color: #333; + background-color: #000; } .transparentPosterItem .posterItemImage { diff --git a/dashboard-ui/itembynamedetails.html b/dashboard-ui/itembynamedetails.html index 874d54f020..e3f90be280 100644 --- a/dashboard-ui/itembynamedetails.html +++ b/dashboard-ui/itembynamedetails.html @@ -91,6 +91,24 @@ Genres + +
diff --git a/dashboard-ui/scripts/itembynamedetailpage.js b/dashboard-ui/scripts/itembynamedetailpage.js index 837c8c6f23..b4d6cd6020 100644 --- a/dashboard-ui/scripts/itembynamedetailpage.js +++ b/dashboard-ui/scripts/itembynamedetailpage.js @@ -126,6 +126,12 @@ if (context == "music" && item.Type == "Artist") { $('#artistTabs', page).show(); } + if (context == "games" && item.Type == "Genre") { + $('#gameGenreTabs', page).show(); + } + if (context == "games" && item.Type == "Studio") { + $('#gameStudioTabs', page).show(); + } } function renderTabs(page, item) { diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 8a50cb4d1c..443246d325 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -317,6 +317,9 @@ if (item.Type == "Artist") { return "itembynamedetails.html?artist=" + encodeName(item.Name) + "&context=" + (itemByNameContext || "music"); } + if (item.Type == "GamePlatform") { + return "gamesystem.html?id=" + id; + } return item.IsFolder ? (id ? "itemList.html?parentId=" + id : "#") : "itemdetails.html?id=" + id; From d95f783686f7c2fd8bbe52667eecceca35b5fb9e Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 28 Apr 2013 14:42:54 -0400 Subject: [PATCH 3/4] use regular detail page for game systems --- dashboard-ui/gamesystem.html | 45 ---------------------- dashboard-ui/scripts/gamesystempage.js | 53 -------------------------- dashboard-ui/scripts/librarybrowser.js | 6 +-- 3 files changed, 3 insertions(+), 101 deletions(-) delete mode 100644 dashboard-ui/gamesystem.html delete mode 100644 dashboard-ui/scripts/gamesystempage.js diff --git a/dashboard-ui/gamesystem.html b/dashboard-ui/gamesystem.html deleted file mode 100644 index 0b5b9086cf..0000000000 --- a/dashboard-ui/gamesystem.html +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - -
-

- Games

-
- - - -
-
-
-
-
-
- -
- -

-

-

-

-

-

- -

-

- -
-
- -
-
- - diff --git a/dashboard-ui/scripts/gamesystempage.js b/dashboard-ui/scripts/gamesystempage.js deleted file mode 100644 index 314f256546..0000000000 --- a/dashboard-ui/scripts/gamesystempage.js +++ /dev/null @@ -1,53 +0,0 @@ - -(function ($, document, LibraryBrowser) { - - function reload(page) { - - var id = getParameterByName('id'); - - Dashboard.showLoadingMsg(); - - ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { - - var name = item.Name; - - $('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item)); - - Dashboard.setPageTitle(name); - - $('#itemName', page).html(name); - - renderDetails(page, item); - - Dashboard.hideLoadingMsg(); - }); - } - - function renderDetails(page, item) { - - LibraryBrowser.renderOverview($('#itemOverview', page), item); - - if (item.CommunityRating) { - $('#itemCommunityRating', page).html(LibraryBrowser.getStarRatingHtml(item)).show().attr('title', item.CommunityRating); - } else { - $('#itemCommunityRating', page).hide(); - } - - $('#itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item)); - - LibraryBrowser.renderGenres($('#itemGenres', page), item, "games"); - LibraryBrowser.renderStudios($('#itemStudios', page), item, "games"); - renderUserDataIcons(page, item); - LibraryBrowser.renderLinks($('#itemLinks', page), item); - } - - function renderUserDataIcons(page, item) { - $('#itemRatings', page).html(LibraryBrowser.getUserDataIconsHtml(item)); - } - - $(document).on('pageshow', "#gamesystemPage", function () { - reload(this); - }); - - -})(jQuery, document, LibraryBrowser); \ No newline at end of file diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 443246d325..afbb0c7131 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -305,6 +305,9 @@ if (item.Type == "MusicAlbum") { return "itemdetails.html?id=" + id; } + if (item.Type == "GamePlatform") { + return "itemdetails.html?id=" + id; + } if (item.Type == "Genre") { return "itembynamedetails.html?genre=" + encodeName(item.Name) + "&context=" + itemByNameContext; } @@ -317,9 +320,6 @@ if (item.Type == "Artist") { return "itembynamedetails.html?artist=" + encodeName(item.Name) + "&context=" + (itemByNameContext || "music"); } - if (item.Type == "GamePlatform") { - return "gamesystem.html?id=" + id; - } return item.IsFolder ? (id ? "itemList.html?parentId=" + id : "#") : "itemdetails.html?id=" + id; From 358830d05051a6dd45498550f0ca8baee9c519a5 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 28 Apr 2013 14:47:19 -0400 Subject: [PATCH 4/4] game context on detail page --- dashboard-ui/itemdetails.html | 23 ++++++++++++------ dashboard-ui/scripts/Itemdetailpage.js | 33 +++++++++++++------------- 2 files changed, 33 insertions(+), 23 deletions(-) diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index d4f06c06b1..9c736475b1 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -12,7 +12,7 @@

-