timer/public/js/main.js
Rob Dodson 4b5b869c14 Finalize functionality.
Add start/stop/reset buttons.

Tidy up the interactions between the view and the stopwatch model.

Add CSS styles.
2012-06-08 07:06:54 -07:00

17 lines
330 B
JavaScript

var socket = io.connect(window.location.hostname);
socket.on('time', function (data) {
$('#countdown').html(data.time);
});
$('#start').click(function() {
socket.emit('click:start');
});
$('#stop').click(function() {
socket.emit('click:stop');
});
$('#reset').click(function() {
socket.emit('click:reset');
});