Skip to content

Commit e77f07f

Browse files
Merge branch 'develop' into develop-builds
2 parents 9d93383 + 8adbb3f commit e77f07f

File tree

8 files changed

+52
-14
lines changed

8 files changed

+52
-14
lines changed

blocks_vertical/control.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,4 +578,4 @@ Blockly.Blocks['control_foreach_in_range_item'] = {
578578
"extensions": ["colours_control", "output_number"]
579579
});
580580
}
581-
};
581+
};

blocks_vertical/default_toolbox.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
596596
'</block>' +
597597
'<block type="json_value_of_index" id="json_value_of_index">' +
598598
'<value name="INDEX">' +
599-
'<shadow type="math_number">' +
599+
'<shadow type="json_indexmenu">' +
600600
'<field name="NUM">0</field>' +
601601
'</shadow>' +
602602
'</value>' +
@@ -619,8 +619,8 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
619619
'</block>' +
620620
'<block type="json_replace_index" id="json_replace_index">' +
621621
'<value name="INDEX">' +
622-
'<shadow type="math_number">' +
623-
'<field name="NUM">1</field>' +
622+
'<shadow type="json_indexmenu">' +
623+
'<field name="NUM">0</field>' +
624624
'</shadow>' +
625625
'</value>' +
626626
'<value name="ITEM">' +
@@ -631,7 +631,7 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
631631
'</block>' +
632632
'<block type="json_delete_index" id="json_delete_index">' +
633633
'<value name="INDEX">' +
634-
'<shadow type="math_number">' +
634+
'<shadow type="json_indexmenu">' +
635635
'<field name="NUM">0</field>' +
636636
'</shadow>' +
637637
'</value>' +
@@ -644,6 +644,16 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
644644
'</value>' +
645645
'</block>' +
646646
'<block type="json_slice_array" id="json_slice_array">' +
647+
'<value name="START">' +
648+
'<shadow type="json_indexmenu">' +
649+
'<field name="NUM">1</field>' +
650+
'</shadow>' +
651+
'</value>' +
652+
'<value name="END">' +
653+
'<shadow type="json_indexmenu">' +
654+
'<field name="NUM">2</field>' +
655+
'</shadow>' +
656+
'</value>' +
647657
'</block>' +
648658
'<block type="json_merge_array" id="json_merge_array">' +
649659
'</block>' +

blocks_vertical/extensions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Blockly.Blocks['extension_checkbox_test_legacy_json2'] = {
110110
};
111111

112112
Blockly.Blocks['extension_input'] = {
113-
init: function () {
113+
init: function() {
114114
this.jsonInit({
115115
"message0": 'input %1',
116116
"args0": [
@@ -126,7 +126,7 @@ Blockly.Blocks['extension_input'] = {
126126
};
127127

128128
Blockly.Blocks['extension_blockduplicateondrag'] = {
129-
init: function () {
129+
init: function() {
130130
this.jsonInit({
131131
"message0": 'duplicate on drag',
132132
"duplicateOnDrag": true,

blocks_vertical/json.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,34 @@ Blockly.Blocks['json_new_array'] = {
218218
}
219219
};
220220

221+
Blockly.Blocks['json_indexmenu'] = {
222+
/**
223+
* JSON index menu
224+
* @this Blockly.Block
225+
*/
226+
init: function() {
227+
this.jsonInit({
228+
"message0": "%1",
229+
"args0": [
230+
{
231+
"type": "field_numberdropdown",
232+
"name": "INDEX",
233+
"value": "0",
234+
"min": 0,
235+
"precision": 1,
236+
"options": [
237+
["0", "0"],
238+
[Blockly.Msg.DATA_INDEX_LAST, "last"],
239+
[Blockly.Msg.DATA_INDEX_RANDOM, "random"]
240+
]
241+
}
242+
],
243+
"category": Blockly.Categories.json,
244+
"extensions": ["colours_textfield", "output_string"]
245+
});
246+
}
247+
};
248+
221249
Blockly.Blocks['json_value_of_index'] = {
222250
/**
223251
* Fetches the value of the given index
@@ -548,4 +576,4 @@ Blockly.Blocks['json_foreach_index'] = {
548576
"extensions": ["colours_json", "output_number"]
549577
});
550578
}
551-
};
579+
};

blocks_vertical/operators.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ Blockly.Blocks['operator_typeof'] = {
507507
* Get the specific type of a value.
508508
* @this Blockly.Block
509509
*/
510-
init: function () {
510+
init: function() {
511511
this.jsonInit({
512512
message0: Blockly.Msg.OPERATORS_TYPEOF,
513513
args0: [

core/block.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ Blockly.Block = function(workspace, prototypeName, opt_id) {
142142
*/
143143
this.outputShape_ = null;
144144

145-
/**
146-
* @type {boolean}
145+
/**
146+
* @type {boolean}
147147
* @private
148148
*/
149149
this.duplicateOnDrag_ = false;
@@ -1863,4 +1863,4 @@ Blockly.Block.prototype.setDuplicateOnDrag = function(value) {
18631863
*/
18641864
Blockly.Block.prototype.canDuplicateOnDrag = function() {
18651865
return this.duplicateOnDrag_ === true && this.isShadow();
1866-
};
1866+
};

core/field_textinput.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ Blockly.FieldTextInput.prototype.showEditor_ = function(
264264
var dropDownArrow =
265265
goog.dom.createDom(goog.dom.TagName.IMG, 'blocklyTextDropDownArrow');
266266
dropDownArrow.setAttribute('src',
267-
Blockly.mainWorkspace.options.pathToMedia +
267+
Blockly.mainWorkspace.options.pathToMedia +
268268
Blockly.FieldTextInput.getTextMenuArrowAsset());
269269
dropDownArrow.style.width = this.arrowSize_ + 'px';
270270
dropDownArrow.style.height = this.arrowSize_ + 'px';

core/scratch_blocks_utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Blockly.scratchBlocksUtils.isShadowArgumentReporter = function(block) {
8787
block.type == 'argument_reporter_object' ||
8888
block.type == 'argument_reporter_array' ||
8989
block.type == 'argument_reporter_string_number'
90-
));
90+
));
9191
};
9292

9393
/**

0 commit comments

Comments
 (0)