diff --git a/dashboard-ui/css/card.css b/dashboard-ui/css/card.css index 46ec60e204..01d6ac4850 100644 --- a/dashboard-ui/css/card.css +++ b/dashboard-ui/css/card.css @@ -51,7 +51,7 @@ @media all and (max-width: 800px) { .cardBox { - margin: 2px; + margin: 0 2px; } } @@ -62,6 +62,15 @@ } } +.bottomPaddedCard .cardBox { + margin-bottom: 10px; +} + +.visualFooterCard .outerCardFooter { + background: #111; + padding-bottom: 4px; +} + .visualCardBox { padding: 5px; -moz-border-radius: 2px; @@ -195,6 +204,10 @@ padding: 0 5px 4px; } +.outerCardFooter .cardText + .cardText { + color: #ddd; +} + @media all and (max-width: 600px) { .packageReviewText { @@ -362,6 +375,14 @@ } +@media all and (min-width: 1800px) { + + .squareCard { + width: 10%; + } +} + + @media all and (min-width: 1920px) { .portraitCard { @@ -450,7 +471,7 @@ width: 50%; } -@media all and (min-width: 540px) { +@media all and (min-width: 640px) { .homePageBackdropCard { width: 33.3%; @@ -572,4 +593,4 @@ .homePageSmallBackdropCard { width: 16.666666666666666666666666666667%; } -} \ No newline at end of file +} diff --git a/dashboard-ui/css/librarybrowser.css b/dashboard-ui/css/librarybrowser.css index e35ce74687..eb009f1631 100644 --- a/dashboard-ui/css/librarybrowser.css +++ b/dashboard-ui/css/librarybrowser.css @@ -12,6 +12,10 @@ margin-left: .5em; } +.libraryPage { + background-color: #202020; +} + .backdropPage { background-color: rgba(15, 15,15, .94) !important; } @@ -49,8 +53,8 @@ .listHeader { margin-top: .7em; - margin-bottom: 0; - padding-left: 4px; + margin-bottom: .15em; + padding-left: 2px; } .firstListHeader { @@ -58,17 +62,9 @@ } .ehsContent { - padding: 0; - border-spacing: 0; - border-collapse: collapse; margin: 0 auto; } - .ehsContent td { - padding: 0; - border-spacing: 0; - } - .homePageSection + .homePageSection { margin-top: 1em; } @@ -103,20 +99,6 @@ top: 3px; } -@media all and (min-width: 800px) { - - .ehsContent { - width: 770px; - } -} - -@media all and (min-width: 1000px) { - - .ehsContent { - width: 900px; - } -} - @media all and (min-width: 1200px) { .ehsContent { @@ -908,7 +890,7 @@ a.itemTag:hover { width: 27px; z-index: 1000; text-align: center; - font-size: 14px; + font-size: 13px; display: none; line-height: 1; } @@ -917,6 +899,7 @@ a.itemTag:hover { display: block; text-decoration: none; padding: 1px 0; + font-weight: 500; } .alphabetPicker a:not(.selectedCharacter) { @@ -979,7 +962,7 @@ a.itemTag:hover { } .itemsContainerWithAlphaPicker { - margin-right: 15px; + margin-right: 20px; } } diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 55db256f59..5f53956af5 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -245,7 +245,7 @@ background-image: url(images/items/folders/homevideos.png); } -.generalViewMenu, .boxsetsViewMenu { +.generalViewMenu, .boxsetsViewMenu, .playlistsViewMenu { background-image: url(images/items/folders/folder.png); } diff --git a/dashboard-ui/css/posteritem.css b/dashboard-ui/css/posteritem.css deleted file mode 100644 index 79aabb744a..0000000000 --- a/dashboard-ui/css/posteritem.css +++ /dev/null @@ -1,506 +0,0 @@ -.posterItem { - margin: 5px 5px; - text-shadow: none; - font-weight: normal !important; - display: inline-block; - position: relative; - color: #fff !important; - text-decoration: none; - text-align: left; - -webkit-transition: all 500ms ease; - -moz-transition: all 500ms ease; - -o-transition: all 500ms ease; - -ms-transition: all 500ms ease; - transition: all 500ms ease; -} - -.posterItemOverlayTarget { - position: absolute; - right: 0; - left: 0; - bottom: 0; - background-color: rgba(0, 0, 0, .85); - z-index: 999; - display: none; -} - -.posterItemOverlayInner { - padding: 11px 12px 10px; -} - - .posterItemOverlayInner button:last-child { - margin-right: 0 !important; - } - - .posterItemOverlayInner p { - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - -.posterItemImage { - background-size: contain; - background-repeat: no-repeat; - background-position: center bottom; - background-color: #000; - position: relative; -} - -#scenesContent .posterItemImage { - background-position-y: center; -} - -.posterItem:hover .posterItemImage { - -moz-box-shadow: 0 0 0 5px #38c; - -webkit-box-shadow: 0 0 0 5px #38c; - box-shadow: 0 0 0 5px #38c; -} - -.coveredPosterItemImage { - background-size: cover; - background-position: center center; -} - -.transparentPosterItem .posterItemImage { - background-color: transparent; -} - -.defaultPosterItemImage { - background-color: #999; -} - -.posterItemStoreText { - font-weight: normal; - text-overflow: ellipsis; - overflow: hidden; - text-wrap: none; - white-space: nowrap; - text-shadow: none; - padding-left: 2px; -} - -.posterItemText { - text-overflow: ellipsis; - overflow: hidden; - text-wrap: none; - white-space: nowrap; - padding: 5px 4px 4px; - text-shadow: none; - font-size: 13px; - font-weight: 400; -} - -.posterItemTextOverlay { - position: absolute; - bottom: 0; - background: -moz-linear-gradient(top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.7) 100%); /* FF3.6+ */ - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(0,0,0,0)), color-stop(100%,rgba(0,0,0,0.7))); /* Chrome,Safari4+ */ - background: -webkit-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%); /* Chrome10+,Safari5.1+ */ - background: -o-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%); /* Opera 11.10+ */ - background: -ms-linear-gradient(top, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%); /* IE10+ */ - background: linear-gradient(to bottom, rgba(0,0,0,0) 0%,rgba(0,0,0,0.7) 100%); /* W3C */ - left: 0; - right: 0; -} - - .posterItemTextOverlay .posterItemText { - background-color: transparent; - padding-left: 5px; - padding: 0 5px 4px; - } - - .posterItemTextOverlay .posterItemText:last-child:not(.posterItemProgress) { - padding-bottom: 8px; - } - -.posterItemTextCentered { - text-align: center; -} - -.posterItemText + .posterItemProgress { - padding-top: 0; -} - -.posterItemDefaultText { - position: absolute; - top: 30%; - left: 0; - right: 0; - text-align: center; -} - -.storeReviewCount { - display: none; -} - -.smallBackdropPosterItem .posterItemOverlayInner > div { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; -} - -.myLibraryPosterItem { - width: 42%; - min-width: 50px; -} - - .myLibraryPosterItem .posterItemImage { - height: 34px; - background-position: 9px center; - background-size: 14px 14px; - background-color: rgba(51, 136, 204, 0.7); - background-color: rgba(82, 181, 75, 0.7); - } - - .myLibraryPosterItem .posterItemDefaultText { - top: 0; - left: 0; - line-height: 34px; - text-align: left; - padding: 0 0 0 34px; - } - -.moviesPosterItem .posterItemImage, .trailersPosterItem .posterItemImage { - background-color: rgba(176, 94, 81, 0.7); -} - -.musicPosterItem .posterItemImage { - background-color: rgba(217, 145, 67, 0.7); -} - -.tvshowsPosterItem .posterItemImage { - background-color: rgba(77, 88, 164, 0.7); -} - -.gamesPosterItem .posterItemImage { - background-color: rgba(183, 202, 72, 0.7); -} - -.channelsPosterItem .posterItemImage { - background-color: rgba(51, 136, 204, 0.7); -} - -.livetvPosterItem .posterItemImage { - background-color: rgba(255, 233, 127, 0.7); -} - -.homevideosPosterItem .posterItemImage { - background-color: rgba(110, 52, 32, 0.7); -} - -.adultvideosPosterItem .posterItemImage { - background-color: rgba(184, 83, 116, 0.7); -} - -.photosPosterItem .posterItemImage { - background-color: rgba(127, 0, 0, 0.7); -} - -.musicvideosPosterItem .posterItemImage { - background-color: rgba(143, 54, 168, 0.7); -} - -.squarePosterItem { - width: 140px; -} - - .squarePosterItem .posterItemImage { - height: 140px; - } - -.backdropPosterItem { - width: 128px; -} - - .backdropPosterItem .posterItemImage { - height: 72px; - } - -.smallBackdropPosterItem { - width: 120px; -} - - .smallBackdropPosterItem .posterItemImage { - height: 67.5px; - } - -.miniBackdropPosterItem { - width: 120px; -} - - .miniBackdropPosterItem .posterItemImage { - height: 67.5px; - } - -.portraitPosterItem { - width: 96px; -} - - .portraitPosterItem .posterItemImage { - height: 144px; - } - -.bannerPosterItem { - width: 280px; -} - - .bannerPosterItem .posterItemImage { - height: 51.8px; - } - -.posterItemProgress { - line-height: 7px; -} - - .posterItemProgress .itemProgressBar { - height: 7px; - width: 100%; - opacity: .8; - } - -.miniPosterItemProgress { - /* Make sure it's on top of the fade gradient '*/ - z-index: 1000; -} - - .miniPosterItemProgress .itemProgressBar { - height: 6px; - opacity: 1; - } - -.sessionPosterItem .posterItemText:not(.posterItemName) { - color: #000; - text-align: left; -} - -.sessionPosterItem .posterItemName { - color: #fff !important; -} - -.sessionPosterItem .posterItemDefaultText { - color: #000 !important; - font-weight: normal !important; - top: 42%; -} - -@media all and (max-width: 1200px) { - - .portraitPosterItem .posterItemOverlayInner { - padding-left: 7px; - padding-right: 7px; - } -} - -@media all and (min-width: 360px) { - - .myLibraryPosterItem { - width: 45%; - } - - .backdropPosterItem { - width: 148px; - } - - .backdropPosterItem .posterItemImage { - height: 83.25px; - } - - .smallBackdropPosterItem { - width: 157px; - } - - .smallBackdropPosterItem .posterItemImage { - height: 88.3125px; - } - - .miniBackdropPosterItem { - width: 148px; - } - - .miniBackdropPosterItem .posterItemImage { - height: 83.25px; - } -} - -@media all and (min-width: 540px) { - - .backdropPosterItem { - width: 246px; - } - - .backdropPosterItem .posterItemImage { - height: 138.375px; - } - - .smallBackdropPosterItem { - width: 180px; - } - - .smallBackdropPosterItem .posterItemImage { - height: 101.25px; - } -} - -@media all and (min-width: 600px) { - - - .portraitPosterItem { - width: 118px; - } - - .portraitPosterItem .posterItemImage { - height: 177px; - } -} - -@media all and (min-width: 650px) { - - .smallBackdropPosterItem { - width: 190px; - } - - .smallBackdropPosterItem .posterItemImage { - height: 113.625px; - } - - .bannerPosterItem { - width: 300px; - } - - .bannerPosterItem .posterItemImage { - height: 55.5px; - } -} - -@media all and (min-width: 600px) { - - .myLibraryPosterItem { - width: 30%; - /* Specify a min width just in case the container doesn't have a width */ - min-width: 160px; - } -} - -@media all and (min-width: 750px) { - - .bannerPosterItem { - width: 330px; - } - - .bannerPosterItem .posterItemImage { - height: 61.05px; - } -} - -@media all and (min-width: 1000px) { - - .myLibraryPosterItem { - width: 23%; - /* Specify a min width just in case the container doesn't have a width */ - min-width: 220px; - } - - .backdropPosterItem { - width: 290px; - } - - .backdropPosterItem .posterItemImage { - height: 163.125px; - } - - .smallBackdropPosterItem { - width: 290px; - } - - .smallBackdropPosterItem .posterItemImage { - height: 163.125px; - } - - .miniBackdropPosterItem { - width: 190px; - } - - .miniBackdropPosterItem .posterItemImage { - height: 106.875px; - } -} - -@media all and (min-width: 1200px) { - - .portraitPosterItem { - width: 122px; - } - - .portraitPosterItem .posterItemImage { - height: 183px; - } - - .storeReviewCount { - display: inline; - } - - .bannerPosterItem { - width: 500px; - } - - .bannerPosterItem .posterItemImage { - height: 92.5px; - } - - .backdropPosterItem { - width: 320px; - } - - .backdropPosterItem .posterItemImage { - height: 180px; - } - - .portraitPosterItem { - width: 156px; - } - - .portraitPosterItem .posterItemImage { - height: 234px; - } - - .squarePosterItem { - width: 190px; - } - - .squarePosterItem .posterItemImage { - height: 190px; - } -} - -@media all and (min-width: 1440px) { - - .myLibraryPosterItem { - width: 19%; - /* Specify a min width just in case the container doesn't have a width */ - min-width: 220px; - } -} - -@media all and (min-width: 1600px) { - - .backdropPosterItem { - width: 290px; - } - - .backdropPosterItem .posterItemImage { - height: 163.125px; - } - - .portraitPosterItem { - width: 160px; - } - - .portraitPosterItem .posterItemImage { - height: 240px; - } -} - - -.scalableItem { - -} \ No newline at end of file diff --git a/dashboard-ui/css/site.css b/dashboard-ui/css/site.css index a1027fcc7d..81f6476180 100644 --- a/dashboard-ui/css/site.css +++ b/dashboard-ui/css/site.css @@ -85,12 +85,11 @@ body { h1, h1 a { font-weight: 300 !important; - font-size: 28px; + font-size: 30px; } .libraryPage h1, .libraryPage h1 a { font-weight: 100 !important; - font-size: 28px; } .ui-loader h1 { diff --git a/dashboard-ui/css/tileitem.css b/dashboard-ui/css/tileitem.css index 1f763d4c21..2d8fe4809e 100644 --- a/dashboard-ui/css/tileitem.css +++ b/dashboard-ui/css/tileitem.css @@ -2,7 +2,7 @@ background: #1e1e1e; padding: 10px 7px 5px; margin: 3px 0; - font-weight: normal!important; + font-weight: normal !important; display: block; position: relative; -webkit-transition: all 500ms ease; @@ -399,3 +399,124 @@ height: 140px; } } + + +.posterItem { + margin: 5px 5px; + text-shadow: none; + font-weight: normal !important; + display: inline-block; + position: relative; + color: #fff !important; + text-decoration: none; + text-align: left; + -webkit-transition: all 500ms ease; + -moz-transition: all 500ms ease; + -o-transition: all 500ms ease; + -ms-transition: all 500ms ease; + transition: all 500ms ease; +} + +.posterItemText { + text-overflow: ellipsis; + overflow: hidden; + text-wrap: none; + white-space: nowrap; + padding: 5px 4px 4px; + text-shadow: none; + font-size: 13px; + font-weight: 400; +} + +.posterItemImage { + background-size: contain; + background-repeat: no-repeat; + background-position: center bottom; + background-color: #000; + position: relative; +} + +.posterItemDefaultText { + position: absolute; + top: 30%; + left: 0; + right: 0; + text-align: center; +} + +.myLibraryPosterItem { + width: 42%; + min-width: 50px; +} + + .myLibraryPosterItem .posterItemImage { + height: 34px; + background-position: 9px center; + background-size: 14px 14px; + background-color: rgba(51, 136, 204, 0.7); + background-color: rgba(82, 181, 75, 0.7); + } + + .myLibraryPosterItem .posterItemDefaultText { + top: 0; + left: 0; + line-height: 34px; + text-align: left; + padding: 0 0 0 34px; + } + +.moviesPosterItem .posterItemImage, .trailersPosterItem .posterItemImage { + background-color: rgba(176, 94, 81, 0.7); +} + +.musicPosterItem .posterItemImage { + background-color: rgba(217, 145, 67, 0.7); +} + +.tvshowsPosterItem .posterItemImage { + background-color: rgba(77, 88, 164, 0.7); +} + +.gamesPosterItem .posterItemImage { + background-color: rgba(183, 202, 72, 0.7); +} + +.channelsPosterItem .posterItemImage { + background-color: rgba(51, 136, 204, 0.7); +} + +.livetvPosterItem .posterItemImage { + background-color: rgba(255, 233, 127, 0.7); +} + +.homevideosPosterItem .posterItemImage { + background-color: rgba(110, 52, 32, 0.7); +} + +.adultvideosPosterItem .posterItemImage { + background-color: rgba(184, 83, 116, 0.7); +} + +.photosPosterItem .posterItemImage { + background-color: rgba(127, 0, 0, 0.7); +} + +.musicvideosPosterItem .posterItemImage { + background-color: rgba(143, 54, 168, 0.7); +} +@media all and (min-width: 600px) { + + .myLibraryPosterItem { + width: 31%; + /* Specify a min width just in case the container doesn't have a width */ + min-width: 160px; + } +} +@media all and (min-width: 1000px) { + + .myLibraryPosterItem { + width: 24%; + /* Specify a min width just in case the container doesn't have a width */ + min-width: 220px; + } +} \ No newline at end of file diff --git a/dashboard-ui/musicalbumartists.html b/dashboard-ui/musicalbumartists.html index 70ce838675..ac76eaa3e7 100644 --- a/dashboard-ui/musicalbumartists.html +++ b/dashboard-ui/musicalbumartists.html @@ -21,6 +21,11 @@
+
diff --git a/dashboard-ui/musicalbums.html b/dashboard-ui/musicalbums.html index 37bee25fb6..ee0362b35a 100644 --- a/dashboard-ui/musicalbums.html +++ b/dashboard-ui/musicalbums.html @@ -20,6 +20,11 @@
+
diff --git a/dashboard-ui/musicartists.html b/dashboard-ui/musicartists.html index f885a6460f..c374fdcd0a 100644 --- a/dashboard-ui/musicartists.html +++ b/dashboard-ui/musicartists.html @@ -21,6 +21,11 @@
+
diff --git a/dashboard-ui/musicgenres.html b/dashboard-ui/musicgenres.html index f719a887e4..7ba5dd015b 100644 --- a/dashboard-ui/musicgenres.html +++ b/dashboard-ui/musicgenres.html @@ -18,6 +18,11 @@
+
diff --git a/dashboard-ui/playlistedit.html b/dashboard-ui/playlistedit.html new file mode 100644 index 0000000000..a54f15e072 --- /dev/null +++ b/dashboard-ui/playlistedit.html @@ -0,0 +1,45 @@ + + + + ${TitleMediaBrowser} + + +
+ +
+ ${TabPlaylists} +
+ +
+
+ +
+   +
+
+
+ +
+ +
+
+ + + +
+ +
+ + +
+ +
+
+
+
+ + diff --git a/dashboard-ui/playlists.html b/dashboard-ui/playlists.html new file mode 100644 index 0000000000..fdd06b51a8 --- /dev/null +++ b/dashboard-ui/playlists.html @@ -0,0 +1,94 @@ + + + + ${TitleMediaBrowser} + + +
+ +
+ ${TabPlaylists} +
+ +
+
+ +
+   +
+
+
+ +
+ +
+
+ + + +
+ +
+ + +
+
+
+ + +
+ +
+
+
+ ${HeaderFilters} + + + + + + + + +
+ +
+
+
+ + ${HeaderSortBy} + + + + + + + +
+ +
+ + ${HeaderSortOrder} + + + + + + + +
+
+
+
+
+ + diff --git a/dashboard-ui/scripts/edititemmetadata.js b/dashboard-ui/scripts/edititemmetadata.js index 200a9ed8f4..8a4e6e4daa 100644 --- a/dashboard-ui/scripts/edititemmetadata.js +++ b/dashboard-ui/scripts/edititemmetadata.js @@ -90,7 +90,7 @@ Dashboard.getCurrentUser().done(function (user) { - if (item.Type == 'BoxSet') { + if (item.Type == 'BoxSet' || item.Type == 'Playlist') { $('#fldDelete', page).show(); } else if (user.Configuration.EnableContentDeletion && diff --git a/dashboard-ui/scripts/episodes.js b/dashboard-ui/scripts/episodes.js index a09c6bc47c..3d932a7559 100644 --- a/dashboard-ui/scripts/episodes.js +++ b/dashboard-ui/scripts/episodes.js @@ -67,7 +67,7 @@ html += pagingHtml; - $('.itemsContainer', page).html(html).trigger('create').createCardMenus().trigger('itemsrendered'); + $('.itemsContainer', page).html(html).trigger('create').createCardMenus(); $('.btnNextPage', page).on('click', function () { query.StartIndex += query.Limit; diff --git a/dashboard-ui/scripts/favorites.js b/dashboard-ui/scripts/favorites.js index f2223038b1..5110ac7909 100644 --- a/dashboard-ui/scripts/favorites.js +++ b/dashboard-ui/scripts/favorites.js @@ -6,7 +6,7 @@ { name: Globalize.translate('HeaderFavoriteMovies'), types: "Movie", id: "favoriteMovies", shape: 'homePageBackdrop', preferThumb: true, showTitle: false }, { name: Globalize.translate('HeaderFavoriteShows'), types: "Series", id: "favoriteShows", shape: 'homePageBackdrop', preferThumb: true, showTitle: false }, { name: Globalize.translate('HeaderFavoriteEpisodes'), types: "Episode", id: "favoriteEpisode", shape: 'homePageBackdrop', preferThumb: false, showTitle: true, showParentTitle: true }, - { name: Globalize.translate('HeaderFavoriteGames'), types: "Game", id: "favoriteGames", shape: 'auto', preferThumb: false, showTitle: true }, + { name: Globalize.translate('HeaderFavoriteGames'), types: "Game", id: "favoriteGames", shape: 'autohome', preferThumb: false, showTitle: true }, { name: Globalize.translate('HeaderFavoriteAlbums'), types: "MusicAlbum", id: "favoriteAlbums", shape: 'homePageSquare', preferThumb: false, showTitle: true, overlayText: false, showParentTitle: true } ]; diff --git a/dashboard-ui/scripts/indexpage.js b/dashboard-ui/scripts/indexpage.js index f85e09900a..50e9c2d76a 100644 --- a/dashboard-ui/scripts/indexpage.js +++ b/dashboard-ui/scripts/indexpage.js @@ -60,7 +60,6 @@ case "channels": imgUrl = "css/images/items/folders/channels.png"; break; - case "boxsets": default: imgUrl = "css/images/items/folders/folder.png"; break; diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index b908be6f4e..a0a112f314 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -607,7 +607,8 @@ centerText: item.Type != "MusicAlbum", showTitle: item.Type == "MusicAlbum" || item.Type == "Game", borderless: item.Type == "Game", - context: context + context: context, + overlayText: item.Type != "MusicAlbum" }); $('#similarContent', page).html(html).createCardMenus(); diff --git a/dashboard-ui/scripts/librarybrowser.js b/dashboard-ui/scripts/librarybrowser.js index 04f29739f3..ea99b832bc 100644 --- a/dashboard-ui/scripts/librarybrowser.js +++ b/dashboard-ui/scripts/librarybrowser.js @@ -98,17 +98,38 @@ var childText; - if (options.context == "movies") { + if (item.Type == 'Playlist') { + + childText = ''; + + if (item.CumulativeRunTimeTicks) { + + var minutes = item.CumulativeRunTimeTicks / 600000000; + + minutes = minutes || 1; + + childText += Math.round(minutes) + " min"; + + } else { + childText += '0 min'; + } + + //childText += item.ChildCount == 1 ? "1 item" : item.ChildCount + " items"; + + counts.push(childText); + + } + else if (options.context == "movies") { if (item.MovieCount) { - childText = item.MovieCount == 1 ? "1 Movie" : item.MovieCount + " Movies"; + childText = item.MovieCount == 1 ? "1 movie" : item.MovieCount + " movies"; counts.push(childText); } if (item.TrailerCount) { - childText = item.TrailerCount == 1 ? "1 Trailer" : item.TrailerCount + " Trailers"; + childText = item.TrailerCount == 1 ? "1 trailer" : item.TrailerCount + " trailers"; counts.push(childText); } @@ -117,13 +138,13 @@ if (item.SeriesCount) { - childText = item.SeriesCount == 1 ? "1 Show" : item.SeriesCount + " Shows"; + childText = item.SeriesCount == 1 ? "1 show" : item.SeriesCount + " shows"; counts.push(childText); } if (item.EpisodeCount) { - childText = item.EpisodeCount == 1 ? "1 Episode" : item.EpisodeCount + " Episodes"; + childText = item.EpisodeCount == 1 ? "1 episode" : item.EpisodeCount + " episodes"; counts.push(childText); } @@ -132,7 +153,7 @@ if (item.GameCount) { - childText = item.GameCount == 1 ? "1 Game" : item.GameCount + " Games"; + childText = item.GameCount == 1 ? "1 game" : item.GameCount + " games"; counts.push(childText); } @@ -140,19 +161,19 @@ if (item.AlbumCount) { - childText = item.AlbumCount == 1 ? "1 Album" : item.AlbumCount + " Albums"; + childText = item.AlbumCount == 1 ? "1 album" : item.AlbumCount + " albums"; counts.push(childText); } if (item.SongCount) { - childText = item.SongCount == 1 ? "1 Song" : item.SongCount + " Songs"; + childText = item.SongCount == 1 ? "1 song" : item.SongCount + " songs"; counts.push(childText); } if (item.MusicVideoCount) { - childText = item.MusicVideoCount == 1 ? "1 Music Video" : item.MusicVideoCount + " Music Videos"; + childText = item.MusicVideoCount == 1 ? "1 music video" : item.MusicVideoCount + " music videos"; counts.push(childText); } @@ -360,7 +381,7 @@ href += context; } - if (topParentId == null) { + if (topParentId == null && context != 'playlists') { topParentId = LibraryMenu.getTopParentId(); } @@ -420,10 +441,16 @@ if (item.CollectionType == 'games') { return 'gamesrecommended.html?topParentId=' + item.Id; } + if (item.CollectionType == 'playlists') { + return 'playlists.html?topParentId=' + item.Id; + } if (item.Type == 'CollectionFolder') { return 'itemlist.html?topParentId=' + item.Id + '&parentid=' + item.Id; } + if (item.Type == "Playlist") { + return "playlistedit.html?id=" + id; + } if (item.Type == "TvChannel") { return "livetvchannel.html?id=" + id; } @@ -576,6 +603,12 @@ outerHtml += ''; html += ''; @@ -299,6 +315,7 @@ $('.btnInstantMix', elem).on('click', onInstantMixButtonClick); $('.btnShuffle', elem).on('click', onShuffleButtonClick); $('.btnPlayTrailer', elem).on('click', onTrailerButtonClick); + $('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick); }); } @@ -504,7 +521,8 @@ return this.off('.cardHoverMenu') .on('mouseenter.cardHoverMenu', elems, onHoverIn) .on('mouseleave.cardHoverMenu', elems, onHoverOut) - .on("touchstart.cardHoverMenu", elems, preventTouchHover); + .on("touchstart.cardHoverMenu", elems, preventTouchHover) + .trigger('itemsrendered'); }; function toggleSelections(page) { @@ -613,10 +631,31 @@ BoxSetEditor.showPanel(page, selection); } + function addToPlaylist(page) { + + var selection = getSelectedItems(page); + + if (selection.length < 1) { + + Dashboard.alert({ + message: Globalize.translate('MessagePleaseSelectOneItem'), + title: Globalize.translate('HeaderError') + }); + + return; + } + + PlaylistManager.showPanel(selection); + } + $(document).on('pageinit', ".libraryPage", function () { var page = this; + $('.btnAddToPlaylist', page).on('click', function () { + addToPlaylist(page); + }); + $('.btnMergeVersions', page).on('click', function () { combineVersions(page); }); diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js index 2d2c654dd7..62d142e823 100644 --- a/dashboard-ui/scripts/librarymenu.js +++ b/dashboard-ui/scripts/librarymenu.js @@ -231,7 +231,7 @@ function getTopParentId() { - return getParameterByName('topParentId') || sessionStore.getItem('topParentId') || null; + return getParameterByName('topParentId') /*|| sessionStore.getItem('topParentId')*/ || null; } window.LibraryMenu = { @@ -298,18 +298,22 @@ }); - $('.scopedLibraryViewNav a', page).each(function () { + var context = getParameterByName('context'); - var src = this.href; + if (context !== 'playlists') { + $('.scopedLibraryViewNav a', page).each(function () { - if (src.indexOf('#') != -1) { - return; - } + var src = this.href; - src = replaceQueryString(src, 'topParentId', id); + if (src.indexOf('#') != -1) { + return; + } - this.href = src; - }); + src = replaceQueryString(src, 'topParentId', id); + + this.href = src; + }); + } } function updateContextText(page) { diff --git a/dashboard-ui/scripts/loginpage.js b/dashboard-ui/scripts/loginpage.js index 3650782673..aa50e6efb1 100644 --- a/dashboard-ui/scripts/loginpage.js +++ b/dashboard-ui/scripts/loginpage.js @@ -126,7 +126,7 @@ for (var i = 0, length = users.length; i < length; i++) { var user = users[i]; - html += '
'; + html += '
'; html += '
'; diff --git a/dashboard-ui/scripts/mediacontroller.js b/dashboard-ui/scripts/mediacontroller.js index aef4dfeef8..e6ec325a33 100644 --- a/dashboard-ui/scripts/mediacontroller.js +++ b/dashboard-ui/scripts/mediacontroller.js @@ -201,7 +201,7 @@ return false; } - if (itemType == "MusicGenre" || itemType == "Season" || itemType == "Series" || itemType == "BoxSet" || itemType == "MusicAlbum" || itemType == "MusicArtist") { + if (itemType == "MusicGenre" || itemType == "Season" || itemType == "Series" || itemType == "BoxSet" || itemType == "MusicAlbum" || itemType == "MusicArtist" || itemType == "Playlist") { return true; } diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js index 7570c4622b..094f5c4d3e 100644 --- a/dashboard-ui/scripts/mediaplayer.js +++ b/dashboard-ui/scripts/mediaplayer.js @@ -347,14 +347,10 @@ var firstItem = items[0]; var promise; - if (firstItem.IsFolder) { + if (firstItem.Type == "Playlist") { promise = self.getItemsForPlayback({ ParentId: firstItem.Id, - Filters: "IsNotFolder", - Recursive: true, - SortBy: "SortName", - MediaTypes: "Audio,Video" }); } else if (firstItem.Type == "MusicArtist") { @@ -378,6 +374,16 @@ MediaTypes: "Audio" }); } + else if (firstItem.IsFolder) { + + promise = self.getItemsForPlayback({ + ParentId: firstItem.Id, + Filters: "IsNotFolder", + Recursive: true, + SortBy: "SortName", + MediaTypes: "Audio,Video" + }); + } if (promise) { promise.done(function (result) { @@ -801,11 +807,7 @@ SortBy: "Random" }; - if (item.IsFolder) { - query.ParentId = id; - - } - else if (item.Type == "MusicArtist") { + if (item.Type == "MusicArtist") { query.MediaTypes = "Audio"; query.Artists = item.Name; @@ -816,7 +818,12 @@ query.MediaTypes = "Audio"; query.Genres = item.Name; - } else { + } + else if (item.IsFolder) { + query.ParentId = id; + + } + else { return; } diff --git a/dashboard-ui/scripts/moviecollections.js b/dashboard-ui/scripts/moviecollections.js index 341f075721..27d24ad937 100644 --- a/dashboard-ui/scripts/moviecollections.js +++ b/dashboard-ui/scripts/moviecollections.js @@ -81,7 +81,7 @@ $('.noItemsMessage', page).show(); } - $('.itemsContainer', page).html(html).trigger('create').createCardMenus().trigger('itemsrendered'); + $('.itemsContainer', page).html(html).trigger('create').createCardMenus(); $('.btnNextPage', page).on('click', function () { query.StartIndex += query.Limit; @@ -333,6 +333,17 @@ }); }); + function redirectToCollection(id) { + + var context = getParameterByName('context'); + + ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { + + Dashboard.navigate(LibraryBrowser.getHref(item, context)); + + }); + } + function createCollection(page) { var url = ApiClient.getUrl("Collections", { @@ -355,16 +366,9 @@ Dashboard.hideLoadingMsg(); var id = result.Id; - var destination = 'itemdetails.html?id=' + id; - - var context = getParameterByName('context'); - - if (context) { - destination += "&context=" + context; - } $('.newCollectionPanel', page).panel('toggle'); - Dashboard.navigate(destination); + redirectToCollection(id); }); } @@ -384,19 +388,10 @@ Dashboard.hideLoadingMsg(); - var destination = 'itemdetails.html?id=' + id; - - var context = getParameterByName('context'); - - if (context) { - destination += "&context=" + context; - } - $('.newCollectionPanel', page).panel('toggle'); - Dashboard.navigate(destination); + redirectToCollection(id); }); - } window.BoxSetEditor = { diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js index 4cd9e4ce75..a046865cc2 100644 --- a/dashboard-ui/scripts/movies.js +++ b/dashboard-ui/scripts/movies.js @@ -103,7 +103,7 @@ html += pagingHtml; - $('.itemsContainer', page).html(html).trigger('create').createCardMenus().trigger('itemsrendered'); + $('.itemsContainer', page).html(html).trigger('create').createCardMenus(); $('.btnNextPage', page).on('click', function () { query.StartIndex += query.Limit; diff --git a/dashboard-ui/scripts/musicalbumartists.js b/dashboard-ui/scripts/musicalbumartists.js index 9b9e827c95..21fa121b3a 100644 --- a/dashboard-ui/scripts/musicalbumartists.js +++ b/dashboard-ui/scripts/musicalbumartists.js @@ -33,7 +33,8 @@ limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, - showLimit: false + showLimit: false, + addSelectionButton: true }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -56,7 +57,8 @@ showTitle: true, coverImage: true, centerText: true, - lazy: true + lazy: true, + selectionPanel: true }); } diff --git a/dashboard-ui/scripts/musicalbums.js b/dashboard-ui/scripts/musicalbums.js index cbe6dc44b3..af8d0a5d2e 100644 --- a/dashboard-ui/scripts/musicalbums.js +++ b/dashboard-ui/scripts/musicalbums.js @@ -34,7 +34,8 @@ limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, - showLimit: false + showLimit: false, + addSelectionButton: true }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -48,7 +49,8 @@ context: 'music', showTitle: true, showParentTitle: true, - lazy: true + lazy: true, + selectionPanel: true }); $('.itemsContainer', page).removeClass('timelineItemsContainer'); } @@ -69,7 +71,8 @@ showTitle: true, showParentTitle: true, timeline: true, - lazy: true + lazy: true, + selectionPanel: true }); $('.itemsContainer', page).addClass('timelineItemsContainer'); } diff --git a/dashboard-ui/scripts/musicartists.js b/dashboard-ui/scripts/musicartists.js index 35bf6bab12..20b3797eb7 100644 --- a/dashboard-ui/scripts/musicartists.js +++ b/dashboard-ui/scripts/musicartists.js @@ -33,7 +33,8 @@ limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, - showLimit: false + showLimit: false, + addSelectionButton: true }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -56,7 +57,8 @@ showTitle: true, coverImage: true, centerText: true, - lazy: true + lazy: true, + selectionPanel: true }); } diff --git a/dashboard-ui/scripts/musicgenres.js b/dashboard-ui/scripts/musicgenres.js index 6f77075b86..79cd23d60b 100644 --- a/dashboard-ui/scripts/musicgenres.js +++ b/dashboard-ui/scripts/musicgenres.js @@ -32,7 +32,8 @@ limit: query.Limit, totalRecordCount: result.TotalRecordCount, viewButton: true, - showLimit: false + showLimit: false, + addSelectionButton: true }); $('.listTopPaging', page).html(pagingHtml).trigger('create'); @@ -46,7 +47,8 @@ context: 'music', showItemCounts: true, centerText: true, - lazy: true + lazy: true, + selectionPanel: true }); html += pagingHtml; diff --git a/dashboard-ui/scripts/playlistedit.js b/dashboard-ui/scripts/playlistedit.js new file mode 100644 index 0000000000..fb02dc65c5 --- /dev/null +++ b/dashboard-ui/scripts/playlistedit.js @@ -0,0 +1,154 @@ +(function ($, document) { + + var view = LibraryBrowser.getDefaultItemsView('List', 'List'); + + // The base query options + var query = { + + Recursive: true, + Fields: "PrimaryImageAspectRatio", + StartIndex: 0 + }; + + function getSavedQueryKey() { + + return 'playlists' + (query.ParentId || ''); + } + + function reloadItems(page) { + + Dashboard.showLoadingMsg(); + + query.ParentId = getParameterByName('id'); + + var promise1 = ApiClient.getJSON(ApiClient.getUrl('Playlists/' + query.ParentId + '/Items', { userId: Dashboard.getCurrentUserId() })); + var promise2 = Dashboard.getCurrentUser(); + var promise3 = ApiClient.getItem(Dashboard.getCurrentUserId(), query.ParentId); + + $.when(promise1, promise2, promise3).done(function (response1, response2, response3) { + + var result = response1[0]; + var user = response2[0]; + var item = response3[0]; + + // Scroll back up so they can see the results from the beginning + $(document).scrollTop(0); + + var html = ''; + + var pagingHtml = LibraryBrowser.getQueryPagingHtml({ + startIndex: query.StartIndex, + limit: query.Limit, + totalRecordCount: result.TotalRecordCount, + viewButton: true, + showLimit: false + }); + + $('.listTopPaging', page).html(pagingHtml).trigger('create'); + + updateFilterControls(page); + + if (result.TotalRecordCount) { + + if (view == "List") { + + html = LibraryBrowser.getListViewHtml({ + items: result.Items, + context: 'playlists', + sortBy: query.SortBy, + showIndex: false, + title: item.Name + }); + } + + html += pagingHtml; + $('.noItemsMessage', page).hide(); + + } else { + + $('.noItemsMessage', page).show(); + } + + $('.itemsContainer', page).html(html).trigger('create').createCardMenus(); + + $('.btnNextPage', page).on('click', function () { + query.StartIndex += query.Limit; + reloadItems(page); + }); + + $('.btnPreviousPage', page).on('click', function () { + query.StartIndex -= query.Limit; + reloadItems(page); + }); + + LibraryBrowser.saveQueryValues(getSavedQueryKey(), query); + + Dashboard.hideLoadingMsg(); + }); + } + + function updateFilterControls(page) { + + // Reset form values using the last used query + $('.radioSortBy', page).each(function () { + + this.checked = (query.SortBy || '').toLowerCase() == this.getAttribute('data-sortby').toLowerCase(); + + }).checkboxradio('refresh'); + + $('.radioSortOrder', page).each(function () { + + this.checked = (query.SortOrder || '').toLowerCase() == this.getAttribute('data-sortorder').toLowerCase(); + + }).checkboxradio('refresh'); + + $('.chkStandardFilter', page).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); + + $('#selectView', page).val(view).selectmenu('refresh'); + + $('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); + } + + $(document).on('pageinit', "#playlistEditorPage", function () { + + var page = this; + + $('#selectPageSize', page).on('change', function () { + query.Limit = parseInt(this.value); + query.StartIndex = 0; + reloadItems(page); + }); + + }).on('pagebeforeshow', "#playlistEditorPage", function () { + + var page = this; + + query.ParentId = LibraryMenu.getTopParentId(); + + var limit = LibraryBrowser.getDefaultPageSize(); + + // If the default page size has changed, the start index will have to be reset + if (limit != query.Limit) { + query.Limit = limit; + query.StartIndex = 0; + } + + var viewkey = getSavedQueryKey(); + + LibraryBrowser.loadSavedQueryValues(viewkey, query); + reloadItems(page); + + }).on('pageshow', "#playlistEditorPage", function () { + + updateFilterControls(this); + + }); + +})(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/playlistmanager.js b/dashboard-ui/scripts/playlistmanager.js new file mode 100644 index 0000000000..8964ff6eb7 --- /dev/null +++ b/dashboard-ui/scripts/playlistmanager.js @@ -0,0 +1,243 @@ +(function ($, document) { + + var lastPlaylistId = ''; + + function redirectToPlaylist(id) { + + var context = getParameterByName('context'); + + ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) { + + Dashboard.navigate(LibraryBrowser.getHref(item, context)); + + }); + } + + function onAddToPlaylistFormSubmit() { + + Dashboard.showLoadingMsg(); + + var panel = $(this).parents('.newPlaylistPanel'); + + var playlistId = $('select.selectPlaylistToAddTo', panel).val(); + + if (playlistId) { + lastPlaylistId = playlistId; + addToPlaylist(panel, playlistId); + } else { + createPlaylist(panel); + } + + return false; + } + + function getNewPlaylistPanel() { + + $('.newPlaylistPanel').panel('destroy').remove(); + + var html = '
'; + + html += '

' + Globalize.translate('HeaderAddToPlaylist') + '

'; + + html += '
'; + + html += '
'; + + var selectId = 'selectPlaylistToAddTo' + new Date().getTime(); + + html += '
'; + html += ''; + html += ''; + html += '
'; + + html += '
'; + + html += ''; + + html += '

'; + html += ''; + html += ''; + html += '

'; + + html += '
'; + html += '
'; + + $(document.body).append(html); + + var elem = $('.newPlaylistPanel').panel({}).trigger('create').on("panelclose", function () { + + $(this).off("panelclose").remove(); + }); + + var select = $('#' + selectId, elem).on('change', function () { + + if (this.value) { + $('.fldNewPlaylist', elem).hide(); + $('input', elem).removeAttr('required'); + } else { + $('.fldNewPlaylist', elem).show(); + $('input', elem).attr('required', 'required'); + } + + }).trigger('change'); + + ApiClient.getItems(Dashboard.getCurrentUserId(), { + + IncludeItemTypes: 'Playlist', + recursive: true, + SortBy: 'SortName' + + }).done(function (result) { + + var selectHtml = ''; + selectHtml += result.Items.map(function (o) { + + return ''; + + }).join(''); + + select.html(selectHtml).selectmenu('refresh'); + + select.val(lastPlaylistId || '').selectmenu('refresh').trigger('change'); + }); + + $('form', elem).on('submit', onAddToPlaylistFormSubmit); + + return elem; + } + + function showNewPlaylistPanel(items) { + + var panel = getNewPlaylistPanel().panel('toggle'); + + $('.fldSelectedItemIds', panel).val(items.join(',')); + + populatePlaylists(panel); + } + + function populatePlaylists(panel) { + + var select = $('select.selectPlaylistToAddTo', panel); + + if (!select.length) { + + $('#txtNewPlaylistName', panel).val('').focus(); + return; + } + + $('.newPlaylistInfo', panel).hide(); + + var options = { + + Recursive: true, + IncludeItemTypes: "Playlist" + }; + + ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { + + var html = ''; + + html += ''; + + html += result.Items.map(function (i) { + + return ''; + }); + + select.html(html).val('').selectmenu('refresh').trigger('change'); + + }); + } + + //$(document).on('pageinit', ".playlistEditorPage", function () { + + // var page = this; + + // $('.itemsContainer', page).on('itemsrendered', function () { + + // $('.btnNewPlaylist', page).off('click.newplaylistpanel').on('click.newplaylistpanel', function () { + + // showNewPlaylistPanel(page, []); + // }); + + // }); + + // $('#selectPlaylistToAddTo', page).on('change', function () { + + // if (this.value) { + // $('.newPlaylistInfo', page).hide(); + // $('#txtNewPlaylistName', page).removeAttr('required'); + // } else { + // $('.newPlaylistInfo', page).show(); + // $('#txtNewPlaylistName', page).attr('required', 'required'); + // } + // }); + //}); + + function createPlaylist(panel) { + + var url = ApiClient.getUrl("Playlists", { + + Name: $('#txtNewPlaylistName', panel).val(), + Ids: $('.fldSelectedItemIds', panel).val() || '', + userId: Dashboard.getCurrentUserId() + + }); + + ApiClient.ajax({ + type: "POST", + url: url, + dataType: "json" + + }).done(function (result) { + + Dashboard.hideLoadingMsg(); + + var id = result.Id; + + panel.panel('toggle'); + redirectToPlaylist(id); + }); + } + + function addToPlaylist(panel, id) { + + var url = ApiClient.getUrl("Playlists/" + id + "/Items", { + + Ids: $('.fldSelectedItemIds', panel).val() || '' + }); + + ApiClient.ajax({ + type: "POST", + url: url + + }).done(function () { + + Dashboard.hideLoadingMsg(); + + panel.panel('toggle'); + Dashboard.alert(Globalize.translate('MessageAddedToPlaylistSuccess')); + + }); + } + + window.PlaylistManager = { + + showPanel: function (items) { + showNewPlaylistPanel(items); + }, + + supportsPlaylists: function (item) { + + if (item.Type == 'Playlist') { + return false; + } + return item.MediaType == "Audio" || item.MediaType == "Video" || item.Type == "MusicAlbum" || item.Type == "MusicArtist" || item.Type == "MusicGenre" || item.Type == "Series" || item.Type == "Season"; + } + }; + +})(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/playlists.js b/dashboard-ui/scripts/playlists.js new file mode 100644 index 0000000000..da40fb406e --- /dev/null +++ b/dashboard-ui/scripts/playlists.js @@ -0,0 +1,206 @@ +(function ($, document) { + + var view = LibraryBrowser.getDefaultItemsView('Poster', 'List'); + + // The base query options + var query = { + + SortBy: "SortName", + SortOrder: "Ascending", + IncludeItemTypes: "Playlist", + Recursive: true, + Fields: "PrimaryImageAspectRatio,SortName,CumulativeRunTimeTicks", + StartIndex: 0 + }; + + function getSavedQueryKey() { + + return 'playlists' + (query.ParentId || ''); + } + + function reloadItems(page) { + + Dashboard.showLoadingMsg(); + + var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), query); + var promise2 = Dashboard.getCurrentUser(); + + $.when(promise1, promise2).done(function (response1, response2) { + + var result = response1[0]; + var user = response2[0]; + + // Scroll back up so they can see the results from the beginning + $(document).scrollTop(0); + + var html = ''; + + var pagingHtml = LibraryBrowser.getQueryPagingHtml({ + startIndex: query.StartIndex, + limit: query.Limit, + totalRecordCount: result.TotalRecordCount, + viewButton: true, + showLimit: false + }); + + $('.listTopPaging', page).html(pagingHtml).trigger('create'); + + updateFilterControls(page); + + if (result.TotalRecordCount) { + + if (view == "List") { + + html = LibraryBrowser.getListViewHtml({ + items: result.Items, + context: 'playlists', + sortBy: query.SortBy + }); + } + else if (view == "Poster") { + html = LibraryBrowser.getPosterViewHtml({ + items: result.Items, + shape: "square", + context: 'playlists', + showTitle: true, + lazy: true, + coverImage: true, + showItemCounts: true + }); + } + + html += pagingHtml; + $('.noItemsMessage', page).hide(); + + } else { + + $('.noItemsMessage', page).show(); + } + + $('.itemsContainer', page).html(html).trigger('create').createCardMenus(); + + $('.btnNextPage', page).on('click', function () { + query.StartIndex += query.Limit; + reloadItems(page); + }); + + $('.btnPreviousPage', page).on('click', function () { + query.StartIndex -= query.Limit; + reloadItems(page); + }); + + LibraryBrowser.saveQueryValues(getSavedQueryKey(), query); + + Dashboard.hideLoadingMsg(); + }); + } + + function updateFilterControls(page) { + + // Reset form values using the last used query + $('.radioSortBy', page).each(function () { + + this.checked = (query.SortBy || '').toLowerCase() == this.getAttribute('data-sortby').toLowerCase(); + + }).checkboxradio('refresh'); + + $('.radioSortOrder', page).each(function () { + + this.checked = (query.SortOrder || '').toLowerCase() == this.getAttribute('data-sortorder').toLowerCase(); + + }).checkboxradio('refresh'); + + $('.chkStandardFilter', page).each(function () { + + var filters = "," + (query.Filters || ""); + var filterName = this.getAttribute('data-filter'); + + this.checked = filters.indexOf(',' + filterName) != -1; + + }).checkboxradio('refresh'); + + $('#selectView', page).val(view).selectmenu('refresh'); + + $('#selectPageSize', page).val(query.Limit).selectmenu('refresh'); + } + + $(document).on('pageinit', "#playlistsPage", function () { + + var page = this; + + $('.radioSortBy', this).on('click', function () { + query.SortBy = this.getAttribute('data-sortby'); + reloadItems(page); + }); + + $('.radioSortOrder', this).on('click', function () { + query.SortOrder = this.getAttribute('data-sortorder'); + reloadItems(page); + }); + + $('.chkStandardFilter', this).on('change', function () { + + var filterName = this.getAttribute('data-filter'); + var filters = query.Filters || ""; + + filters = (',' + filters).replace(',' + filterName, '').substring(1); + + if (this.checked) { + filters = filters ? (filters + ',' + filterName) : filterName; + } + + query.StartIndex = 0; + query.Filters = filters; + + reloadItems(page); + }); + + $('#selectView', this).on('change', function () { + + view = this.value; + + reloadItems(page); + + LibraryBrowser.saveViewSetting(getSavedQueryKey(), view); + }); + + $('#selectPageSize', page).on('change', function () { + query.Limit = parseInt(this.value); + query.StartIndex = 0; + reloadItems(page); + }); + + }).on('pagebeforeshow', "#playlistsPage", function () { + + var page = this; + + query.ParentId = LibraryMenu.getTopParentId(); + + var limit = LibraryBrowser.getDefaultPageSize(); + + // If the default page size has changed, the start index will have to be reset + if (limit != query.Limit) { + query.Limit = limit; + query.StartIndex = 0; + } + + var viewkey = getSavedQueryKey(); + + LibraryBrowser.loadSavedQueryValues(viewkey, query); + + LibraryBrowser.getSavedViewSetting(viewkey).done(function (val) { + + if (val) { + $('#selectView', page).val(val).selectmenu('refresh').trigger('change'); + } else { + reloadItems(page); + } + }); + + }).on('pageshow', "#playlistsPage", function () { + + updateFilterControls(this); + + }); + +})(jQuery, document); \ No newline at end of file diff --git a/dashboard-ui/scripts/plugincatalogpage.js b/dashboard-ui/scripts/plugincatalogpage.js index 01e78e884b..f46380c966 100644 --- a/dashboard-ui/scripts/plugincatalogpage.js +++ b/dashboard-ui/scripts/plugincatalogpage.js @@ -59,7 +59,7 @@ var href = plugin.externalUrl ? plugin.externalUrl : "addplugin.html?name=" + encodeURIComponent(plugin.name) + "&guid=" + plugin.guid; var target = plugin.externalUrl ? ' target="_blank"' : ''; - html += "
"; + html += "
"; html += '
'; html += '
';