From 4318490be20057529ae9de500e7cc0ce3254e5ea Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 5 Jul 2014 12:51:39 -0400 Subject: [PATCH] fixes #834 - Change view of TV Shows or Interface for plugins --- dashboard-ui/css/icons.css | 13 ++++ dashboard-ui/css/images/icons/ellipsis-v.png | Bin 0 -> 252 bytes dashboard-ui/css/librarybrowser.css | 34 ++++++++++ dashboard-ui/movies.html | 1 + dashboard-ui/musicalbums.html | 1 + dashboard-ui/scripts/itemdetailpage.js | 2 +- dashboard-ui/scripts/librarybrowser.js | 66 ++++++++++++++++++- dashboard-ui/scripts/librarylist.js | 54 ++------------- dashboard-ui/scripts/librarymenu.js | 4 +- dashboard-ui/scripts/movies.js | 8 +++ dashboard-ui/scripts/musicalbums.js | 8 +++ dashboard-ui/scripts/tvshows.js | 8 +++ dashboard-ui/tvshows.html | 1 + 13 files changed, 146 insertions(+), 54 deletions(-) create mode 100644 dashboard-ui/css/images/icons/ellipsis-v.png diff --git a/dashboard-ui/css/icons.css b/dashboard-ui/css/icons.css index 4ca87ca627..4739609e54 100644 --- a/dashboard-ui/css/icons.css +++ b/dashboard-ui/css/icons.css @@ -140,3 +140,16 @@ .ui-nosvg .ui-icon-remote:after { background-image: url("images/icons/remote.png"); } + + +.ui-icon-ellipsis-v:after { + background-image: url("data:image/svg+xml;charset=US-ASCII,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3C!DOCTYPE%20svg%20PUBLIC%20%22-%2F%2FW3C%2F%2FDTD%20SVG%201.1%20Tiny%2F%2FEN%22%20%22http%3A%2F%2Fwww.w3.org%2FGraphics%2FSVG%2F1.1%2FDTD%2Fsvg11-tiny.dtd%22%3E%3Csvg%20version%3D%221.1%22%20baseProfile%3D%22tiny%22%20id%3D%22Layer_1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20width%3D%2216px%22%20height%3D%2216px%22%20viewBox%3D%220%200%20500%20500%22%20xml%3Aspace%3D%22preserve%22%3E%20%3Cpath%20d%3D%22M107.143%20348.214v53.571q0%2011.161-7.813%2018.973t-18.973%207.813h-53.571q-11.161%200-18.973-7.813t-7.813-18.973v-53.571q0-11.161%207.813-18.973t18.973-7.813h53.571q11.161%200%2018.973%207.813t7.813%2018.973zM107.143%20205.357v53.571q0%2011.161-7.813%2018.973t-18.973%207.813h-53.571q-11.161%200-18.973-7.813t-7.813-18.973v-53.571q0-11.161%207.813-18.973t18.973-7.813h53.571q11.161%200%2018.973%207.813t7.813%2018.973zM107.143%2062.5v53.571q0%2011.161-7.813%2018.973t-18.973%207.813h-53.571q-11.161%200-18.973-7.813t-7.813-18.973v-53.571q0-11.161%207.813-18.973t18.973-7.813h53.571q11.161%200%2018.973%207.813t7.813%2018.973z%22%20fill%3D%22%23ffffff%22%20%2F%3E%3C%2Fsvg%3E"); + background-repeat: no-repeat; + background-position: 9px 3px; +} + +/* Fallback */ +.ui-nosvg .ui-icon-ellipsis-v:after { + background-image: url("images/icons/ellipsis-v.png"); + background-repeat: no-repeat; +} diff --git a/dashboard-ui/css/images/icons/ellipsis-v.png b/dashboard-ui/css/images/icons/ellipsis-v.png new file mode 100644 index 0000000000000000000000000000000000000000..226ab6fb6a6f1ce5e85a238d5ac4752f52a8f5e9 GIT binary patch literal 252 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ za0`PlBg3pY5rKjra4xW@}o5Sy~X2|u=@%JoaSf}DWeZdml21$mAG44lJ tnjBg$zjBV6u{lE&L#&HTThssZ(jSwOwk|YecL%zZ!PC{xWt~$(69Ap`R{8({ literal 0 HcmV?d00001 diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index 3193ce4149..98d5d8a8d8 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -1247,3 +1247,37 @@ a.itemTag:hover { max-height: 500px; } } + +.itemsListview { + max-width: 800px; + margin: 0 auto!important; +} + + .itemsListview .ui-li-aside { + right: 1.5em; + font-weight: normal; + font-size: 13px; + font-family: "Open Sans"; + } + + .itemsListview .ui-li-count { + right: 1.2em; + top: 70%; + background: rgba(82, 181, 75, .8); + border: 0; + } + +.listviewImage { + width: 80px; + height: 80px; + background-repeat: no-repeat; + background-size: cover; + background-position: center center; +} + +@media all and (max-width: 600px) { + + .itemsListview .ui-li-aside { + display: none; + } +} diff --git a/dashboard-ui/movies.html b/dashboard-ui/movies.html index cf4ee9a8a8..f34e9aa782 100644 --- a/dashboard-ui/movies.html +++ b/dashboard-ui/movies.html @@ -26,6 +26,7 @@ + diff --git a/dashboard-ui/musicalbums.html b/dashboard-ui/musicalbums.html index 4a1ec3aa88..53f5507fb2 100644 --- a/dashboard-ui/musicalbums.html +++ b/dashboard-ui/musicalbums.html @@ -22,6 +22,7 @@
diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index 7788746572..6ef3984233 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -40,7 +40,7 @@ renderHeader(page, item, context); - LibraryBrowser.renderName(item, $('.itemName', page)); + LibraryBrowser.renderName(item, $('.itemName', page), false, context); LibraryBrowser.renderParentName(item, $('.parentName', page)); Dashboard.getCurrentUser().done(function (user) { diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index d35195a319..6d70f3bfce 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -493,6 +493,66 @@ }, + getListViewHtml: function (options) { + + var outerHtml = ""; + + outerHtml += ''; + + return outerHtml; + }, + getPosterViewHtml: function (options) { var items = options.items; @@ -774,7 +834,7 @@ if (options.showChildCountIndicator && item.ChildCount) { cssClass += ' groupedPosterItem'; - + if (item.Type == 'Series') { cssClass += ' unplayedGroupings'; } @@ -1212,14 +1272,14 @@ }, - renderName: function (item, nameElem, linkToElement) { + renderName: function (item, nameElem, linkToElement, context) { var name = LibraryBrowser.getPosterViewDisplayName(item, false, false); Dashboard.setPageTitle(name); if (linkToElement) { - nameElem.html('' + name + '').trigger('create'); + nameElem.html('' + name + '').trigger('create'); } else { nameElem.html(name); } diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js index 5fa091587f..3f66c8f2f9 100644 --- a/dashboard-ui/scripts/librarylist.js +++ b/dashboard-ui/scripts/librarylist.js @@ -290,46 +290,6 @@ return false; } - function getGroupingHeaderHtml(item) { - - var itemHtml = ''; - - var href = LibraryBrowser.getHref(item); - itemHtml += '
  • '; - - var imgUrl = "css/images/media/chapterflyout.png"; - - if (item.ImageTags.Primary) { - - itemHtml += ''; - imgUrl = ApiClient.getScaledImageUrl(item.Id, { - width: 160, - tag: item.ImageTags.Primary, - type: "Primary", - index: 0 - }); - itemHtml += '
    '; - - } else { - itemHtml += ''; - } - - - itemHtml += '

    '; - itemHtml += LibraryBrowser.getPosterViewDisplayName(item); - itemHtml += '

    '; - - var date = parseISO8601Date(item.DateCreated, { toLocal: true }); - - itemHtml += '

    '; - itemHtml += Globalize.translate('LabelAddedOnDate').replace('{0}', date.toLocaleDateString()); - itemHtml += '

    '; - - itemHtml += '
  • '; - - return itemHtml; - } - function onGroupedPosterItemClick(e) { var posterItem = this; @@ -387,25 +347,23 @@ var itemHtml = ''; href = LibraryBrowser.getHref(latestItem); - itemHtml += '
  • '; + itemHtml += '
  • '; - var imgUrl = "css/images/media/chapterflyout.png"; + var imgUrl; if (latestItem.ImageTags.Primary) { - itemHtml += ''; imgUrl = ApiClient.getScaledImageUrl(latestItem.Id, { - width: 160, + width: 80, tag: latestItem.ImageTags.Primary, type: "Primary", index: 0 }); - itemHtml += '
    '; - } else { - itemHtml += ''; } - + if (imgUrl) { + itemHtml += '
    '; + } itemHtml += '

    '; itemHtml += LibraryBrowser.getPosterViewDisplayName(latestItem); diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index c277f9e4db..677b733d15 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -59,9 +59,9 @@ $('.dashboardMenuButton').createHoverTouch().on('hovertouch', showDashboardMenu); } - function getItemHref(item) { + function getItemHref(item, context) { - return LibraryBrowser.getHref(item); + return LibraryBrowser.getHref(item, context); } function getViewsHtml() { diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index cca276f614..c3170036af 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -55,6 +55,14 @@ }); $('.itemsContainer', page).removeClass('timelineItemsContainer'); } + else if (view == "List") { + + html = LibraryBrowser.getListViewHtml({ + items: result.Items, + context: 'movies' + }); + $('.itemsContainer', page).removeClass('timelineItemsContainer'); + } else if (view == "Poster") { html = LibraryBrowser.getPosterViewHtml({ items: result.Items, diff --git a/dashboard-ui/scripts/musicalbums.js b/dashboard-ui/scripts/musicalbums.js index 9b8477782d..8c1b220dfb 100644 --- a/dashboard-ui/scripts/musicalbums.js +++ b/dashboard-ui/scripts/musicalbums.js @@ -44,6 +44,14 @@ }); $('.itemsContainer', page).removeClass('timelineItemsContainer'); } + else if (view == "List") { + + html = LibraryBrowser.getListViewHtml({ + items: result.Items, + context: 'music' + }); + $('.itemsContainer', page).removeClass('timelineItemsContainer'); + } else if (view == "Timeline") { html = LibraryBrowser.getPosterViewHtml({ items: result.Items, diff --git a/dashboard-ui/scripts/tvshows.js b/dashboard-ui/scripts/tvshows.js index 82dedfa3c4..09f99c70ea 100644 --- a/dashboard-ui/scripts/tvshows.js +++ b/dashboard-ui/scripts/tvshows.js @@ -68,6 +68,14 @@ }); $('.itemsContainer', page).removeClass('timelineItemsContainer'); } + else if (view == "List") { + + html = LibraryBrowser.getListViewHtml({ + items: result.Items, + context: 'tv' + }); + $('.itemsContainer', page).removeClass('timelineItemsContainer'); + } else if (view == "Timeline") { html = LibraryBrowser.getPosterViewHtml({ diff --git a/dashboard-ui/tvshows.html b/dashboard-ui/tvshows.html index 304d780d94..4a8a7b3358 100644 --- a/dashboard-ui/tvshows.html +++ b/dashboard-ui/tvshows.html @@ -24,6 +24,7 @@ +