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:
parent
5dd2629e82
commit
ae2f3804c0
2 changed files with 17 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
||||||
/* The AJAX stuff */
|
/* The AJAX stuff */
|
||||||
var xmlHttp;
|
var xmlHttp;
|
||||||
var requestType="";
|
var requestType="";
|
||||||
|
var ret_songid=0;
|
||||||
|
|
||||||
|
|
||||||
function createXMLHttpRequest() {
|
function createXMLHttpRequest() {
|
||||||
|
@ -67,7 +68,20 @@ function handleStateChange() {
|
||||||
case 'now_playing' :
|
case 'now_playing' :
|
||||||
if (player == 'mpd' && player_state != 'stop') {
|
if (player == 'mpd' && player_state != 'stop') {
|
||||||
mpd_song_length = el.getElementsByTagName ('songlength')[0].firstChild.data;
|
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 =
|
document.getElementById ('mpd_npinfo').firstChild.data =
|
||||||
1+mpd_songid + ". " +
|
1+mpd_songid + ". " +
|
||||||
el.getElementsByTagName ('songartist')[0].firstChild.data + " - " +
|
el.getElementsByTagName ('songartist')[0].firstChild.data + " - " +
|
||||||
|
|
|
@ -13,6 +13,8 @@ if ($user->prefs['play_type'] == 'mpd') {
|
||||||
'; var mpd_elapsed = '. $myMpd->current_track_position .
|
'; var mpd_elapsed = '. $myMpd->current_track_position .
|
||||||
'; var mpd_song_length = '. $myMpd->current_track_length .
|
'; var mpd_song_length = '. $myMpd->current_track_length .
|
||||||
'; var mpd_songid = '.$myMpd->current_track_id.
|
'; var mpd_songid = '.$myMpd->current_track_id.
|
||||||
|
'; var mpdpl_first = 0' .
|
||||||
|
// $myMpd->current_track_id-1 .
|
||||||
'; var player_state = "'. $myMpd->state .'";';
|
'; var player_state = "'. $myMpd->state .'";';
|
||||||
} else {
|
} else {
|
||||||
echo 'var player = "'. $user->prefs['play_type'] .
|
echo 'var player = "'. $user->prefs['play_type'] .
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue