web/src/project.js
//called when the socket is authenticated

called when the socket is authenticated
called when the socket is authenticated
function validSocket(socket) {
  uploader = new SocketIOFileUpload(socket);
  socket.on('config',function(c){
      viewProject(c.config,socket);
  });
  socket.on('osrmList',function(data){
      createOsrmList(data,socket);
  })
  socket.on('resultJson',function(data){
    if(data.constructor === Array){            
      addResult(data);
    }
  })
  socket.on('newOsrm',function (data) {
    PROJECT.activeOSRM = data.newOsrm;
    createActiveOsrm();
  })
  socket.on('removedOsrm',function(data){
    socket.emit('retrieveOSRM',{project:PROJECT.uid});
  })
  socket.on('uploadComplete',function(data){
    socket.emit('unzip',{project:PROJECT.uid,file:data.file,osrm:PROJECT.activeOSRM})
  })
  socket.on('csvMetaFinished',function(data){
    socket.emit('retrieveResults',{project:PROJECT.uid});
  })
  socket.on('csvFinished',function(data){
  })
  d3.select('#addnetwork')
    .on('click',function(){createNewOsrm(socket)})  
}
function validSocket ( socket ) { uploader = new SocketIOFileUpload ( socket ) ; socket . on ( 'config' , function ( c ) { viewProject ( c . config , socket ) ; } ) ; socket . on ( 'osrmList' , function ( data ) { createOsrmList ( data , socket ) ; } ) socket . on ( 'resultJson' , function ( data ) { if ( data . constructor === Array ) { addResult ( data ) ; } } ) socket . on ( 'newOsrm' , function ( data ) { PROJECT . activeOSRM = data . newOsrm ; createActiveOsrm ( ) ; } ) socket . on ( 'removedOsrm' , function ( data ) { socket . emit ( 'retrieveOSRM' , { project : PROJECT . uid } ) ; } ) socket . on ( 'uploadComplete' , function ( data ) { socket . emit ( 'unzip' , { project : PROJECT . uid , file : data . file , osrm : PROJECT . activeOSRM } ) } ) socket . on ( 'csvMetaFinished' , function ( data ) { socket . emit ( 'retrieveResults' , { project : PROJECT . uid } ) ; } ) socket . on ( 'csvFinished' , function ( data ) { } ) d3 . select ( '#addnetwork' ) . on ( 'click' , function ( ) { createNewOsrm ( socket ) } ) }
called when the socket is authenticated
called when the socket is authenticated