From 796843e9f300407f9e2b03b59e0d17ce18c8a985 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 22 Apr 2015 09:28:45 -0400 Subject: [PATCH] 3.0.5588.1 --- dashboard-ui/itemdetails.html | 6 +++ dashboard-ui/scripts/itemdetailpage.js | 3 ++ dashboard-ui/scripts/photos.js | 53 +++++++++++++++++++++++++- 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/dashboard-ui/itemdetails.html b/dashboard-ui/itemdetails.html index f0c76ed506..a8737d9935 100644 --- a/dashboard-ui/itemdetails.html +++ b/dashboard-ui/itemdetails.html @@ -110,6 +110,12 @@ ${TabStudios} + diff --git a/dashboard-ui/scripts/itemdetailpage.js b/dashboard-ui/scripts/itemdetailpage.js index ed46d1b2d5..8fff6fb249 100644 --- a/dashboard-ui/scripts/itemdetailpage.js +++ b/dashboard-ui/scripts/itemdetailpage.js @@ -282,6 +282,9 @@ $('.lnkMovies', page).addClass('ui-btn-active'); } } + else if (context == 'channels') { + elem = $('.channelTabs', page).show(); + } else if (item.Type == "MusicAlbum") { $('#albumTabs', page).show(); } diff --git a/dashboard-ui/scripts/photos.js b/dashboard-ui/scripts/photos.js index 1bd004c034..49ad1fd3ab 100644 --- a/dashboard-ui/scripts/photos.js +++ b/dashboard-ui/scripts/photos.js @@ -40,6 +40,8 @@ updateFilterControls(page); + var defaultAction = query.MediaTypes == 'Photo' ? 'photoslideshow' : null; + // Poster html = LibraryBrowser.getPosterViewHtml({ items: result.Items, @@ -47,7 +49,8 @@ context: getParameterByName('context') || 'photos', showTitle: false, centerText: true, - lazy: true + lazy: true, + defaultAction: defaultAction }); var elem = $('#items', page).html(html).lazyChildren(); @@ -134,6 +137,50 @@ query.ParentId = getParameterByName('parentId') || LibraryMenu.getTopParentId(); } + function startSlideshow(page, index) { + + index += (query.StartIndex || 0); + + var userId = Dashboard.getCurrentUserId(); + + var localQuery = $.extend({}, query); + localQuery.StartIndex = 0; + localQuery.Limit = null; + localQuery.MediaTypes = "Photo"; + localQuery.Recursive = true; + localQuery.Filters = "IsNotFolder"; + + ApiClient.getItems(userId, localQuery).done(function (result) { + + showSlideshow(page, result.Items, index); + }); + } + + function showSlideshow(page, items, index) { + + var slideshowItems = items.map(function (item) { + + var imgUrl = ApiClient.getScaledImageUrl(item.Id, { + + tag: item.ImageTags.Primary, + type: 'Primary' + + }); + + return { + title: item.Name, + href: imgUrl + }; + }); + + index = Math.max(index || 0, 0); + + $.swipebox(slideshowItems, { + initialIndexOnArray: index, + hideBarsDelay: 30000 + }); + } + $(document).on('pageinit', "#photosPage", function () { var page = this; @@ -197,6 +244,10 @@ reloadItems(page); }); + $('.itemsContainer', page).on('photoslideshow', function (e, index) { + startSlideshow(page, index); + }); + }).on('pagebeforeshow', "#photosPage", function () { var page = this;