forked from marva/sumorobot-web
Update sumorobot.js
This commit is contained in:
parent
fe28b73ec0
commit
7ea27bdfb4
@ -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) {
|
||||||
@ -518,6 +518,16 @@ window.onload = function() {
|
|||||||
$(".btn-robot-go").click();
|
$(".btn-robot-go").click();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* 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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user