update block and line highlightning
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
//var ROBOT_SERVER = '192.168.2.1:80';
|
||||
var ROBOT_SERVER = 'ws.achex.ca:4010';
|
||||
|
||||
var workspace;
|
||||
// The sumorobot object
|
||||
var sumorobot;
|
||||
// Disable / enable coding mode
|
||||
@@ -119,6 +118,7 @@ window.addEventListener('load', function() {
|
||||
}
|
||||
});
|
||||
|
||||
var range_id;
|
||||
var lines = [];
|
||||
var foundTrue = false;
|
||||
// Function to process code and highlight blocks and lines
|
||||
@@ -153,6 +153,11 @@ window.addEventListener('load', function() {
|
||||
if (/\d/.test(code)) {
|
||||
timeout = parseInt(code.replace(/[a-z\.()]/g, ''));
|
||||
}
|
||||
if (range_id) {
|
||||
readOnlyCodingEditor.session.removeMarker(range_id);
|
||||
}
|
||||
var range = new Range(index, 0, index, 1);
|
||||
range_id = readOnlyCodingEditor.session.addMarker(range, "highlight", "fullLine");
|
||||
// Block ID should always be 20 symbols long
|
||||
var blockId = temp[1].substring(0, 20);
|
||||
// Highlight the block
|
||||
@@ -188,6 +193,9 @@ window.addEventListener('load', function() {
|
||||
// Stop highlighting blocks and lines
|
||||
lines = [];
|
||||
workspace.highlightBlock('');
|
||||
if (range_id) {
|
||||
readOnlyCodingEditor.session.removeMarker(range_id);
|
||||
}
|
||||
});
|
||||
|
||||
// Enter (return) keypress listener on robot ID field
|
||||
|
Reference in New Issue
Block a user