';
}
+ if (options.selectionPanel) {
+ var chkItemSelectId = 'chkItemSelect' + i;
+
+ // Render this pre-enhanced to save on jquery mobile dom manipulation
+ html += '
';
+
+ }
+
if (!options.overlayText) {
if (progressHtml) {
@@ -898,7 +906,7 @@
var name = item.EpisodeTitle || item.Name;
- if (item.Type == "Channel") {
+ if (item.Type == "TvChannel") {
return item.Number + ' ' + name;
}
if (displayAsSpecial && item.Type == "Episode" && item.ParentIndexNumber == 0) {
@@ -954,7 +962,7 @@
getPlayedIndicatorHtml: function (item) {
- if (item.Type == "Channel") {
+ if (item.Type == "TvChannel") {
return '';
}
if (item.Type == "Series" || item.Type == "Season" || item.Type == "BoxSet" || item.MediaType == "Video" || item.MediaType == "Game" || item.MediaType == "Book") {
@@ -1294,7 +1302,7 @@
var itemId = item.Id;
var type = item.Type;
- if ((item.MediaType || item.IsFolder) && item.Type != "Channel" && item.Type != "MusicArtist") {
+ if ((item.MediaType || item.IsFolder) && item.Type != "TvChannel" && item.Type != "MusicArtist") {
if (userData.Played) {
html += '';
} else {
@@ -1485,7 +1493,7 @@
else if (item.Type == "Genre" || item.Type == "Studio") {
url = "css/images/items/detail/video.png";
}
- else if (item.Type == "Channel") {
+ else if (item.Type == "TvChannel") {
url = "css/images/items/detail/tv.png";
}
else {
diff --git a/dashboard-ui/scripts/librarylist.js b/dashboard-ui/scripts/librarylist.js
index be58d3d42..005b285cc 100644
--- a/dashboard-ui/scripts/librarylist.js
+++ b/dashboard-ui/scripts/librarylist.js
@@ -168,7 +168,7 @@
var id = elem.getAttribute('data-itemid');
}
- function getMenuOptions(elem) {
+ function getContextMenuOptions(elem) {
var items = [];
@@ -201,6 +201,10 @@
return;
}
+ if ($('.itemSelectionPanel', elem).length) {
+ return;
+ }
+
var innerElem = $('.posterItemOverlayTarget', elem);
var id = elem.getAttribute('data-itemid');
@@ -257,7 +261,7 @@
if (user.Configuration.IsAdministrator) {
sequence.createContextMenu({
- getOptions: getMenuOptions,
+ getOptions: getContextMenuOptions,
command: onMenuCommand,
selector: '.posterItem'
});
@@ -270,4 +274,79 @@
.on('mouseleave', '.backdropPosterItem,.smallBackdropPosterItem,.portraitPosterItem,.squarePosterItem', onHoverOut);
};
+ function toggleSelections(page) {
+
+ Dashboard.showLoadingMsg();
+
+ var selectionCommands = $('.selectionCommands', page);
+
+ if (selectionCommands.is(':visible')) {
+
+ selectionCommands.hide();
+ $('.itemSelectionPanel', page).hide();
+
+ } else {
+
+ selectionCommands.show();
+
+ $('.itemSelectionPanel', page).show();
+ }
+
+ Dashboard.hideLoadingMsg();
+ }
+
+ function hideSelections(page) {
+
+ $('.selectionCommands', page).hide();
+
+ $('.itemSelectionPanel', page).hide();
+ }
+
+ function getSelectedItems(page) {
+
+ var selection = $('.chkItemSelect:checked', page);
+
+ return selection.parents('.posterItem')
+ .map(function() {
+
+ return this.getAttribute('data-itemid');
+
+ }).get();
+ }
+
+ function combineVersions(page) {
+
+ var selection = getSelectedItems(page);
+
+ if (selection.length < 2) {
+
+ Dashboard.alert({
+ message: "Please select two or more items to combine.",
+ title: "Error"
+ });
+
+ return;
+ }
+
+ hideSelections();
+ }
+
+ $(document).on('pageinit', ".libraryPage", function () {
+
+ var page = this;
+
+ $('.btnToggleSelections', page).on('click', function () {
+ toggleSelections(page);
+ });
+
+ $('.itemsContainer', page).on('listrender', function () {
+ hideSelections(page);
+ });
+
+ $('.btnMergeVersions', page).on('click', function () {
+ combineVersions(page);
+ });
+
+ });
+
})(jQuery, document, window);
\ No newline at end of file
diff --git a/dashboard-ui/scripts/libraryreport.js b/dashboard-ui/scripts/libraryreport.js
index b170258a9..629f6115d 100644
--- a/dashboard-ui/scripts/libraryreport.js
+++ b/dashboard-ui/scripts/libraryreport.js
@@ -442,7 +442,7 @@
}
if (!item.BackdropImageTags || !item.BackdropImageTags.length) {
- if (item.Type !== "Episode" && item.Type !== "Season" && item.MediaType !== "Audio" && item.Type !== "Channel" && item.Type !== "MusicAlbum") {
+ if (item.Type !== "Episode" && item.Type !== "Season" && item.MediaType !== "Audio" && item.Type !== "TvChannel" && item.Type !== "MusicAlbum") {
html += '';
}
}
diff --git a/dashboard-ui/scripts/mediaplayer-video.js b/dashboard-ui/scripts/mediaplayer-video.js
index 54a3de071..a9003520e 100644
--- a/dashboard-ui/scripts/mediaplayer-video.js
+++ b/dashboard-ui/scripts/mediaplayer-video.js
@@ -56,7 +56,7 @@
$("#videoBackdrop", footer).hide();
- if ($("#footerNotifications", footer).html() == "") { // only hide footer if no notifications
+ if (!$("#footerNotifications", footer).html()) { // only hide footer if no notifications
footer.hide();
@@ -1036,7 +1036,7 @@
var errorMsg = 'There was an error playing the video.';
- if (item.Type == "Channel") {
+ if (item.Type == "TvChannel") {
errorMsg += " Please ensure there is an open tuner availalble.";
}
diff --git a/dashboard-ui/scripts/mediaplayer.js b/dashboard-ui/scripts/mediaplayer.js
index af8f53844..390698516 100644
--- a/dashboard-ui/scripts/mediaplayer.js
+++ b/dashboard-ui/scripts/mediaplayer.js
@@ -704,7 +704,7 @@
});
}
- else if (item.Type == "Channel" || item.Type == "Recording") {
+ else if (item.Type == "TvChannel" || item.Type == "Recording") {
url = "css/images/items/detail/tv.png";
}
else if (item.MediaType == "Audio") {
diff --git a/dashboard-ui/scripts/movies.js b/dashboard-ui/scripts/movies.js
index 24a5f882f..2c635083c 100644
--- a/dashboard-ui/scripts/movies.js
+++ b/dashboard-ui/scripts/movies.js
@@ -37,7 +37,8 @@
items: result.Items,
shape: "backdrop",
preferThumb: true,
- context: 'movies'
+ context: 'movies',
+ selectionPanel: true
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
@@ -48,7 +49,8 @@
context: 'movies',
useAverageAspectRatio: true,
showTitle: true,
- centerText: true
+ centerText: true,
+ selectionPanel: true
});
$('.itemsContainer', page).removeClass('timelineItemsContainer');
}
@@ -60,14 +62,15 @@
useAverageAspectRatio: true,
showTitle: true,
timeline: true,
- centerText: true
+ centerText: true,
+ selectionPanel: true
});
$('.itemsContainer', page).addClass('timelineItemsContainer');
}
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
- $('#items', page).html(html).trigger('create').createPosterItemMenus();
+ $('#items', page).html(html).trigger('create').createPosterItemMenus().trigger('listrender');
$('.btnNextPage', page).on('click', function () {
query.StartIndex += query.Limit;
diff --git a/dashboard-ui/scripts/site.js b/dashboard-ui/scripts/site.js
index 1a4b8a49a..4a2dc2a1e 100644
--- a/dashboard-ui/scripts/site.js
+++ b/dashboard-ui/scripts/site.js
@@ -318,19 +318,13 @@ var Dashboard = {
if (videoBackdrop.is(":visible")) {
- footer.css("height", "50px");
-
videoBackdrop.css("bottom", "48px");
isPlaying = true;
} else {
- if (!footer.is(":visible")) {
-
- footer.show();
-
- }
+ footer.show();
}