edit tags button appends a lol to the song name
This commit is contained in:
parent
78cd66d8df
commit
f9c820bdbf
2 changed files with 54 additions and 59 deletions
|
|
@ -1658,15 +1658,7 @@ function setUpPlaylistUi(){
|
|||
left: event.pageX + 1,
|
||||
top: event.pageY + 1
|
||||
});
|
||||
if (!permissions.admin) {
|
||||
$playlistMenu.find('.delete')
|
||||
.addClass('ui-state-disabled')
|
||||
.attr('title', "Insufficient privileges. See Settings.");
|
||||
} else {
|
||||
$playlistMenu.find('.delete')
|
||||
.removeClass('ui-state-disabled')
|
||||
.attr('title', '');
|
||||
}
|
||||
updateAdminActions($playlistMenu);
|
||||
}
|
||||
});
|
||||
$playlistItems.on('mousedown', function(){
|
||||
|
|
@ -1681,23 +1673,42 @@ function setUpPlaylistUi(){
|
|||
removeContextMenu();
|
||||
return false;
|
||||
});
|
||||
$playlistMenu.on('click', '.download', function(){
|
||||
removeContextMenu();
|
||||
$playlistMenu.on('click', '.download', onDownloadContextMenu);
|
||||
$playlistMenu.on('click', '.delete', onDeleteContextMenu);
|
||||
$playlistMenu.on('click', '.edit-tags', onEditTagsContextMenu);
|
||||
}
|
||||
|
||||
if (selection.isMulti()) {
|
||||
downloadKeys(selection.toTrackKeys());
|
||||
return false;
|
||||
}
|
||||
function onDownloadContextMenu() {
|
||||
removeContextMenu();
|
||||
|
||||
return true;
|
||||
});
|
||||
$playlistMenu.on('click', '.delete', function(){
|
||||
if (!permissions.admin) return false;
|
||||
handleDeletePressed(true);
|
||||
removeContextMenu();
|
||||
if (selection.isMulti()) {
|
||||
downloadKeys(selection.toTrackKeys());
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
function onDeleteContextMenu() {
|
||||
if (!permissions.admin) return false;
|
||||
handleDeletePressed(true);
|
||||
removeContextMenu();
|
||||
return false;
|
||||
}
|
||||
function onEditTagsContextMenu() {
|
||||
if (!permissions.admin) return false;
|
||||
editTags();
|
||||
removeContextMenu();
|
||||
return false;
|
||||
}
|
||||
function editTags() {
|
||||
var trackKeys = selection.toTrackKeys();
|
||||
var cmd = {};
|
||||
trackKeys.forEach(function(trackKey) {
|
||||
cmd[trackKey] = {
|
||||
name: player.library.trackTable[trackKey].name + "_lol",
|
||||
};
|
||||
});
|
||||
player.sendCommand('updateTags', cmd);
|
||||
}
|
||||
|
||||
function updateSliderUi(value){
|
||||
|
|
@ -2112,22 +2123,9 @@ function setUpLibraryUi(){
|
|||
removeContextMenu();
|
||||
return false;
|
||||
});
|
||||
$libraryMenu.on('click', '.download', function(){
|
||||
removeContextMenu();
|
||||
|
||||
if (selection.isMulti()) {
|
||||
downloadKeys(selection.toTrackKeys());
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
$libraryMenu.on('click', '.delete', function(){
|
||||
if (!permissions.admin) return false;
|
||||
handleDeletePressed(true);
|
||||
removeContextMenu();
|
||||
return false;
|
||||
});
|
||||
$libraryMenu.on('click', '.download', onDownloadContextMenu);
|
||||
$libraryMenu.on('click', '.delete', onDeleteContextMenu);
|
||||
$libraryMenu.on('click', '.edit-tags', onEditTagsContextMenu);
|
||||
}
|
||||
|
||||
function genericTreeUi($elem, options){
|
||||
|
|
@ -2217,21 +2215,24 @@ function genericTreeUi($elem, options){
|
|||
left: event.pageX + 1,
|
||||
top: event.pageY + 1
|
||||
});
|
||||
if (!permissions.admin) {
|
||||
$libraryMenu.find('.delete')
|
||||
.addClass('ui-state-disabled')
|
||||
.attr('title', "Insufficient privileges. See Settings.");
|
||||
} else {
|
||||
$libraryMenu.find('.delete')
|
||||
.removeClass('ui-state-disabled')
|
||||
.attr('title', '');
|
||||
}
|
||||
updateAdminActions($libraryMenu);
|
||||
}
|
||||
});
|
||||
$elem.on('mousedown', function(){
|
||||
return false;
|
||||
});
|
||||
}
|
||||
function updateAdminActions($menu) {
|
||||
if (!permissions.admin) {
|
||||
$menu.find('.delete,.edit-tags')
|
||||
.addClass('ui-state-disabled')
|
||||
.attr('title', "Insufficient privileges. See Settings.");
|
||||
} else {
|
||||
$menu.find('.delete,.edit-tags')
|
||||
.removeClass('ui-state-disabled')
|
||||
.attr('title', '');
|
||||
}
|
||||
}
|
||||
function setUpUi(){
|
||||
setUpGenericUi();
|
||||
setUpPlaylistUi();
|
||||
|
|
|
|||
|
|
@ -291,24 +291,18 @@
|
|||
</div>
|
||||
<ul id="menu-playlist" style="display: none">
|
||||
<li><a href="#" class="remove">Remove</a></li>
|
||||
<li>
|
||||
<a href="#" class="delete">Delete From Library</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="download" target="_blank">Download</a>
|
||||
</li>
|
||||
<li><a href="#" class="delete">Delete From Library</a></li>
|
||||
<li><a href="#" class="download" target="_blank">Download</a></li>
|
||||
<li><a href="#" class="edit-tags">Edit Tags</a></li>
|
||||
</ul>
|
||||
<ul id="menu-library" style="display: none">
|
||||
<li><a href="#" class="queue">Queue</a></li>
|
||||
<li><a href="#" class="queue-next">Queue Next</a></li>
|
||||
<li><a href="#" class="queue-random">Queue in Random Order</a></li>
|
||||
<li><a href="#" class="queue-next-random">Queue Next in Random Order</a></li>
|
||||
<li>
|
||||
<a href="#" class="delete">Delete</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#" class="download" target="_blank">Download</a>
|
||||
</li>
|
||||
<li><a href="#" class="delete">Delete</a></li>
|
||||
<li><a href="#" class="download" target="_blank">Download</a></li>
|
||||
<li><a href="#" class="edit-tags">Edit Tags</a></li>
|
||||
</ul>
|
||||
<script src="vendor/jquery-2.1.0.min.js"></script>
|
||||
<script src="vendor/jquery-ui-1.10.4.custom.min.js"></script>
|
||||
|
|
|
|||
Loading…
Reference in a new issue