Browse files

Update socket.io use

  • Loading branch information...
1 parent 5a4febe commit 2fe7b240eb08186c99bfa1322c31d5ab475459be @agnoster committed Oct 3, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 app.js
  2. +4 −4 public/javascripts/client.js
View
2 app.js
@@ -47,7 +47,7 @@ function send_project(client, project) {
delete(p.child)
delete(p.timer)
- client.send(p)
+ client.emit('project', p)
}
socket.on('connection', function(client) {
View
8 public/javascripts/client.js
@@ -1,12 +1,12 @@
-var socket = new io.Socket()
+var socket = io.connect('http://localhost:4343/')
var projects = {}
var active = null
-socket.connect()
-socket.on('message', function(project) {
+socket.on('project', function(project) {
+ console.log('receive', project)
var el = document.getElementById(project.name)
if (project.status == 'DELETED') {
- console.log(project.name)
+ console.log('delete', project.name)
if (active && active.id == project.name) {
active = null
$('#project-info').addClass('empty')

0 comments on commit 2fe7b24

Please sign in to comment.