You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
928 B

  1. var socket=io.connect();
  2. function NewConnection(){
  3. socket.emit('newconnection',"newcon",function(data){
  4. //
  5. });
  6. }
  7. function pinON(){
  8. var pin=document.getElementById("pinselected").value;
  9. //toastr.info("pin: " + pin);
  10. socket.emit('pinON',pin,function(data){
  11. //
  12. });
  13. }
  14. function pinOFF(){
  15. var pin=document.getElementById("pinselected").value;
  16. //toastr.info("pin: " + pin);
  17. socket.emit('pinOFF',pin,function(data){
  18. //
  19. });
  20. }
  21. socket.on('numconnections',function(data){
  22. document.getElementById("idNumConnections").innerHTML=data.numconnections;
  23. });
  24. socket.on('listPinsON',function(data){
  25. //mRotationR(window[data.data]);
  26. toastr.info("listPinsOn: " + data);
  27. document.getElementById("divlistPinsON").innerHTML=data;
  28. });
  29. socket.on('alreadyON',function(data){
  30. //mRotationR(window[data.data]);
  31. toastr.warning("pin " + data + " ja estava encès");
  32. });