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
1 changed files with 5 additions and 5 deletions

View File

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