1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-04 02:09:23 +02:00

moves mpd playlist npsong css

This commit is contained in:
sigger 2006-01-22 05:27:55 +00:00
parent 5dd2629e82
commit ae2f3804c0
2 changed files with 17 additions and 1 deletions

View file

@ -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 + " - " +

View file

@ -13,6 +13,8 @@ if ($user->prefs['play_type'] == 'mpd') {
'; var mpd_elapsed = '. $myMpd->current_track_position .
'; var mpd_song_length = '. $myMpd->current_track_length .
'; var mpd_songid = '.$myMpd->current_track_id.
'; var mpdpl_first = 0' .
// $myMpd->current_track_id-1 .
'; var player_state = "'. $myMpd->state .'";';
} else {
echo 'var player = "'. $user->prefs['play_type'] .