Esempio n. 1
0
		
		function setupTrackDisplay(id) {
			//console.log("Executing setupTrackDisplay: " + id);

			songClock = $E('#song'+id+' .clock');
			songItem = $E('#song'+id);
		
			songClock.removeClass('grey');
			songClock.addClass('green');
			songClock.setHTML('—');
			songItem.addClass('hilite');
						
			var name = $E('#song'+ id +' .name').getHTML().replace('&','&');
			document.title = name.trim() + " / <?php 
if (!empty($prefs_struct['banner'])) {
    echo escape_for_json($prefs_struct['banner']);
} else {
    echo "OPENTAPE";
}
?>
";		
		}
	
		function togglePlayback(id) {
			id = id.replace(/song/,'');
			songClock = $E('#song'+currentTrack+' .clock');
			songItem = $E('#song'+currentTrack); 
			// console.log("togglePlayback called with: " + id + " currentTrack is: " + currentTrack);
			
			if (id == currentTrack || id == null) { 
				if(playerStatus == "PAUSED"|| playerStatus=="IDLE") {
Esempio n. 2
0
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (isset($args['password1']) && !strcmp($args['password1'], $args['password2']) && !strcmp($command, "change_password")) {
    if (set_password($args['password1'])) {
        echo '{"status":true,"command":"' . $command . '","debug":""}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (!strcmp($command, "rename")) {
    if (get_magic_quotes_gpc()) {
        $_POST['artist'] = stripslashes($_POST['artist']);
        $_POST['title'] = stripslashes($_POST['title']);
    }
    if (rename_song($args['song_key'], $_POST['artist'], $_POST['title'])) {
        echo '{"status":true,"command":"' . $command . '","debug":"","args":{"song_key":"' . $args['song_key'] . '","artist":"' . escape_for_json($_POST['artist']) . '","title":"' . escape_for_json($_POST['title']) . '"}}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (!strcmp($command, "reorder")) {
    if (reorder_songs($args)) {
        echo '{"status":true,"command":"' . $command . '","debug":""}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }
} elseif (!strcmp($command, "delete")) {
    if (delete_song($_POST['args'])) {
        echo '{"status":true,"command":"' . $command . '","debug":"","args":"' . $_POST['args'] . '"}';
    } else {
        echo '{"status":false,"command":"' . $command . '","debug":""}';
    }