diff --git a/public/css/ntunes.less b/public/css/ntunes.less index edb21bf..83b4b47 100644 --- a/public/css/ntunes.less +++ b/public/css/ntunes.less @@ -355,16 +355,12 @@ body { * Where library and playlist browsing happens */ #songCanvas { - overflow-y:scroll; + overflow-y:auto; -webkit-border-radius:0 0 5px 0; border: 0; float: left; - ul { - padding:8px 0 0 0; - list-style:none; - } - li:nth-child(even) { + a:nth-child(even) { background:#F3F7FB; } a { @@ -378,7 +374,7 @@ body { } } .focus { - background:#3691E8; + background:#3691E8 !important; color:#fff; } } diff --git a/public/js/ntunes.js b/public/js/ntunes.js index 4509a3c..488d74b 100644 --- a/public/js/ntunes.js +++ b/public/js/ntunes.js @@ -14,10 +14,10 @@ ntunes = { var html = ''; for (var i=0; i < this.songs.length; i++) { - html += '
  • ' + this.songs[i].title + '
  • ' + html += '' + this.songs[i].title + '' }; - $('#songCanvas ul').html(html); + $('#songCanvas').html(html); songClickandPlay(); @@ -144,6 +144,7 @@ function songClickandPlay() { sCan.dblclick(function(e){ var target = $(e.target); if (target.attr('href')) { + target.attr('id', 'playing'); var title = target.text(); var artist = target.attr('title'); var song = target.attr('href'); @@ -158,6 +159,9 @@ function songClickandPlay() { song + '.mp3" />'); } + document.getElementById('playa').addEventListener('onended', function(){ + $('#playing').next('A').dblclick().end().attr('id', ''); + }, false); }); $('#playPause').click(function(){ @@ -173,6 +177,16 @@ function songClickandPlay() { } }); + $('#nextSong').click(function(e){ + e.preventDefault(); + $('#playing').next('A').dblclick().end().attr('id', ''); + }); + + $('#prevSong').click(function(e){ + e.preventDefault(); + $('#playing').prev('A').dblclick().end().attr('id', ''); + }); + $('body').keypress(function(e){ if (e.keyCode == '32') { $('#playPause').click(); diff --git a/server.js b/server.js index 6d9a0b9..e14af54 100644 --- a/server.js +++ b/server.js @@ -8,7 +8,7 @@ var // Module Deps app = require('express').createServer(), express = require('express'), - couchdb = require('couchdb'), + couchdb = require('node-couchdb/lib/couchdb'), // CouchDB Connection client = couchdb.createClient(5984, 'vegasjs.couchone.com'), @@ -72,4 +72,4 @@ app.get('/catalog', function(req, res) { }); // end app.get // Listen on port 80 -app.listen(80); +app.listen(3000); diff --git a/views/index.ejs b/views/index.ejs index 5e45596..c88366e 100644 --- a/views/index.ejs +++ b/views/index.ejs @@ -62,8 +62,6 @@
    - + Loading Catalog...