diff options
author | sigger <sigger@ampache> | 2006-01-22 05:27:55 +0000 |
---|---|---|
committer | sigger <sigger@ampache> | 2006-01-22 05:27:55 +0000 |
commit | ae2f3804c0b50ad338b1e694907b30d76e7d2ce8 (patch) | |
tree | 00175c8133d5d2caaf9033fb1602a4e172dbf253 /lib | |
parent | 5dd2629e8292aa472a135aa0a7458d4e1d6fbaab (diff) | |
download | ampache-ae2f3804c0b50ad338b1e694907b30d76e7d2ce8.tar.gz ampache-ae2f3804c0b50ad338b1e694907b30d76e7d2ce8.tar.bz2 ampache-ae2f3804c0b50ad338b1e694907b30d76e7d2ce8.zip |
moves mpd playlist npsong css
Diffstat (limited to 'lib')
-rw-r--r-- | lib/general.js | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/general.js b/lib/general.js index c3cf40f6..a5100222 100644 --- a/lib/general.js +++ b/lib/general.js @@ -1,6 +1,7 @@ /* The AJAX stuff */ var xmlHttp; var requestType=""; +var ret_songid=0; function createXMLHttpRequest() { @@ -67,7 +68,20 @@ function handleStateChange() { case 'now_playing' : if (player == 'mpd' && player_state != 'stop') { mpd_song_length = el.getElementsByTagName ('songlength')[0].firstChild.data; - mpd_songid = Math.round(el.getElementsByTagName ('songid')[0].firstChild.data); + ret_songid = Math.round(el.getElementsByTagName ('songid')[0].firstChild.data); + 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'; + } else { + 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 + " - " + |