diff --git a/css/main.css b/css/main.css index 8b13789..b7a19a2 100644 --- a/css/main.css +++ b/css/main.css @@ -1 +1,21 @@ +html,body { + height: 100%; +} +* { + margin:0; +} + .sortable { position:relative; list-style-type: none; margin: 0; padding: 0; width: 100%; } + .sortable li { margin: 0px 3px 3px 3px; padding: 0.4em; font-size: 1em; height: 18px; } + .list-name { padding-left:3em; } + .list-controls span {float:left;display:inline;} +#wrapper { + position:relative; + height: auto !important; + min-height: 90%; + margin: 0 auto 0; +} +#headerPage { + position:relative; + min-height:10%; +} diff --git a/js/app.js b/js/app.js new file mode 100644 index 0000000..612a65a --- /dev/null +++ b/js/app.js @@ -0,0 +1,93 @@ +var audio; +var playlist; +var tracks; +var current; + +function pauseSelected(id,emitter){ + var newUrl = 'play?id='+id; + console.log("Already playing:"+audio.src); + audio.pause(); + $(emitter).addClass('ui-icon ui-icon-play').removeClass('ui-icon-pause'); + $(emitter).unbind('click'); + $(emitter).click(function(){ + playSelected(id,emitter); + }); +} +function resumeSelected(id,emitter){ + console.log("Resuming:"+audio.src); + audio.play(); + $(emitter).addClass('ui-icon ui-icon-pause').removeClass('ui-icon-stop ui-icon-play'); + $(emitter).unbind('click'); + $(emitter).click(function(){ + pauseSelected(id,emitter); + }); +} +function playSelected(id,emitter){ + if(audio.src.indexOf(id)!=-1){ + resumeSelected(id,emitter); + } + else{ + console.log("Not playing:"+audio.src); + audio.src = 'play?id='+id; + audio.load(); + $(emitter).removeAttr('onClick'); + $(".list-controls > span").removeClass('ui-icon-stop ui-icon-pause').addClass('ui-icon-play'); + resumeSelected(id,emitter); + } +} + +function search(term){ + $.ajax({url:'/search?id='+term, + dataType: 'json', + success: function(data){ + for(var i=0; i'+ + '
'+ + ' '+ + ' '+ + ' '+ + '
'+ + '
'+group+' - '+title+'
'+ + ''; +} + +$(function() { + $( ".sortable" ).sortable(); + $( ".sortable" ).disableSelection(); + $( "#accordion" ).accordion({fillSpace:true}); +}); + +$('.accordion .head').click(function() { + $(this).next().toggle(); + return false; +}).next().hide(); + + +$(document).ready(function(){ + audio = $('audio')[0]; + playlist = $('#playlist'); + + tracks = []; + + var champions = { id:"4b9ed95", + title:"We are the champions", + group:"Queen"}; + var libertine = { id:"fe7e4f9", + title:"Libertine", + group:"Kate Ryan"}; + addSelected(libertine["id"],libertine["title"],libertine["group"]); + addSelected(champions["id"],champions["title"],champions["group"]); +}); diff --git a/public/index.html b/public/index.html index b3330b0..197459e 100644 --- a/public/index.html +++ b/public/index.html @@ -1,153 +1,39 @@ - - - + + + + + + + - - - - - - -
-

Go5ears. Because Flash simply sucks!

-

-
-
-
- -
-
    -
-
-
-
- Search GoEar: -
-
    -
-
-
-
- + +
+

Go5ears. Because Flash simply sucks!

+

+
+
+
+ +
+
    +
+
+
+
+ Search GoEar: +
+
    +
+
+
+
+