Skip to content

Commit

Permalink
Merge branch 'master' of github.com:nko/vegasjs
Browse files Browse the repository at this point in the history
  • Loading branch information
brianegan committed Aug 29, 2010
2 parents c3b5888 + 2a2d8be commit bfe251f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 14 deletions.
10 changes: 3 additions & 7 deletions public/css/ntunes.less
Expand Up @@ -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 {
Expand All @@ -378,7 +374,7 @@ body {
}
}
.focus {
background:#3691E8;
background:#3691E8 !important;
color:#fff;
}
}
Expand Down
18 changes: 16 additions & 2 deletions public/js/ntunes.js
Expand Up @@ -14,10 +14,10 @@ ntunes = {
var html = '';

for (var i=0; i < this.songs.length; i++) {
html += '<li><a href="' + this.songs[i].path + '">' + this.songs[i].title + '</a></li>'
html += '<a href="' + this.songs[i].path + '" title="' + this.songs[i].artist + '">' + this.songs[i].title + '</a>'
};

$('#songCanvas ul').html(html);
$('#songCanvas').html(html);

songClickandPlay();

Expand Down Expand Up @@ -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');
Expand All @@ -158,6 +159,9 @@ function songClickandPlay() {
song +
'.mp3" /></audio>');
}
document.getElementById('playa').addEventListener('onended', function(){
$('#playing').next('A').dblclick().end().attr('id', '');
}, false);
});

$('#playPause').click(function(){
Expand All @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions server.js
Expand Up @@ -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'),
Expand Down Expand Up @@ -72,4 +72,4 @@ app.get('/catalog', function(req, res) {
}); // end app.get

// Listen on port 80
app.listen(80);
app.listen(3000);
4 changes: 1 addition & 3 deletions views/index.ejs
Expand Up @@ -62,8 +62,6 @@
</div> <!-- /browser -->

<div id="songCanvas">
<ul>
<li><a href="#" title="Loading...">Loading Catalog...</a></li>
</ul>
<a href="#" title="Loading...">Loading Catalog...</a>
</div>
</div>

0 comments on commit bfe251f

Please sign in to comment.