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:
parent
fdda8549ba
commit
7a6bae9783
13 changed files with 152 additions and 41 deletions
|
@ -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);
|
Loading…
Add table
Add a link
Reference in a new issue