';
html += '- Play Menu
';
@@ -345,7 +345,8 @@
var href = LibraryBrowser.getHrefInternal(item);
if (context) {
- href += "&context=" + context;
+ href += href.indexOf('?') == -1 ? "?context=" : "&context=";
+ href += context;
}
return href;
@@ -741,7 +742,21 @@
cssClass += ' posterItemUserData' + item.UserData.Key;
}
- html += '';
+ var itemCommands = [];
+
+ //if (MediaController.canPlay(item)) {
+ // itemCommands.push('playmenu');
+ //}
+
+ if (item.Type != "Recording" && item.Type != "Program") {
+ itemCommands.push('edit');
+ }
+
+ if (item.LocalTrailerCount) {
+ itemCommands.push('trailer');
+ }
+
+ html += '';
var style = "";
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index 4b6f3d1aab..3380e6e253 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -28,7 +28,7 @@
});
}
- function getOverlayHtml(item, currentUser, posterItem) {
+ function getOverlayHtml(item, currentUser, posterItem, commands) {
var html = '';
@@ -116,12 +116,12 @@
buttonCount++;
}
- if (item.LocalTrailerCount && item.PlayAccess == 'Full') {
+ if (commands.indexOf('trailer') != -1) {
html += '';
buttonCount++;
}
- if (currentUser.Configuration.IsAdministrator && item.Type != "Recording" && item.Type != "Program") {
+ if (currentUser.Configuration.IsAdministrator && commands.indexOf('edit') != -1) {
html += '';
buttonCount++;
}
@@ -141,40 +141,150 @@
MediaController.play({ items: trailers });
});
+ // Used by the tab menu, not the slide up
+ $('.tapHoldMenu').popup('close');
+
return false;
}
- function onMenuCommand(command, elem) {
+ function onShuffleButtonClick() {
- var id = elem.getAttribute('data-itemid');
- var page = $(elem).parents('.page');
+ var id = this.getAttribute('data-itemid');
- if (command == 'SplitVersions') {
- splitVersions(id, page);
- }
+ MediaController.shuffle(id);
+
+ // Used by the tab menu, not the slide up
+ $('.tapHoldMenu').popup('close');
+
+ return false;
}
- function splitVersions(id, page) {
+ function onInstantMixButtonClick() {
- Dashboard.confirm(Globalize.translate('MessageConfirmSplitMedia'), Globalize.translate('HeaderSplitMedia'), function (confirmResult) {
+ var id = this.getAttribute('data-itemid');
- if (confirmResult) {
+ MediaController.instantMix(id);
- Dashboard.showLoadingMsg();
+ // Used by the tab menu, not the slide up
+ $('.tapHoldMenu').popup('close');
- $.ajax({
- type: "DELETE",
- url: ApiClient.getUrl("Videos/" + id + "/AlternateSources")
+ return false;
+ }
- }).done(function () {
+ function onQueueButtonClick() {
- Dashboard.hideLoadingMsg();
+ var id = this.getAttribute('data-itemid');
- $('.itemsContainer', page).trigger('needsrefresh');
- });
- }
+ MediaController.queue(id);
+
+ // Used by the tab menu, not the slide up
+ $('.tapHoldMenu').popup('close');
+
+ return false;
+ }
+
+ function onPlayButtonClick() {
+
+ var id = this.getAttribute('data-itemid');
+
+ MediaController.play(id);
+
+ // Used by the tab menu, not the slide up
+ $('.tapHoldMenu').popup('close');
+
+ return false;
+ }
+
+ function onResumeButtonClick() {
+
+ var id = this.getAttribute('data-itemid');
+
+ MediaController.play({
+ ids: [id],
+ startPositionTicks: parseInt(this.getAttribute('data-ticks'))
});
+ // Used by the tab menu, not the slide up
+ $('.tapHoldMenu').popup('close');
+
+ return false;
+ }
+
+ function onPosterItemTapHold(e) {
+
+ $('.tapHoldMenu').popup("close").remove();
+
+ var posterItem = this;
+
+ var itemId = posterItem.getAttribute('data-itemid');
+ var commands = posterItem.getAttribute('data-commands').split(',');
+
+ var promise1 = ApiClient.getItem(Dashboard.getCurrentUserId(), itemId);
+ var promise2 = Dashboard.getCurrentUser();
+
+ $.when(promise1, promise2).done(function (response1, response2) {
+
+ var item = response1[0];
+ var user = response2[0];
+
+ var html = '';
+
+ $($.mobile.activePage).append(html);
+
+ var elem = $('.tapHoldMenu').popup({ positionTo: e.target }).trigger('create').popup("open").on("popupafterclose", function () {
+
+ $(this).off("popupafterclose").remove();
+
+ });
+
+ $('.btnPlay', elem).on('click', onPlayButtonClick);
+ $('.btnResume', elem).on('click', onResumeButtonClick);
+ $('.btnQueue', elem).on('click', onQueueButtonClick);
+ $('.btnInstantMix', elem).on('click', onInstantMixButtonClick);
+ $('.btnShuffle', elem).on('click', onShuffleButtonClick);
+ $('.btnPlayTrailer', elem).on('click', onShuffleButtonClick);
+ });
+
+ e.preventDefault();
+ return false;
}
$.fn.createPosterItemMenus = function () {
@@ -193,6 +303,7 @@
var innerElem = $('.posterItemOverlayTarget', elem);
var id = elem.getAttribute('data-itemid');
+ var commands = elem.getAttribute('data-commands').split(',');
var promise1 = ApiClient.getItem(Dashboard.getCurrentUserId(), id);
var promise2 = Dashboard.getCurrentUser();
@@ -202,7 +313,7 @@
var item = response1[0];
var user = response2[0];
- innerElem.html(getOverlayHtml(item, user, elem)).trigger('create');
+ innerElem.html(getOverlayHtml(item, user, elem, commands)).trigger('create');
$('.btnPlayTrailer', innerElem).on('click', onTrailerButtonClick);
});
@@ -241,6 +352,11 @@
var elems = '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem,.miniBackdropPosterItem';
+ if ($.browser.mobile) {
+ this.off('contextmenu.posterItemMenu', elems)
+ .on('contextmenu.posterItemMenu', elems, onPosterItemTapHold);
+ }
+
return this.off('.posterItemHoverMenu')
.on('mouseenter.posterItemHoverMenu', elems, onHoverIn)
.on('mouseleave.posterItemHoverMenu', elems, onHoverOut)
diff --git a/dashboard-ui/scripts/librarymenu.js b/dashboard-ui/scripts/librarymenu.js
index 580c854bb9..2108eeea67 100644
--- a/dashboard-ui/scripts/librarymenu.js
+++ b/dashboard-ui/scripts/librarymenu.js
@@ -128,6 +128,10 @@
else if (i.CollectionType == "livetv") {
itemId = "livetv";
}
+
+ if (i.Type == 'Channel') {
+ viewMenuCssClass = 'channelsViewMenu';
+ }
return '';
diff --git a/dashboard-ui/scripts/mypreferencesdisplay.js b/dashboard-ui/scripts/mypreferencesdisplay.js
index 8771333a0b..1ed1720aed 100644
--- a/dashboard-ui/scripts/mypreferencesdisplay.js
+++ b/dashboard-ui/scripts/mypreferencesdisplay.js
@@ -6,6 +6,7 @@
$('#chkDisplayUnairedEpisodes', page).checked(user.Configuration.DisplayUnairedEpisodes || false).checkboxradio("refresh");
$('#chkGroupMoviesIntoCollections', page).checked(user.Configuration.GroupMoviesIntoBoxSets || false).checkboxradio("refresh");
+ $('#chkDisplayCollectionView', page).checked(user.Configuration.DisplayCollectionsView || false).checkboxradio("refresh");
ApiClient.getItems(user.Id, {}).done(function (result) {
@@ -75,6 +76,8 @@
user.Configuration.DisplayUnairedEpisodes = $('#chkDisplayUnairedEpisodes', page).checked();
user.Configuration.GroupMoviesIntoBoxSets = $('#chkGroupMoviesIntoCollections', page).checked();
+ user.Configuration.DisplayCollectionsView = $('#chkDisplayCollectionView', page).checked();
+
user.Configuration.ExcludeFoldersFromGrouping = $(".chkGroupFolder:not(:checked)", page).get().map(function (i) {
return i.getAttribute('data-folderid');
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 32addeae6e..480711dde1 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -1224,16 +1224,16 @@ $(function () {
videoPlayerHtml += '';
videoPlayerHtml += '';
- videoPlayerHtml += '';
+ videoPlayerHtml += '';
videoPlayerHtml += '';
- videoPlayerHtml += '';
+ videoPlayerHtml += '';
videoPlayerHtml += '';
- videoPlayerHtml += '';
+ videoPlayerHtml += '';
videoPlayerHtml += '';
- videoPlayerHtml += '';
+ videoPlayerHtml += '';
videoPlayerHtml += '';
diff --git a/dashboard-ui/scripts/tvgenres.js b/dashboard-ui/scripts/tvgenres.js
index 2b638d6c88..be5eaf8dc5 100644
--- a/dashboard-ui/scripts/tvgenres.js
+++ b/dashboard-ui/scripts/tvgenres.js
@@ -38,12 +38,14 @@
context: 'tv',
preferThumb: true,
showItemCounts: true,
- centerText: true
+ centerText: true,
+ lazy: true
+
});
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
- $('#items', page).html(html).trigger('create');
+ $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
diff --git a/dashboard-ui/scripts/tvpeople.js b/dashboard-ui/scripts/tvpeople.js
index 9fe06daa7f..2feb65eaa7 100644
--- a/dashboard-ui/scripts/tvpeople.js
+++ b/dashboard-ui/scripts/tvpeople.js
@@ -45,7 +45,7 @@
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, false, [], false);
- $('#items', page).html(html).trigger('create');
+ $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
diff --git a/dashboard-ui/scripts/tvstudios.js b/dashboard-ui/scripts/tvstudios.js
index 9f1012633b..3c820a1c5c 100644
--- a/dashboard-ui/scripts/tvstudios.js
+++ b/dashboard-ui/scripts/tvstudios.js
@@ -38,12 +38,14 @@
context: 'tv',
preferThumb: true,
showItemCounts: true,
- centerText: true
+ centerText: true,
+ lazy: true
+
});
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
- $('#items', page).html(html).trigger('create');
+ $('#items', page).html(html).trigger('create').createPosterItemMenus();
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;