Skip to content

Commit 02e9a78

Browse files
committed
Merge branch 'develop' into develop-builds
2 parents 579bc5f + 7746da5 commit 02e9a78

File tree

12 files changed

+974
-117
lines changed

12 files changed

+974
-117
lines changed

blocks_vertical/data.js

Lines changed: 507 additions & 0 deletions
Large diffs are not rendered by default.

blocks_vertical/default_toolbox.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -539,12 +539,6 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
539539
'</block>' +
540540
'<block type="json_to_string" id="json_to_string">' +
541541
'</block>' +
542-
'<block type="json_keys" id="json_keys">' +
543-
'</block>' +
544-
'<block type="json_values" id="json_values">' +
545-
'</block>' +
546-
'<block type="json_entries" id="json_entries">' +
547-
'</block>' +
548542
'<block type="json_get_properties" id="json_get_properties">' +
549543
'</block>' +
550544
'<block type="json_value_of_key" id="json_value_of_key">' +

blocks_vertical/json.js

Lines changed: 3 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -83,69 +83,6 @@ Blockly.Blocks['json_to_string'] = {
8383
}
8484
};
8585

86-
Blockly.Blocks['json_keys'] = {
87-
/**
88-
* Fetches the keys of the object
89-
* @this Blockly.Block
90-
*/
91-
init: function() {
92-
this.jsonInit({
93-
"message0": Blockly.Msg.JSON_KEYS,
94-
"args0": [
95-
{
96-
"type": "input_value",
97-
"name": "OBJ",
98-
"check": "Object"
99-
},
100-
],
101-
"category": Blockly.Categories.json,
102-
"extensions": ["colours_json", "output_array"]
103-
});
104-
}
105-
};
106-
107-
Blockly.Blocks['json_values'] = {
108-
/**
109-
* Fetches the values of the object
110-
* @this Blockly.Block
111-
*/
112-
init: function() {
113-
this.jsonInit({
114-
"message0": Blockly.Msg.JSON_VALUES,
115-
"args0": [
116-
{
117-
"type": "input_value",
118-
"name": "OBJ",
119-
"check": "Object"
120-
},
121-
],
122-
"category": Blockly.Categories.json,
123-
"extensions": ["colours_json", "output_array"]
124-
});
125-
}
126-
};
127-
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-
14986
Blockly.Blocks['json_get_properties'] = {
15087
/**
15188
* Fetches keys, values, or entries of an object based on selection.
@@ -159,9 +96,9 @@ Blockly.Blocks['json_get_properties'] = {
15996
"type": "field_dropdown",
16097
"name": "PROPERTY",
16198
"options": [
162-
["keys", "keys"],
163-
["values", "values"],
164-
["entries", "entries"]
99+
[Blockly.Msg.JSON_GET_PROPERTIES_KEYS, "keys"],
100+
[Blockly.Msg.JSON_GET_PROPERTIES_VALUES, "values"],
101+
[Blockly.Msg.JSON_GET_PROPERTIES_ENTRIES, "entries"]
165102
]
166103
},
167104
{

blocks_vertical/vertical_extensions.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ Blockly.ScratchBlocks.VerticalExtensions.SCRATCH_EXTENSION = function() {
263263
*/
264264
Blockly.ScratchBlocks.VerticalExtensions.registerAll = function() {
265265
var categoryNames =
266-
['control', 'data', 'data_lists', 'json', 'sounds', 'motion', 'looks', 'event',
266+
['control', 'data', 'data_lists', 'data_tables', 'json', 'sounds', 'motion', 'looks', 'event',
267267
'sensing', 'pen', 'operators', 'more', 'comments'];
268268
// Register functions for all category colours.
269269
for (var i = 0; i < categoryNames.length; i++) {

core/colours.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ Blockly.Colours = {
8787
"tertiary": "#E64D00",
8888
"quaternary": "#E64D00"
8989
},
90+
// Same reasoning as data_lists, but this is to differentiate tables
91+
"data_tables": {
92+
"primary": "#66BD5C",
93+
"secondary": "#5CAA53",
94+
"tertiary": "#52974A",
95+
"quaternary": "#52974A"
96+
},
9097
"json": {
9198
"primary": "#5755D4",
9299
"secondary": "#4644AA",

core/constants.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ Blockly.Categories = {
271271
"pen": "pen",
272272
"data": "data",
273273
"dataLists": "data-lists",
274+
"dataTables": "data-tables",
274275
"json": "json",
275276
"event": "events",
276277
"control": "control",
@@ -349,6 +350,14 @@ Blockly.NEW_BROADCAST_MESSAGE_ID = 'NEW_BROADCAST_MESSAGE_ID';
349350
*/
350351
Blockly.BROADCAST_MESSAGE_VARIABLE_TYPE = 'broadcast_msg';
351352

353+
/**
354+
* String representing the variable type of table blocks.
355+
* This string, for use in differentiating between types of variables,
356+
* indicates that the current variable is a table.
357+
* @const {string}
358+
*/
359+
Blockly.TABLE_VARIABLE_TYPE = 'table';
360+
352361
/**
353362
* String representing the variable type of list blocks.
354363
* This string, for use in differentiating between types of variables,

0 commit comments

Comments
 (0)