diff options
author | sigger <sigger@ampache> | 2006-01-23 02:18:47 +0000 |
---|---|---|
committer | sigger <sigger@ampache> | 2006-01-23 02:18:47 +0000 |
commit | 706aadf51fe5c4ae57f764e9bb9d187e43f5b321 (patch) | |
tree | f2017d72b369b73ef88f44c3e632393fb3b44e86 /lib | |
parent | 8fa920754404871e5c1e5f7f7af07bd5f4de6bec (diff) | |
download | ampache-706aadf51fe5c4ae57f764e9bb9d187e43f5b321.tar.gz ampache-706aadf51fe5c4ae57f764e9bb9d187e43f5b321.tar.bz2 ampache-706aadf51fe5c4ae57f764e9bb9d187e43f5b321.zip |
touchup mpd pl ajax
Diffstat (limited to 'lib')
-rw-r--r-- | lib/general.js | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/lib/general.js b/lib/general.js index a5100222..444029d2 100644 --- a/lib/general.js +++ b/lib/general.js @@ -66,30 +66,34 @@ function handleStateChange() { } // end if mpd changed player_state break; case 'now_playing' : + ret_songid = Math.round(el.getElementsByTagName ('songid')[0].firstChild.data); if (player == 'mpd' && player_state != 'stop') { mpd_song_length = el.getElementsByTagName ('songlength')[0].firstChild.data; - ret_songid = Math.round(el.getElementsByTagName ('songid')[0].firstChild.data); + document.getElementById ('mpd_npinfo').firstChild.data = + 1+ret_songid + ". " + + el.getElementsByTagName ('songartist')[0].firstChild.data + " - " + + el.getElementsByTagName ('songtitle')[0].firstChild.data + " - " + + el.getElementsByTagName ('songalbum')[0].firstChild.data + " - " + + fmt_time(mpd_song_length); + } if (ret_songid != mpd_songid) { if (document.getElementById ('mpd_row'+mpd_songid) != null) { if ((mpd_songid - mpdpl_first) %2 == 1) { - document.getElementById ('mpd_row'+mpd_songid).className = 'even'; + document.getElementById ('mpd_row'+mpd_songid).className = 'even'; } else { - document.getElementById ('mpd_row'+mpd_songid).className = 'odd'; - } + document.getElementById ('mpd_row'+mpd_songid).className = 'odd'; } - if (document.getElementById ('mpd_row'+ret_songid) != null) { - document.getElementById ('mpd_row'+ret_songid).className = 'npsong'; - } - mpd_songid = ret_songid; } - document.getElementById ('mpd_npinfo').firstChild.data = - 1+mpd_songid + ". " + - el.getElementsByTagName ('songartist')[0].firstChild.data + " - " + - el.getElementsByTagName ('songtitle')[0].firstChild.data + " - " + - el.getElementsByTagName ('songalbum')[0].firstChild.data + " - " + - fmt_time(mpd_song_length); - } - break; + if (player_state != 'stop') { + + if ((document.getElementById ('mpd_row'+ret_songid) != null) && (player_state != 'stop')) { + document.getElementById ('mpd_row'+ret_songid).className = 'npsong'; + } + } + + mpd_songid = ret_songid; + } + break; case 'now_playing_display' : // fix for pages where now playing data doesnt exist if (document.getElementById('np_songid_0_holder')) { |