Compare commits
No commits in common. "4bfaf9419f52973dca96e1334b80abb93036362f" and "69ba9e1d1470ad5fe799e7be756920c0ef59b955" have entirely different histories.
4bfaf9419f
...
69ba9e1d14
|
@ -9,22 +9,20 @@ $sth = $globaldbh->prepare($query);
|
|||
$sth->execute($fields);
|
||||
|
||||
$data = array();
|
||||
$data["customq"] = array();
|
||||
$firstsong = true;
|
||||
while ( $row = $sth->fetch() ) {
|
||||
$songid = $row['songid'];
|
||||
$song = new Song($songid);
|
||||
$curdata = array();
|
||||
$curdata["id"] = $song->getID();
|
||||
$curdata["arturl"] = $song->getArtFile(ARTURL);
|
||||
$curdata["title"] = $song->getTitle(HTMLSAFE);
|
||||
$curdata["artist"] = $song->getArtist(HTMLSAFE);
|
||||
$curdata["album"] = $song->getAlbum(HTMLSAFE);
|
||||
$curdata["year"] = $song->getYear(HTMLSAFE);
|
||||
$data['customq'][] = $curdata;
|
||||
echo "<div id='customq_{$songid}' class='songlist_song_container' onClick='dropCustomQSong({$songid});'>\n";
|
||||
echo " <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
|
||||
echo " <div class='songlist_details_container'>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
|
||||
echo " </div>\n";
|
||||
echo "</div>\n";
|
||||
echo "<hr class='songlist'>\n";
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
exit();
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ $data = array();
|
|||
foreach ( $queues as $queue ) {
|
||||
$newdata = array();
|
||||
$newdata['id'] = $queue->getID();
|
||||
$newdata['name'] = $queue->getName();
|
||||
$newdata['name'] = $queue->getName(HTMLSAFE);
|
||||
$newdata['type'] = $queue->getType();
|
||||
$newdata['active'] = $queue->getActive();
|
||||
$data['queues'][] = $newdata;
|
||||
|
@ -19,4 +19,4 @@ header('Content-Type: application/json');
|
|||
echo json_encode($data);
|
||||
exit();
|
||||
|
||||
// vim: et ts=3 sw=3 ai:
|
||||
?>
|
||||
|
|
|
@ -10,22 +10,18 @@ if ( isset($_REQUEST['searchfor']) ) {
|
|||
|
||||
$songs = Song::getSearchList($searchfor);
|
||||
|
||||
$data = array();
|
||||
$data["search"] = array();
|
||||
|
||||
foreach ( $songs as $song ) {
|
||||
$curdata = array();
|
||||
$curdata["id"] = $song->getID();
|
||||
$curdata["arturl"] = $song->getArtFile(ARTURL);
|
||||
$curdata["title"] = $song->getTitle(HTMLSAFE);
|
||||
$curdata["artist"] = $song->getArtist(HTMLSAFE);
|
||||
$curdata["album"] = $song->getAlbum(HTMLSAFE);
|
||||
$curdata["year"] = $song->getYear(HTMLSAFE);
|
||||
$data['search'][] = $curdata;
|
||||
echo "<div id='search_{$song->getID()}' class='songlist_song_container' onClick='addSongToQueue({$song->getID()});'>\n";
|
||||
echo " <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
|
||||
echo " <div class='songlist_details_container'>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
|
||||
echo " <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
|
||||
echo " </div>\n";
|
||||
echo "</div>\n";
|
||||
echo "<hr class='songlist'>\n";
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
exit();
|
||||
|
||||
// vim: sw=3 ts=3 et ai:
|
||||
|
||||
?>
|
||||
|
|
|
@ -208,9 +208,6 @@ div.lists_contents {
|
|||
font-weight: bold;
|
||||
text-align: center;
|
||||
}
|
||||
.search_link {
|
||||
cursor: pointer;
|
||||
}
|
||||
div.songlist_song_container {
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
|
|
|
@ -7,7 +7,7 @@ var gettingSongList = false;
|
|||
var gettingJukeboxList = false;
|
||||
var searchTimeout = null;
|
||||
var queueTarget = 0;
|
||||
var paused = false;
|
||||
var paused = true;
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#tabs').tabs({
|
||||
|
@ -193,9 +193,8 @@ function togglePause() {
|
|||
|
||||
function generateSongListHTML(type, songs) {
|
||||
var body = "";
|
||||
var search = (type == "search") ? " search_link" : "";
|
||||
songs.forEach(function(item, index, arr) {
|
||||
body += "<div id='" + type + "_" + item.id + "' data-id='" + item.id + "' class='songlist_song_container" + search + "'>";
|
||||
body += "<div id='" + type + "_" + item.id + "' class='songlist_song_container'>";
|
||||
body += "<div class='songlist_img_container'><img class='songlist_img' src='" + item.arturl + "' /></div>";
|
||||
body += "<div class='songlist_details_container'>";
|
||||
body += "<p><span>Title:</span> " + item.title + "</p>";
|
||||
|
@ -263,9 +262,9 @@ function getJukeboxList() {
|
|||
function getCustomQueueList() {
|
||||
$.ajax({
|
||||
url: 'ajax/ajax_getcustomq.php',
|
||||
dataType: 'json',
|
||||
dataType: 'html',
|
||||
success: function(data, stat, jqo) {
|
||||
$('#customq_contents').html(generateSongListHTML("customq", data.customq));
|
||||
$('#customq_contents').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -276,13 +275,10 @@ function executeSearch() {
|
|||
if ( searchfor.length < 4 ) return false;
|
||||
$.ajax({
|
||||
url: 'ajax/ajax_searchsongs.php',
|
||||
dataType: 'json',
|
||||
dataType: 'html',
|
||||
data: {searchfor: searchfor},
|
||||
success: function(data, stat, jqo) {
|
||||
$('#search_contents').html(generateSongListHTML("search", data.search));
|
||||
$(".search_link").on("click", function(event) {
|
||||
addSongToQueue($(event.currentTarget).data('id'));
|
||||
});
|
||||
$('#search_contents').html(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
Require all denied
|
||||
order deny,allow
|
||||
deny from all
|
||||
|
|
Loading…
Reference in New Issue
Block a user