Skip to content

Commit

Permalink
Merge branch 'develop' into develop-builds
Browse files Browse the repository at this point in the history
  • Loading branch information
CubesterYT committed Jul 10, 2024
2 parents 29de013 + 59615dd commit b3fa24f
Show file tree
Hide file tree
Showing 16 changed files with 1,066 additions and 30 deletions.
50 changes: 50 additions & 0 deletions blocks_vertical/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,53 @@ Blockly.Blocks['comments_boolean'] = {
});
}
};

Blockly.Blocks['comments_object'] = {
/**
* Comment Object
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.COMMENTS_ALTERNATE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": "Object"
},
{
"type": "input_value",
"name": "COMMENT"
}
],
"category": Blockly.Categories.comments,
"extensions": ["colours_comments", "output_object"]
});
}
};

Blockly.Blocks['comments_array'] = {
/**
* Comment Array
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": Blockly.Msg.COMMENTS_ALTERNATE,
"args0": [
{
"type": "input_value",
"name": "VALUE",
"check": "Array"
},
{
"type": "input_value",
"name": "COMMENT"
}
],
"category": Blockly.Categories.comments,
"extensions": ["colours_comments", "output_array"]
});
}
};
131 changes: 131 additions & 0 deletions blocks_vertical/default_toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,123 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</category>' +
'<category name="%{BKY_CATEGORY_VARIABLES}" id="data" colour="#FF8C1A" secondaryColour="#DB6E00" custom="VARIABLE">' +
'</category>' +
'<category name="%{BKY_CATEGORY_JSON}" id="json" colour="#5755D4" secondaryColour="#4644AA">' +
'<block type="json_new_object" id="json_new_object">' +
'</block>' +
'<block type="json_to_object" id="json_to_object">' +
'<value name="STR">' +
'<shadow type="text">' +
'<field name="TEXT">{"key":"value"}</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_to_string" id="json_to_string">' +
'</block>' +
'<block type="json_keys" id="json_keys">' +
'</block>' +
'<block type="json_values" id="json_values">' +
'</block>' +
'<block type="json_value_of_key" id="json_value_of_key">' +
'<value name="KEY">' +
'<shadow type="text">' +
'<field name="TEXT">key</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_set_key" id="json_set_key">' +
'<value name="KEY">' +
'<shadow type="text">' +
'<field name="TEXT">key</field>' +
'</shadow>' +
'</value>' +
'<value name="VALUE">' +
'<shadow type="text">' +
'<field name="TEXT">bar</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_delete_key" id="json_delete_key">' +
'<value name="KEY">' +
'<shadow type="text">' +
'<field name="TEXT">key</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_join_object" id="json_join_object">' +
'</block>' +
'<block type="json_has_key" id="json_has_key">' +
'<value name="KEY">' +
'<shadow type="text">' +
'<field name="TEXT">key</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_new_array" id="json_new_array">' +
'</block>' +
'<block type="json_to_array" id="json_to_array">' +
'<value name="STR">' +
'<shadow type="text">' +
'<field name="TEXT">["foo", "bar"]</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_value_of_index" id="json_value_of_index">' +
'<value name="INDEX">' +
'<shadow type="math_number">' +
'<field name="NUM">0</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_index_of_value" id="json_index_of_value">' +
'<value name="VALUE">' +
'<shadow type="text">' +
'<field name="TEXT">bar</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_add_item" id="json_add_item">' +
'<value name="ITEM">' +
'<shadow type="text">' +
'<field name="TEXT">bar</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_replace_index" id="json_replace_index">' +
'<value name="INDEX">' +
'<shadow type="math_number">' +
'<field name="NUM">1</field>' +
'</shadow>' +
'</value>' +
'<value name="ITEM">' +
'<shadow type="text">' +
'<field name="TEXT">baz</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_delete_index" id="json_delete_index">' +
'<value name="INDEX">' +
'<shadow type="math_number">' +
'<field name="NUM">0</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_delete_all_occurrences" id="json_delete_all_occurrences">' +
'<value name="ITEM">' +
'<shadow type="text">' +
'<field name="TEXT">bar</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_join_array" id="json_join_array">' +
'</block>' +
'<block type="json_has_item" id="json_has_item">' +
'<value name="ITEM">' +
'<shadow type="text">' +
'<field name="TEXT">bar</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'</category>' +
'<category name="%{BKY_CATEGORY_MYBLOCKS}" id="more" colour="#FF6680" secondaryColour="#FF4D6A" custom="PROCEDURE">' +
'</category>' +
'<category name="%{BKY_CATEGORY_COMMENTS}" id="comments" colour="#E4DB8C" secondaryColour="#C6BE79">' +
Expand Down Expand Up @@ -568,6 +685,20 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</shadow>' +
'</value>' +
'</block>' +
'<block type="comments_object" id="comments_object">' +
'<value name="COMMENT">' +
'<shadow type="text">' +
'<field name="TEXT"></field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="comments_array" id="comments_array">' +
'<value name="COMMENT">' +
'<shadow type="text">' +
'<field name="TEXT"></field>' +
'</shadow>' +
'</value>' +
'</block>' +
'</category>' +
'<category name="Extensions" id="extensions" colour="#FF6680" secondaryColour="#FF4D6A" ' +
'iconURI="../media/extensions/wedo2-block-icon.svg" showStatusButton="true">' +
Expand Down
Loading

0 comments on commit b3fa24f

Please sign in to comment.