Skip to content

Commit 3a62884

Browse files
Merge branch 'develop' into develop-builds
2 parents f5ee7b8 + d7345fb commit 3a62884

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed

blocks_vertical/default_toolbox.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,8 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
541541
'</block>' +
542542
'<block type="json_values" id="json_values">' +
543543
'</block>' +
544+
'<block type="json_entries" id="json_entries">' +
545+
'</block>' +
544546
'<block type="json_value_of_key" id="json_value_of_key">' +
545547
'<value name="KEY">' +
546548
'<shadow type="text">' +

blocks_vertical/json.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,27 @@ Blockly.Blocks['json_values'] = {
125125
}
126126
};
127127

128+
Blockly.Blocks['json_entries'] = {
129+
/**
130+
* Fetches the entries of the object
131+
* @this Blockly.Block
132+
*/
133+
init: function() {
134+
this.jsonInit({
135+
"message0": Blockly.Msg.JSON_ENTRIES,
136+
"args0": [
137+
{
138+
"type": "input_value",
139+
"name": "OBJ",
140+
"check": "Object"
141+
},
142+
],
143+
"category": Blockly.Categories.json,
144+
"extensions": ["colours_json", "output_array"]
145+
});
146+
}
147+
};
148+
128149
Blockly.Blocks['json_value_of_key'] = {
129150
/**
130151
* Fetches the value of the target key

msg/messages.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Blockly.Msg.JSON_TO_OBJECT = '%1 to object';
8282
Blockly.Msg.JSON_TO_STRING = '%1 to string';
8383
Blockly.Msg.JSON_KEYS = 'keys of %1';
8484
Blockly.Msg.JSON_VALUES = 'values of %1';
85+
Blockly.Msg.JSON_ENTRIES = 'entries of %1';
8586
Blockly.Msg.JSON_VALUE_OF_KEY = 'value of %1 in %2';
8687
Blockly.Msg.JSON_SET_KEY = 'set %1 in %2 to %3';
8788
Blockly.Msg.JSON_DELETE_KEY = 'delete %1 in %2';

0 commit comments

Comments
 (0)