Skip to content

Commit deb7b39

Browse files
author
Ke, Mingze
committed
Bumped blockly version
ffe49a70205efb2098384b3a82a868cdb194916c
1 parent a89c78a commit deb7b39

18 files changed

Lines changed: 172 additions & 146 deletions

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "webduino-blockly",
33
"dependencies": {
4-
"blockly": "google/blockly#53f54248018db2a5bb6f5133ee08ad20f78dbbc6"
4+
"blockly": "google/blockly#ffe49a70205efb2098384b3a82a868cdb194916c"
55
}
66
}

components/blockly/.bower.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "blockly",
33
"homepage": "https://github.com/google/blockly",
4-
"_release": "53f5424801",
4+
"_release": "ffe49a7020",
55
"_resolution": {
66
"type": "commit",
7-
"commit": "53f54248018db2a5bb6f5133ee08ad20f78dbbc6"
7+
"commit": "ffe49a70205efb2098384b3a82a868cdb194916c"
88
},
99
"_source": "git://github.com/google/blockly.git",
10-
"_target": "53f54248018db2a5bb6f5133ee08ad20f78dbbc6",
10+
"_target": "ffe49a70205efb2098384b3a82a868cdb194916c",
1111
"_originalSource": "google/blockly"
1212
}

components/blockly/blockly_compressed.js

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/blockly/blocks/colour.js

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,20 @@ Blockly.Blocks['colour_picker'] = {
4040
* @this Blockly.Block
4141
*/
4242
init: function() {
43-
this.setHelpUrl(Blockly.Msg.COLOUR_PICKER_HELPURL);
44-
this.setColour(Blockly.Blocks.colour.HUE);
45-
this.appendDummyInput()
46-
.appendField(new Blockly.FieldColour('#ff0000'), 'COLOUR');
47-
this.setOutput(true, 'Colour');
48-
this.setTooltip(Blockly.Msg.COLOUR_PICKER_TOOLTIP);
43+
this.jsonInit({
44+
"message0": "%1",
45+
"args0": [
46+
{
47+
"type": "field_colour",
48+
"name": "COLOUR",
49+
"colour": "#ff0000"
50+
}
51+
],
52+
"output": "Colour",
53+
"colour": Blockly.Blocks.colour.HUE,
54+
"tooltip": Blockly.Msg.COLOUR_PICKER_TOOLTIP,
55+
"helpUrl": Blockly.Msg.COLOUR_PICKER_HELPURL
56+
});
4957
}
5058
};
5159

@@ -55,12 +63,13 @@ Blockly.Blocks['colour_random'] = {
5563
* @this Blockly.Block
5664
*/
5765
init: function() {
58-
this.setHelpUrl(Blockly.Msg.COLOUR_RANDOM_HELPURL);
59-
this.setColour(Blockly.Blocks.colour.HUE);
60-
this.appendDummyInput()
61-
.appendField(Blockly.Msg.COLOUR_RANDOM_TITLE);
62-
this.setOutput(true, 'Colour');
63-
this.setTooltip(Blockly.Msg.COLOUR_RANDOM_TOOLTIP);
66+
this.jsonInit({
67+
"message0": Blockly.Msg.COLOUR_RANDOM_TITLE,
68+
"output": "Colour",
69+
"colour": Blockly.Blocks.colour.HUE,
70+
"tooltip": Blockly.Msg.COLOUR_RANDOM_TOOLTIP,
71+
"helpUrl": Blockly.Msg.COLOUR_RANDOM_HELPURL
72+
});
6473
}
6574
};
6675

components/blockly/blocks/lists.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ Blockly.Blocks['lists_create_empty'] = {
4040
* @this Blockly.Block
4141
*/
4242
init: function() {
43-
this.setHelpUrl(Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL);
44-
this.setColour(Blockly.Blocks.lists.HUE);
45-
this.setOutput(true, 'Array');
46-
this.appendDummyInput()
47-
.appendField(Blockly.Msg.LISTS_CREATE_EMPTY_TITLE);
48-
this.setTooltip(Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP);
43+
this.jsonInit({
44+
"message0": Blockly.Msg.LISTS_CREATE_EMPTY_TITLE,
45+
"output": "Array",
46+
"colour": Blockly.Blocks.lists.HUE,
47+
"tooltip": Blockly.Msg.LISTS_CREATE_EMPTY_TOOLTIP,
48+
"helpUrl": Blockly.Msg.LISTS_CREATE_EMPTY_HELPURL
49+
});
4950
}
5051
};
5152

components/blockly/blocks/logic.js

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,23 @@ Blockly.Blocks['logic_boolean'] = {
389389
* @this Blockly.Block
390390
*/
391391
init: function() {
392-
var BOOLEANS =
393-
[[Blockly.Msg.LOGIC_BOOLEAN_TRUE, 'TRUE'],
394-
[Blockly.Msg.LOGIC_BOOLEAN_FALSE, 'FALSE']];
395-
this.setHelpUrl(Blockly.Msg.LOGIC_BOOLEAN_HELPURL);
396-
this.setColour(Blockly.Blocks.logic.HUE);
397-
this.setOutput(true, 'Boolean');
398-
this.appendDummyInput()
399-
.appendField(new Blockly.FieldDropdown(BOOLEANS), 'BOOL');
400-
this.setTooltip(Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP);
392+
this.jsonInit({
393+
"message0": "%1",
394+
"args0": [
395+
{
396+
"type": "field_dropdown",
397+
"name": "BOOL",
398+
"options": [
399+
[Blockly.Msg.LOGIC_BOOLEAN_TRUE, "TRUE"],
400+
[Blockly.Msg.LOGIC_BOOLEAN_FALSE, "FALSE"]
401+
]
402+
}
403+
],
404+
"output": "Boolean",
405+
"colour": Blockly.Blocks.logic.HUE,
406+
"tooltip": Blockly.Msg.LOGIC_BOOLEAN_TOOLTIP,
407+
"helpUrl": Blockly.Msg.LOGIC_BOOLEAN_HELPURL
408+
});
401409
}
402410
};
403411

@@ -407,12 +415,13 @@ Blockly.Blocks['logic_null'] = {
407415
* @this Blockly.Block
408416
*/
409417
init: function() {
410-
this.setHelpUrl(Blockly.Msg.LOGIC_NULL_HELPURL);
411-
this.setColour(Blockly.Blocks.logic.HUE);
412-
this.setOutput(true);
413-
this.appendDummyInput()
414-
.appendField(Blockly.Msg.LOGIC_NULL);
415-
this.setTooltip(Blockly.Msg.LOGIC_NULL_TOOLTIP);
418+
this.jsonInit({
419+
"message0": Blockly.Msg.LOGIC_NULL,
420+
"output": null,
421+
"colour": Blockly.Blocks.logic.HUE,
422+
"tooltip": Blockly.Msg.LOGIC_NULL_TOOLTIP,
423+
"helpUrl": Blockly.Msg.LOGIC_NULL_HELPURL
424+
});
416425
}
417426
};
418427

components/blockly/blocks/procedures.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ Blockly.Blocks['procedures_defnoreturn'] = {
4242
init: function() {
4343
this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFNORETURN_HELPURL);
4444
this.setColour(Blockly.Blocks.procedures.HUE);
45-
var name = Blockly.Procedures.findLegalName(
46-
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE, this);
47-
var nameField = new Blockly.FieldTextInput(name,
45+
var nameField = new Blockly.FieldTextInput(
46+
Blockly.Msg.PROCEDURES_DEFNORETURN_PROCEDURE,
4847
Blockly.Procedures.rename);
4948
nameField.setSpellcheck(false);
5049
this.appendDummyInput()
@@ -57,6 +56,16 @@ Blockly.Blocks['procedures_defnoreturn'] = {
5756
this.setStatements_(true);
5857
this.statementConnection_ = null;
5958
},
59+
/**
60+
* Initialization of the block has completed, clean up anything that may be
61+
* inconsistent as a result of the XML loading.
62+
* @this Blockly.Block
63+
*/
64+
validate: function () {
65+
var name = Blockly.Procedures.findLegalName(
66+
this.getFieldValue('NAME'), this);
67+
this.setFieldValue(name, 'NAME');
68+
},
6069
/**
6170
* Add or remove the statement block from this function definition.
6271
* @param {boolean} hasStatements True if a statement block is needed.
@@ -337,9 +346,8 @@ Blockly.Blocks['procedures_defreturn'] = {
337346
init: function() {
338347
this.setHelpUrl(Blockly.Msg.PROCEDURES_DEFRETURN_HELPURL);
339348
this.setColour(Blockly.Blocks.procedures.HUE);
340-
var name = Blockly.Procedures.findLegalName(
341-
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE, this);
342-
var nameField = new Blockly.FieldTextInput(name,
349+
var nameField = new Blockly.FieldTextInput(
350+
Blockly.Msg.PROCEDURES_DEFRETURN_PROCEDURE,
343351
Blockly.Procedures.rename);
344352
nameField.setSpellcheck(false);
345353
this.appendDummyInput()
@@ -356,6 +364,7 @@ Blockly.Blocks['procedures_defreturn'] = {
356364
this.statementConnection_ = null;
357365
},
358366
setStatements_: Blockly.Blocks['procedures_defnoreturn'].setStatements_,
367+
validate: Blockly.Blocks['procedures_defnoreturn'].validate,
359368
updateParams_: Blockly.Blocks['procedures_defnoreturn'].updateParams_,
360369
mutationToDom: Blockly.Blocks['procedures_defnoreturn'].mutationToDom,
361370
domToMutation: Blockly.Blocks['procedures_defnoreturn'].domToMutation,

0 commit comments

Comments
 (0)