From 6adc8359005d12c332433f3051c578a8c8e3b4d5 Mon Sep 17 00:00:00 2001 From: Silver Kuusik Date: Sat, 30 Jun 2018 19:20:20 +0200 Subject: [PATCH] fix quotations --- assets/js/sumorobot.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/sumorobot.js b/assets/js/sumorobot.js index 83fe44b..cae8663 100755 --- a/assets/js/sumorobot.js +++ b/assets/js/sumorobot.js @@ -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