diff --git a/assets/js/sumorobot.js b/assets/js/sumorobot.js index 19b8bad..1fd71e0 100755 --- a/assets/js/sumorobot.js +++ b/assets/js/sumorobot.js @@ -52,7 +52,7 @@ Sumorobot.prototype.connect = function() { /* send a ping to the robot */ //console.log("ping the robot") self.send("ping"); - }, 2000); + }, 500); }; /* when the WebSocket closes */ this.websocket.onclose = function(evt) { @@ -518,6 +518,16 @@ window.onload = function() { $(".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 */ $(".btn-robot-go").click(function() {