2012-10-04 20:34:45 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
|
|
|
|
<script>
|
|
|
|
function playSelected(id){
|
|
|
|
$("audio").attr("src","play?id="+id);
|
2012-10-04 22:33:33 +00:00
|
|
|
$("audio").get(0).play();
|
2012-10-04 20:34:45 +00:00
|
|
|
}
|
2012-10-04 22:23:39 +00:00
|
|
|
function search(term){
|
|
|
|
$.ajax({url:'/search?id='+term,
|
|
|
|
dataType: 'json',
|
|
|
|
success: function(data){
|
|
|
|
alert("SUCCESS");
|
|
|
|
for(var i=0; i<data.length;i++){
|
|
|
|
var title = data[i]["title"];
|
|
|
|
var group = data[i]["group"];
|
|
|
|
var id = data[i]["id"];
|
|
|
|
$("#searchresults").append("<li onClick='playSelected(\""+id+"\")'>"+title+" - "+group+" ["+id+"]</li>");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
};
|
2012-10-04 20:34:45 +00:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2012-10-04 22:23:39 +00:00
|
|
|
<div>
|
|
|
|
Go5ears. Because Flash simply sucks!
|
|
|
|
</div>
|
|
|
|
<div>
|
2012-10-04 20:34:45 +00:00
|
|
|
<audio src="play?id=a78950d" controls="controls"></audio>
|
2012-10-04 22:23:39 +00:00
|
|
|
<ul>
|
|
|
|
<li onClick='playSelected("fe7e4f9")'>Libertine</li>
|
|
|
|
<li onClick='playSelected("4b9ed95")'>We are the champions</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<form method="POST" onsubmit="search(this.goearsearch.value); return false">
|
|
|
|
Search GoEar: <input type="search" name="goearsearch">
|
|
|
|
</form>
|
|
|
|
<ul id="searchresults">
|
|
|
|
|
|
|
|
</ul>
|
|
|
|
</div>
|
2012-10-04 20:34:45 +00:00
|
|
|
</body>
|
|
|
|
</html>
|