1
0
mirror of https://github.com/danbee/neompc synced 2025-03-04 08:39:10 +00:00
neompc/lib/javascript.js
Dan Barber 2cfbf0fc5f + Added track progress bar to the control screen. The javascript is untested in Pocket IE.
- Removed spurious styles.css file in the root directory.
2007-05-15 14:27:13 +00:00

32 lines
640 B
JavaScript

song_length = {$song_length};
song_position = {$song_position};
mpd_state = '{$mpd_state}';
{literal}
function update_progress() {
progressbar = document.getElementById('progressbar');
new_margin = Math.round(200 - ((song_position / song_length) * 200));
new_margin_string = new_margin + 'px';
progressbar.style.marginRight = new_margin_string;
//alert(progressbar.style.marginRight + ' - ' + new_margin_string);
if (song_position < song_length) {
song_position = song_position + 1;
}
}
if (mpd_state == 'play') {
update_int = setInterval('update_progress()', 1000);
}
{/literal}