static/js/client.js
/**
 * Listen for websocket events and setup handlers.
 */
Listen for websocket events and setup handlers.
Listen for websocket events and setup handlers .
function onReady() {
  var socket = new ReconnectingWebSocket(EVENTS);
  socket.onmessage = function (msg) {
    if (msg.data === 'removed') {
      tagRemoved();
    } else {
      tagPresent(msg.data);
    }
  };
  socket.onerror = function (msg) {
    console.log('Event stream failed: ' + msg);
  };
  registerKeyboardEvents();
  registerSubmit();
}
function onReady ( ) { var socket = new ReconnectingWebSocket ( EVENTS ) ; socket . onmessage = function ( msg ) { if ( msg . data === 'removed' ) { tagRemoved ( ) ; } else { tagPresent ( msg . data ) ; } } ; socket . onerror = function ( msg ) { console . log ( 'Event stream failed: ' + msg ) ; } ; registerKeyboardEvents ( ) ; registerSubmit ( ) ; }
Listen for websocket events and setup handlers.
Listen for websocket events and setup handlers .
// Connect to the event stream and handle events. // Register keyboard and submission handlers.