mirror of
https://github.com/google/blockly.git
synced 2026-01-11 02:47:09 +01:00
Adding controls_ifelse block (#722)
Adding controls_ifelse, an if/else block that is loaded from JSON and does not use mutators. This gives "else" capability to Android & iOS implementations, which don't support JavaScript mutators. Added this block to the playground simple toolbox and all generators.
This commit is contained in:
committed by
GitHub
parent
0156f2e103
commit
72ff6d9ead
@@ -265,6 +265,42 @@ Blockly.Blocks['controls_if_else'] = {
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['controls_ifelse'] = {
|
||||
/**
|
||||
* If/else block that does not use a mutator.
|
||||
*/
|
||||
init: function() {
|
||||
this.jsonInit({
|
||||
"message0": Blockly.Msg.CONTROLS_IFELSE_TITLE,
|
||||
"args0": [
|
||||
{
|
||||
"type": "input_value",
|
||||
"name": "IF0",
|
||||
"check": "Boolean",
|
||||
"align": "RIGHT"
|
||||
},
|
||||
{
|
||||
"type": "input_statement",
|
||||
"name": "DO0",
|
||||
"check": "Boolean",
|
||||
"align": "RIGHT"
|
||||
},
|
||||
{
|
||||
"type": "input_statement",
|
||||
"name": "ELSE",
|
||||
"check": "Boolean",
|
||||
"align": "RIGHT"
|
||||
}
|
||||
],
|
||||
"previousStatement": null,
|
||||
"nextStatement": null,
|
||||
"colour": Blockly.Blocks.logic.HUE,
|
||||
"tooltip": Blockly.Msg.CONTROLS_IF_TOOLTIP_2,
|
||||
"helpUrl": Blockly.Msg.CONTROLS_IF_HELPURL
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Blockly.Blocks['logic_compare'] = {
|
||||
/**
|
||||
* Block for comparison operator.
|
||||
|
||||
Reference in New Issue
Block a user