forked from marva/sumorobot-web
		
	Update sumorobot.js
This commit is contained in:
		@@ -52,7 +52,7 @@ Sumorobot.prototype.connect = function() {
 | 
				
			|||||||
            /* send a ping to the robot */
 | 
					            /* send a ping to the robot */
 | 
				
			||||||
            //console.log("ping the robot")
 | 
					            //console.log("ping the robot")
 | 
				
			||||||
            self.send("ping");
 | 
					            self.send("ping");
 | 
				
			||||||
        }, 2000);
 | 
					        }, 500);
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
    /* when the WebSocket closes */
 | 
					    /* when the WebSocket closes */
 | 
				
			||||||
    this.websocket.onclose = function(evt) {
 | 
					    this.websocket.onclose = function(evt) {
 | 
				
			||||||
@@ -519,6 +519,16 @@ window.onload = function() {
 | 
				
			|||||||
        }
 | 
					        }
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
 | 
					    /* when robot-id input field gets focused */
 | 
				
			||||||
 | 
					    $("#robot-id").focus(function() {
 | 
				
			||||||
 | 
					        /* if there is no value in the robot-id input field */
 | 
				
			||||||
 | 
					        if (!$("#robot-id").val()) {
 | 
				
			||||||
 | 
					            /* add "sumo-" to the input field so the user */
 | 
				
			||||||
 | 
					            /* just has to add the robot ID */
 | 
				
			||||||
 | 
					            $("#robot-id").val("sumo-");
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* robot number button listener */
 | 
					    /* robot number button listener */
 | 
				
			||||||
    $(".btn-robot-go").click(function() {
 | 
					    $(".btn-robot-go").click(function() {
 | 
				
			||||||
        /* extract and validate the selected robot ID */
 | 
					        /* extract and validate the selected robot ID */
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user