Skip to content
Open
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
1973c7e
i may have made a terrible mistake
CST1229 May 1, 2025
319e4ee
small refactoring: separate out args list insertion
CST1229 May 2, 2025
91606c5
add basic field and separator support (no saving, no inputs)
CST1229 May 3, 2025
114a706
Merge branch 'develop' of https://github.com/Nitro-Bolt/scratch-block…
CST1229 May 3, 2025
88d4d8c
as a test, add an input_value to the extendable test
CST1229 May 3, 2025
070a225
do initSvg after extending a block
CST1229 May 3, 2025
88da146
nested extendables don't really work yet
CST1229 May 3, 2025
4d48ddb
stabler extendables
CST1229 May 4, 2025
0448fc5
CHANGE EXTENDABLE SEPARATOR + recursive extendable?! + serialize exte…
CST1229 May 4, 2025
615e33a
render extendable inputs when they are created
CST1229 May 4, 2025
e01a771
fix default inputs not appearing
jwklong May 4, 2025
157df79
better c block support for extendables + rtl
CST1229 May 4, 2025
7250489
Merge branch 'directors-cut' into directors-cut
CST1229 May 4, 2025
24252da
Merge pull request #5 from jwklong/directors-cut
CST1229 May 4, 2025
f14763a
ASFDG.ÁÉSDAKYFPÉLSDK[äđĐ]JKMOŐP HTRKMHSTROPTKPIK 6HZTJRDROPIFHNGJK SD…
CST1229 May 4, 2025
e696965
always disable extendables in the block palette
CST1229 May 4, 2025
c98eb0b
input_value: add shadowOpcode, shadowFieldName and shadowFieldValue
CST1229 May 5, 2025
9197cb4
fix weird extendable reporter in input rendering
jwklong May 5, 2025
7fe52ff
Merge pull request #6 from jwklong/directors-cut
CST1229 May 5, 2025
24398a0
Simple reporter test (hot dog :D)
CubesterYT May 6, 2025
6472128
Merge branch 'develop' of https://github.com/Nitro-Bolt/scratch-block…
CST1229 Nov 14, 2025
b5c0f46
more extendable stuff (including a broken switch case)
CST1229 Nov 14, 2025
a22ae7d
Merge branch 'develop' of https://github.com/Nitro-Bolt/scratch-block…
CST1229 Nov 14, 2025
5bc8533
add extendable join block
CST1229 Nov 14, 2025
89330d9
fix clicking on extendables also clicking on the block below
CST1229 Nov 14, 2025
b50fe4f
copy fields to the insertion marker to fix extendable block insertion…
CST1229 Nov 14, 2025
582885d
extendable math operators
CST1229 Nov 14, 2025
eed4acb
extendable and/or blocks
CST1229 Nov 14, 2025
3432203
extendable if
CST1229 Nov 16, 2025
1b9ac4c
Merge branch 'develop' of https://github.com/Nitro-Bolt/scratch-block…
CST1229 Nov 16, 2025
a4b0dc9
fix extendable if-else
CST1229 Nov 16, 2025
a5f95c7
i may have made a terrible mistake
CST1229 May 1, 2025
0a87235
small refactoring: separate out args list insertion
CST1229 May 2, 2025
c5014e1
add basic field and separator support (no saving, no inputs)
CST1229 May 3, 2025
e205c73
as a test, add an input_value to the extendable test
CST1229 May 3, 2025
fea9303
do initSvg after extending a block
CST1229 May 3, 2025
a9089c5
nested extendables don't really work yet
CST1229 May 3, 2025
cef8e86
stabler extendables
CST1229 May 4, 2025
df3735a
CHANGE EXTENDABLE SEPARATOR + recursive extendable?! + serialize exte…
CST1229 May 4, 2025
bc88289
render extendable inputs when they are created
CST1229 May 4, 2025
8547327
fix default inputs not appearing
jwklong May 4, 2025
0be8819
better c block support for extendables + rtl
CST1229 May 4, 2025
be6e5bb
ASFDG.ÁÉSDAKYFPÉLSDK[äđĐ]JKMOŐP HTRKMHSTROPTKPIK 6HZTJRDROPIFHNGJK SD…
CST1229 May 4, 2025
acb10de
always disable extendables in the block palette
CST1229 May 4, 2025
0142f8b
input_value: add shadowOpcode, shadowFieldName and shadowFieldValue
CST1229 May 5, 2025
e56f158
fix weird extendable reporter in input rendering
jwklong May 5, 2025
e7efcfa
Simple reporter test (hot dog :D)
CubesterYT May 6, 2025
07e94b3
more extendable stuff (including a broken switch case)
CST1229 Nov 14, 2025
5d04084
add extendable join block
CST1229 Nov 14, 2025
6ffb48f
fix clicking on extendables also clicking on the block below
CST1229 Nov 14, 2025
2b8130c
copy fields to the insertion marker to fix extendable block insertion…
CST1229 Nov 14, 2025
b3cbf2c
extendable math operators
CST1229 Nov 14, 2025
3027004
extendable and/or blocks
CST1229 Nov 14, 2025
4ec492d
extendable if
CST1229 Nov 16, 2025
485ba0c
fix extendable if-else
CST1229 Nov 16, 2025
d375876
scary rebase
ddededodediamante May 31, 2026
b99cc6d
fix fix fix
ddededodediamante May 31, 2026
bf1f296
extendable power
ddededodediamante May 31, 2026
046803f
switches for "or" and "and" blocks
ddededodediamante May 31, 2026
1dbaf17
extendable objects & arrays
ddededodediamante May 31, 2026
2269ffc
make block.toString a little bit nicer
ddededodediamante Jun 2, 2026
d8ae6d4
update google-closure-compiler
ddededodediamante Jun 2, 2026
cc46ea8
switch case & extend merge obj/arr
ddededodediamante Jun 3, 2026
b68148b
newlines
CST1229 Jun 4, 2026
760fab5
control if else expandable
ddededodediamante Jun 4, 2026
b75a20f
Merge remote-tracking branch 'origin/directors-cut-nl' into directors…
ddededodediamante Jun 5, 2026
2c41227
add newline to switch
ddededodediamante Jun 5, 2026
9bc8f7f
Merge branch 'develop' into directors-cut
ddededodediamante Jun 5, 2026
98065cf
ex tan dlbe
ddededodediamante Jun 5, 2026
ba18f59
only add corner if row is wider than last one
ddededodediamante Jun 5, 2026
5568b04
Fix reporters with newlines + implement max reporter corner radius
ddededodediamante Jun 6, 2026
4f7eac0
Remove old pow & JSON blocks
ddededodediamante Jun 6, 2026
d302b9d
lobkxc
ddededodediamante Jun 16, 2026
f569ec8
lte, gte
ddededodediamante Jun 17, 2026
40126d8
fix cursorY to adapt for corner radius
ddededodediamante Jun 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
136 changes: 136 additions & 0 deletions blocks_vertical/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,3 +599,139 @@ Blockly.Blocks['control_foreach_in_range_item'] = {
});
}
};


Blockly.Blocks['control_if_extendable'] = {
/**
* Block for if-then.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": "%1",
"args0": [
{
"type": "extendable",
"name": "BRANCHES",
"args": [
Blockly.Msg.CONTROL_EXTENDABLE_IF,
{
"type": "input_value",
"name": "CONDITION",
"check": "Boolean"
},
Blockly.Msg.CONTROL_EXTENDABLE_THEN,
{
"type": "input_statement",
"name": "BRANCH",
},
],
"separator": Blockly.Msg.CONTROL_EXTENDABLE_ELSE_SEPARATOR,
"minInputs": 1,
}
],
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"],
"switches": ["control_if_else_extendable"]
});
}
};

Blockly.Blocks['control_if_else_extendable'] = {
/**
* Block for if-else.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"message0": "%1",
"message1": Blockly.Msg.CONTROL_ELSE,
"message2": "%1",
"args0": [
{
"type": "extendable",
"name": "BRANCHES",
"args": [
Blockly.Msg.CONTROL_EXTENDABLE_IF,
{
"type": "input_value",
"name": "CONDITION",
"check": "Boolean"
},
Blockly.Msg.CONTROL_EXTENDABLE_THEN,
{
"type": "input_statement",
"name": "BRANCH",
},
],
"separator": Blockly.Msg.CONTROL_EXTENDABLE_ELSE_SEPARATOR,
"minInputs": 1,
}
],
"args2": [
{
"type": "input_statement",
"name": "ELSE_BRANCH"
}
],
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"],
"switches": ["control_if_extendable"]
});
}
};

Blockly.Blocks['control_switch'] = {
/**
* Block for switch-case.
* @this Blockly.Block
*/
init: function() {
this.jsonInit({
"id": "control_switch",
"message0": Blockly.Msg.CONTROL_SWITCH,
"message1": "\n%1",
"message2": Blockly.Msg.CONTROL_SWITCH_DEFAULT,
"message3": "%1",
"args0": [
{
"type": "input_value",
"name": "SWITCH",
"shadowOpcode": "text",
"shadowFieldName": "TEXT",
"shadowFieldValue": Blockly.Msg.OPERATORS_JOIN_APPLE
}
],
"args1": [
{
"type": "extendable",
"name": "CASES",
"defaultInputs": 1,
"minInputs": 1,
"args": [
Blockly.Msg.CONTROL_SWITCH_CASE,
{
"type": "input_value",
"name": "CASE",
"shadowOpcode": "text",
"shadowFieldName": "TEXT",
"shadowFieldValue": ""
},
{
"type": "input_statement",
"name": "BRANCH"
}
]
}
],
"args3": [
{
"type": "input_statement",
"name": "DEFAULT_BRANCH"
}
],
"category": Blockly.Categories.control,
"extensions": ["colours_control", "shape_statement"]
});
}
};
123 changes: 19 additions & 104 deletions blocks_vertical/default_toolbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,12 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</value>' +
'</block>' +
'<block type="control_forever" id="control_forever"></block>' +
'<block type="control_if" id="control_if"></block>' +
'<block type="control_if_else" id="control_if_else"></block>' +
'<block type="control_if_extendable" id="control_if_extendable"></block>' +
'<block type="control_if_else_extendable" id="control_if_else_extendable"></block>' +
'<block type="control_switch" id="control_switch"></block>' +
'<block type="control_wait_until" id="control_wait_until"></block>' +
'<block type="control_repeat_until" id="control_repeat_until"></block>' +
'<block type="control_while" id="control_while"></block>' +
'<block type="control_stop" id="control_stop"></block>' +
'<block type="control_start_as_clone" id="control_start_as_clone"></block>' +
'<block type="control_create_clone_of" id="control_create_clone_of">' +
Expand Down Expand Up @@ -404,65 +406,15 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'<block type="sensing_username" id="sensing_username"></block>' +
'</category>' +
'<category name="%{BKY_CATEGORY_OPERATORS}" id="operators" colour="#40BF4A" secondaryColour="#389438">' +
'<block type="operator_add" id="operator_add">' +
'<value name="NUM1">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<value name="NUM2">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<block type="operator_add_extendable" id="operator_add_extendable">' +
'</block>' +
'<block type="operator_subtract" id="operator_subtract">' +
'<value name="NUM1">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<value name="NUM2">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<block type="operator_subtract_extendable" id="operator_subtract_extendable">' +
'</block>' +
'<block type="operator_multiply" id="operator_multiply">' +
'<value name="NUM1">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<value name="NUM2">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<block type="operator_multiply_extendable" id="operator_multiply_extendable">' +
'</block>' +
'<block type="operator_divide" id="operator_divide">' +
'<value name="NUM1">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<value name="NUM2">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<block type="operator_divide_extendable" id="operator_divide_extendable">' +
'</block>' +
'<block type="operator_power" id="operator_power">' +
'<value name="NUM1">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'<value name="NUM2">' +
'<shadow type="math_number">' +
'<field name="NUM"></field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="operator_random" id="operator_random">' +
'<value name="FROM">' +
Expand Down Expand Up @@ -512,20 +464,10 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</shadow>' +
'</value>' +
'</block>' +
'<block type="operator_and" id="operator_and"></block>' +
'<block type="operator_or" id="operator_or"></block>' +
'<block type="operator_and_extendable" id="operator_and_extendable"></block>' +
'<block type="operator_or_extendable" id="operator_or_extendable"></block>' +
'<block type="operator_not" id="operator_not"></block>' +
'<block type="operator_join" id="operator_join">' +
'<value name="STRING1">' +
'<shadow type="text">' +
'<field name="TEXT">hello</field>' +
'</shadow>' +
'</value>' +
'<value name="STRING2">' +
'<shadow type="text">' +
'<field name="TEXT">world</field>' +
'</shadow>' +
'</value>' +
'<block type="operator_join_extendable" id="operator_join_extendable">' +
'</block>' +
'<block type="operator_letter_of" id="operator_letter_of">' +
'<value name="LETTER">' +
Expand Down Expand Up @@ -597,7 +539,7 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'<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 type="json_object" id="json_object">' +
'</block>' +
'<block type="json_get_properties" id="json_get_properties">' +
'</block>' +
Expand Down Expand Up @@ -636,7 +578,7 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</shadow>' +
'</value>' +
'</block>' +
'<block type="json_new_array" id="json_new_array">' +
'<block type="json_array" id="json_array">' +
'</block>' +
'<block type="json_value_of_index" id="json_value_of_index">' +
'<value name="INDEX">' +
Expand All @@ -655,11 +597,6 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'<block type="json_array_length" id="json_array_length">' +
'</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">' +
Expand Down Expand Up @@ -725,34 +662,12 @@ Blockly.Blocks.defaultToolbox = '<xml id="toolbox-categories" style="display: no
'</category>' +
'<category name="Extensions" id="extensions" colour="#FF6680" secondaryColour="#FF4D6A" ' +
'iconURI="../media/extensions/wedo2-block-icon.svg" showStatusButton="true">' +
/* checkbox testing */
'<block type="extension_checkbox_test">' + // enabled
'<value name="CHECKBOX">' +
'<shadow type="checkbox"></shadow>' +
'</value>' +
'</block>' +
'<block type="extension_checkbox_test">' + // disabled
'</block>' +
'<block type="extension_checkbox_test_legacy">' + // enabled legacy
'<value name="CHECKBOX">' +
'<shadow type="checkbox">' +
'<field name="CHECKBOX">TRUE</field>' +
'</shadow>' +
'</value>' +
'</block>' +
'<block type="extension_checkbox_test_legacy">' + // disabled legacy
'<value name="CHECKBOX">' +
'<shadow type="checkbox">' +
'<field name="CHECKBOX">FALSE</field>' + // this should instantly turn off
'</shadow>' +
'</value>' +
'</block>' +
'<block type="extension_input">' +
' <value name="VALUE">' +
' <shadow type="extension_blockduplicateondrag">' +
' </shadow>' +
' </value>' +
'</block>' +
'<block type="extension_extendable_test" id="extension_extendable_test"></block>' +
'<block type="extension_nested_extendable_test" id="extension_nested_extendable_test"></block>' +
'<block type="extension_nested_extendable_inputs_test" id="extension_nested_extendable_inputs_test"></block>' +
'<block type="extension_recursive_extendable_test" id="extension_recursive_extendable_test"></block>' +
'<block type="extension_extendable_if_test" id="extension_extendable_if_test"></block>' +
'<block type="extension_extendable_reporter_test" id="extension_extendable_reporter_test"></block>' +
'<sep gap="36"></sep>' +
'<block type="extension_pen_down" id="extension_pen_down"></block>' +
'<block type="extension_music_drum" id="extension_music_drum">' +
Expand Down
Loading