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,
|
left: event.pageX + 1,
|
||||||
top: event.pageY + 1
|
top: event.pageY + 1
|
||||||
});
|
});
|
||||||
if (!permissions.admin) {
|
updateAdminActions($playlistMenu);
|
||||||
$playlistMenu.find('.delete')
|
|
||||||
.addClass('ui-state-disabled')
|
|
||||||
.attr('title', "Insufficient privileges. See Settings.");
|
|
||||||
} else {
|
|
||||||
$playlistMenu.find('.delete')
|
|
||||||
.removeClass('ui-state-disabled')
|
|
||||||
.attr('title', '');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$playlistItems.on('mousedown', function(){
|
$playlistItems.on('mousedown', function(){
|
||||||
|
|
@ -1681,23 +1673,42 @@ function setUpPlaylistUi(){
|
||||||
removeContextMenu();
|
removeContextMenu();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$playlistMenu.on('click', '.download', function(){
|
$playlistMenu.on('click', '.download', onDownloadContextMenu);
|
||||||
removeContextMenu();
|
$playlistMenu.on('click', '.delete', onDeleteContextMenu);
|
||||||
|
$playlistMenu.on('click', '.edit-tags', onEditTagsContextMenu);
|
||||||
|
}
|
||||||
|
|
||||||
if (selection.isMulti()) {
|
function onDownloadContextMenu() {
|
||||||
downloadKeys(selection.toTrackKeys());
|
removeContextMenu();
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
if (selection.isMulti()) {
|
||||||
});
|
downloadKeys(selection.toTrackKeys());
|
||||||
$playlistMenu.on('click', '.delete', function(){
|
|
||||||
if (!permissions.admin) return false;
|
|
||||||
handleDeletePressed(true);
|
|
||||||
removeContextMenu();
|
|
||||||
return false;
|
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){
|
function updateSliderUi(value){
|
||||||
|
|
@ -2112,22 +2123,9 @@ function setUpLibraryUi(){
|
||||||
removeContextMenu();
|
removeContextMenu();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$libraryMenu.on('click', '.download', function(){
|
$libraryMenu.on('click', '.download', onDownloadContextMenu);
|
||||||
removeContextMenu();
|
$libraryMenu.on('click', '.delete', onDeleteContextMenu);
|
||||||
|
$libraryMenu.on('click', '.edit-tags', onEditTagsContextMenu);
|
||||||
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;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function genericTreeUi($elem, options){
|
function genericTreeUi($elem, options){
|
||||||
|
|
@ -2217,21 +2215,24 @@ function genericTreeUi($elem, options){
|
||||||
left: event.pageX + 1,
|
left: event.pageX + 1,
|
||||||
top: event.pageY + 1
|
top: event.pageY + 1
|
||||||
});
|
});
|
||||||
if (!permissions.admin) {
|
updateAdminActions($libraryMenu);
|
||||||
$libraryMenu.find('.delete')
|
|
||||||
.addClass('ui-state-disabled')
|
|
||||||
.attr('title', "Insufficient privileges. See Settings.");
|
|
||||||
} else {
|
|
||||||
$libraryMenu.find('.delete')
|
|
||||||
.removeClass('ui-state-disabled')
|
|
||||||
.attr('title', '');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$elem.on('mousedown', function(){
|
$elem.on('mousedown', function(){
|
||||||
return false;
|
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(){
|
function setUpUi(){
|
||||||
setUpGenericUi();
|
setUpGenericUi();
|
||||||
setUpPlaylistUi();
|
setUpPlaylistUi();
|
||||||
|
|
|
||||||
|
|
@ -291,24 +291,18 @@
|
||||||
</div>
|
</div>
|
||||||
<ul id="menu-playlist" style="display: none">
|
<ul id="menu-playlist" style="display: none">
|
||||||
<li><a href="#" class="remove">Remove</a></li>
|
<li><a href="#" class="remove">Remove</a></li>
|
||||||
<li>
|
<li><a href="#" class="delete">Delete From Library</a></li>
|
||||||
<a href="#" class="delete">Delete From Library</a>
|
<li><a href="#" class="download" target="_blank">Download</a></li>
|
||||||
</li>
|
<li><a href="#" class="edit-tags">Edit Tags</a></li>
|
||||||
<li>
|
|
||||||
<a href="#" class="download" target="_blank">Download</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<ul id="menu-library" style="display: none">
|
<ul id="menu-library" style="display: none">
|
||||||
<li><a href="#" class="queue">Queue</a></li>
|
<li><a href="#" class="queue">Queue</a></li>
|
||||||
<li><a href="#" class="queue-next">Queue Next</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-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="queue-next-random">Queue Next in Random Order</a></li>
|
||||||
<li>
|
<li><a href="#" class="delete">Delete</a></li>
|
||||||
<a href="#" class="delete">Delete</a>
|
<li><a href="#" class="download" target="_blank">Download</a></li>
|
||||||
</li>
|
<li><a href="#" class="edit-tags">Edit Tags</a></li>
|
||||||
<li>
|
|
||||||
<a href="#" class="download" target="_blank">Download</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
<script src="vendor/jquery-2.1.0.min.js"></script>
|
<script src="vendor/jquery-2.1.0.min.js"></script>
|
||||||
<script src="vendor/jquery-ui-1.10.4.custom.min.js"></script>
|
<script src="vendor/jquery-ui-1.10.4.custom.min.js"></script>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue