-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom_blocks.js
39 lines (38 loc) · 1.2 KB
/
custom_blocks.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
Blockly.Blocks['lists_insert'] = {
init: function() {
this.appendValueInput('LIST')
.setCheck('Array')
.appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST);
this.appendValueInput("options")
.setCheck(null)
.appendField(new Blockly.FieldDropdown([["Insert Before","OPTIONNAME"], ["Insert After","OPTIONNAME"]]), "insertoptions");
this.appendValueInput("value")
.setCheck(null)
.appendField("as");
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(260);
this.setTooltip('');
this.setHelpUrl('');
}
};
Blockly.Blocks['insert_before'] = {
init: function() {
this.appendValueInput('LIST')
.setCheck('Array')
.appendField(Blockly.Msg.LISTS_SET_INDEX_INPUT_IN_LIST);
this.appendValueInput("position")
.setCheck(null)
.appendField("insert before");
this.appendValueInput("value")
.setCheck(null)
.appendField("as");
this.setInputsInline(true);
this.setPreviousStatement(true, null);
this.setNextStatement(true, null);
this.setColour(260);
this.setTooltip('');
this.setHelpUrl('');
}
};