uniScore/public/js/front_client.js

23 lines
507 B
JavaScript
Raw Normal View History

'use strict';
2017-03-14 15:02:54 +00:00
let iosocket = io.connect();
// setup all my handlers
iosocket.on('clientrefresh', () => {
location.reload();
});
iosocket.on('stateChange', (state) => {
console.log(state);
// basically the server tracks the state since it is the same for al clients
// So we know that we HAVE to update at this point
$('#team-container').bracket({init: state});
2017-03-13 12:53:22 +00:00
});
2017-03-16 09:41:51 +00:00
$( document ).ready(function() {
// get my state
let context = 'main';
iosocket.emit('loadState',context);
2017-03-16 09:41:51 +00:00
});