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

fixes #791 - Support server-side playlists

This commit is contained in:
Luke Pulverenti 2014-08-02 22:16:37 -04:00
parent cd1e583fa7
commit ba247c8a15
33 changed files with 1131 additions and 716 deletions

View file

@ -149,6 +149,18 @@
return false;
}
function onAddToPlaylistButtonClick() {
var id = this.getAttribute('data-itemid');
PlaylistManager.showPanel([id]);
// Used by the tab menu, not the slide up
$('.tapHoldMenu').popup('close');
return false;
}
function onShuffleButtonClick() {
var id = this.getAttribute('data-itemid');
@ -281,6 +293,10 @@
html += '<li data-icon="recycle"><a href="#" class="btnShuffle" data-itemid="' + itemId + '">' + Globalize.translate('ButtonShuffle') + '</a></li>';
}
if (commands.indexOf('playlist') != -1) {
html += '<li data-icon="plus"><a href="#" class="btnAddToPlaylist" data-itemid="' + itemId + '">' + Globalize.translate('ButtonAddToPlaylist') + '</a></li>';
}
html += '</ul>';
html += '</div>';
@ -299,6 +315,7 @@
$('.btnInstantMix', elem).on('click', onInstantMixButtonClick);
$('.btnShuffle', elem).on('click', onShuffleButtonClick);
$('.btnPlayTrailer', elem).on('click', onTrailerButtonClick);
$('.btnAddToPlaylist', elem).on('click', onAddToPlaylistButtonClick);
});
}
@ -504,7 +521,8 @@
return this.off('.cardHoverMenu')
.on('mouseenter.cardHoverMenu', elems, onHoverIn)
.on('mouseleave.cardHoverMenu', elems, onHoverOut)
.on("touchstart.cardHoverMenu", elems, preventTouchHover);
.on("touchstart.cardHoverMenu", elems, preventTouchHover)
.trigger('itemsrendered');
};
function toggleSelections(page) {
@ -613,10 +631,31 @@
BoxSetEditor.showPanel(page, selection);
}
function addToPlaylist(page) {
var selection = getSelectedItems(page);
if (selection.length < 1) {
Dashboard.alert({
message: Globalize.translate('MessagePleaseSelectOneItem'),
title: Globalize.translate('HeaderError')
});
return;
}
PlaylistManager.showPanel(selection);
}
$(document).on('pageinit', ".libraryPage", function () {
var page = this;
$('.btnAddToPlaylist', page).on('click', function () {
addToPlaylist(page);
});
$('.btnMergeVersions', page).on('click', function () {
combineVersions(page);
});