fix quotations

This commit is contained in:
Silver Kuusik 2018-06-30 19:20:20 +02:00 committed by GitHub
parent 596ccb40e0
commit 6adc835900
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -64,7 +64,7 @@ Sumorobot.prototype.connect = function() {
self.watchdogTimer = setInterval(function() { self.watchdogTimer = setInterval(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("{'to': 'sumo-" + robotId + "@00000514', 'cmd': 'ping'}"); self.send('{"to": "sumo-' + robotId + '@00000514", "cmd": "ping"}');
}, 500); }, 500);
}; };
/* when the WebSocket closes */ /* when the WebSocket closes */
@ -518,18 +518,18 @@ window.onload = function() {
/* if we are in coding mode */ /* if we are in coding mode */
if (codingEnabled) { if (codingEnabled) {
/* send the code from the textarea to the SumoRobot */ /* send the code from the textarea to the SumoRobot */
sumorobot.send("{'to':'sumo-" + robotId + "@00000514','cmd': 'code', 'val': '" + codingEditor.getValue() + "'}"); sumorobot.send('{"to": "sumo-' + robotId + '@00000514", "cmd": "code", "val": "' + codingEditor.getValue() + '"}');
/* otherwise when we are in Blockly mode */ /* otherwise when we are in Blockly mode */
} else { } else {
/* send the code from the blocks to the SumoRobot */ /* send the code from the blocks to the SumoRobot */
sumorobot.send("{'to':'sumo-" + robotId + "@00000514','cmd': 'code', 'val': '" + sumocode + "'}"); sumorobot.send('{"to": "sumo-' + robotId + '@00000514", "cmd": "code", "val": "' + sumocode + '"}');
} }
}); });
/* stop button listener */ /* stop button listener */
$(".btn-stop").click(function() { $(".btn-stop").click(function() {
sumostart = false; sumostart = false;
sumorobot.send("{'to':'sumo-" + robotId + "@00000514','cmd': 'stop'}"); sumorobot.send('{"to": "sumo-' + robotId + '@00000514", "cmd': 'stop'}");
workspace.highlightBlock(lastHighlighted, false); workspace.highlightBlock(lastHighlighted, false);
}); });
@ -561,7 +561,7 @@ window.onload = function() {
} }
/* connect to the selected robots WebSocket */ /* connect to the selected robots WebSocket */
sumorobot = new Sumorobot("ws://" + robotServer); sumorobot = new Sumorobot("ws://" + robotServer);
sumorobot.send("{'setID': 'browser-" + robotId + "@00000514', 'passwd': 'salakala'}"); sumorobot.send('{"setID": "browser-' + robotId + '@00000514", "passwd": "salakala"}');
/* connect to the other block highlight WebSocket */ /* connect to the other block highlight WebSocket */
/*blockHighlight = new WebSocket("ws://" + robotServer + ":80/p2p/browser/" + robotId + "-highlight/"); /*blockHighlight = new WebSocket("ws://" + robotServer + ":80/p2p/browser/" + robotId + "-highlight/");
// when there is a message from the WebSocket // when there is a message from the WebSocket