Skip to content

Commit

Permalink
hotfix ebs
Browse files Browse the repository at this point in the history
  • Loading branch information
SeonMyungLim committed May 19, 2016
1 parent d0887cb commit 0ba523a
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 6 deletions.
17 changes: 17 additions & 0 deletions dist/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -12283,6 +12283,23 @@ Entry.Utils.createMouseEvent = function(b, a) {
c.initMouseEvent(b, !0, !0, window, 0, 0, 0, a.clientX, a.clientY, !1, !1, !1, !1, 0, null);
return c;
};
Entry.Utils.xmlToJsonData = function(b) {
b = $.parseXML(b);
var a = [];
b = b.childNodes[0].childNodes;
for (var c in b) {
var d = b[c];
if (d.tagName) {
var e = {category:d.getAttribute("id"), blocks:[]}, d = d.childNodes;
for (c in d) {
var f = d[c];
f.tagName && e.blocks.push(f.getAttribute("type"));
}
a.push(e);
}
}
return a;
};
Entry.Model = function(b, a) {
var c = Entry.Model;
c.generateSchema(b);
Expand Down
6 changes: 3 additions & 3 deletions dist/entry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions entry.js.map

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions src/util/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1106,3 +1106,27 @@ Entry.Utils.createMouseEvent = function(type, event) {
);
return e;
};

Entry.Utils.xmlToJsonData = function(xml) {
xml = $.parseXML(xml);
var result = [];
var categories = xml.childNodes[0].childNodes;
for (var i in categories) {
var category = categories[i];
if (!category.tagName)
continue;
var data = {
category: category.getAttribute("id"),
blocks: []
};
var blocks = category.childNodes;
for (var i in blocks) {
var block = blocks[i];
if (!block.tagName)
continue;
data.blocks.push(block.getAttribute("type"));
}
result.push(data);
}
return result;
};
30 changes: 30 additions & 0 deletions src/workspace/block_entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -17888,6 +17888,36 @@ Entry.block = {
"type": "CODEino_convert_scale"
},
"class": "arduino"
},
"ebs_if": {
"parent": "_if",
"def": {
type: "_if",
params: [
{
type: 'reach_something',
params: [
null,
"wall"
]
}
]
}
},
"ebs_if2": {
"parent": "_if",
"def": {
type: "_if",
params: [
{
type: 'reach_something',
params: [
null,
"cwz5"
]
}
]
}
}
};

Expand Down

0 comments on commit 0ba523a

Please sign in to comment.