4b5b869c14
Add start/stop/reset buttons. Tidy up the interactions between the view and the stopwatch model. Add CSS styles.
17 lines
330 B
JavaScript
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');
|
|
}); |