Active playlists artist and track titles, drag control, play from tracklist
This commit is contained in:
@@ -51,17 +51,22 @@ class Player
|
||||
autoplay = false
|
||||
initial_count = $('.playlist-tracks li').length
|
||||
$('.playlist-tracks').append '
|
||||
<li id="i' +Math.round(Math.random() * 999999)+ '" data-artist="' +artist.trim()+ '" data-album="' +album.trim()+ '" data-track="' +track.trim()+ '" data-length="' +length+ '">
|
||||
<li id="i' +Math.round(Math.random() * 999999)+ '" data-id="" data-artist="' +artist.trim()+ '" data-album="' +album.trim()+ '" data-track="' +track.trim()+ '" data-length="' +length+ '">
|
||||
<div class="item">
|
||||
<div class="fade"></div>
|
||||
<span class="title" title="' +artist.htmlsafe()+ " — " +track.htmlsafe()+ '">' +artist+ ' — ' +track+ '</span>
|
||||
<div class="dragbox"></div>
|
||||
<span class="title">
|
||||
<span class="data artist" title="Open ' +artist.htmlsafe()+ '\'s page">' +artist+ '</span>
|
||||
—
|
||||
<span class="playtrack" title="Play ' +track.htmlsafe()+ ' by ' +artist.htmlsafe()+ '">' +track+ '</span>
|
||||
</span>
|
||||
<span class="duration">' +length+ '</span>
|
||||
<div class="remove">remove</div>
|
||||
</div>
|
||||
</li>'
|
||||
|
||||
$('.playlist').html($('.playlist-tracks')).scrollbar()
|
||||
$('.playlist-tracks').sortable()
|
||||
$('.playlist').html($('.playlist-tracks')).scrollbar
|
||||
$('.playlist-tracks').sortable axis: 'y', handle: '.dragbox'
|
||||
|
||||
if autoplay
|
||||
_player.setTrack($('.playlist-tracks li').last().attr('id').split('i')[1])
|
||||
@@ -200,8 +205,8 @@ $('.playlist-tracks li .remove').live 'click', ->
|
||||
$li.remove()
|
||||
false
|
||||
|
||||
$('.playlist-tracks li').live 'dblclick', ->
|
||||
_player.setTrack $(this).attr('id').split('i')[1]
|
||||
$('.playlist-tracks li .title .playtrack').live 'click', ->
|
||||
_player.setTrack $(this).parent().parent().parent().attr('id').split('i')[1]
|
||||
false
|
||||
|
||||
# Adding To Playlist actions
|
||||
@@ -230,7 +235,7 @@ $('.tracklist li').live 'mouseover mouseout', (e) ->
|
||||
$(this).find('.add-track').hide()
|
||||
false
|
||||
|
||||
$('.tracklist li').live 'dblclick', (e) ->
|
||||
$('.tracklist li').live 'click', (e) ->
|
||||
artist = $('.artist-info .name').html()
|
||||
album = $(this).parent().parent().parent().find('h2.name').text().replace /\s\([\d]{4}\)$/, ''
|
||||
track_name = $(this).find('.trackname').html()
|
||||
|
||||
@@ -58,3 +58,6 @@ $('#search_form').live 'submit', ->
|
||||
$('.suggestions a').live 'click', ->
|
||||
$('#search_field').val $(this).text()
|
||||
false
|
||||
$('.data.artist').live 'click', ->
|
||||
_ajax.go('/artist/'+$(this).text().replace(' ', '+')+'/');
|
||||
false;
|
||||
Reference in New Issue
Block a user