1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

progress on channels api

This commit is contained in:
Luke Pulverenti 2014-03-17 21:45:41 -04:00
parent fdda8549ba
commit 7a6bae9783
13 changed files with 152 additions and 41 deletions

View file

@ -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);