Skip to content

Commit

Permalink
Added count and reverse blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Dec 4, 2023
1 parent 30df57d commit 130131d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 20 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ NodeJS 16.x is required
* (klein0r) messageToAsync was not working without options
* (klein0r) Added timeout and custom options for sendToAsync
* (klein0r) Fixed valid switch statement expressions
* (klein0r) Added text replacement block
* (klein0r) Added text replacement, cound and reverse blocks

### 7.1.6 (2023-10-24)
* (bluefox) Fixed pushover rules block
Expand Down
4 changes: 2 additions & 2 deletions src/public/google-blockly/own/blocks_text.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ Blockly.Blocks['text_newline'] = {
};

Blockly.JavaScript['text_newline'] = function(block) {
const dropdown_type = block.getFieldValue('Type');
return ['\'' + dropdown_type + '\'', Blockly.JavaScript.ORDER_ATOMIC];
const dropdownType = block.getFieldValue('Type');
return [`'${dropdownType}'`, Blockly.JavaScript.ORDER_ATOMIC];
};
47 changes: 30 additions & 17 deletions src/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -291,23 +291,6 @@
<category name="{catText}" colour="160">
<block type="text"></block>
<block type="text_newline"></block>
<block type="text_replace">
<value name="FROM">
<shadow type="text">
<field name="TEXT">x</field>
</shadow>
</value>
<value name="TO">
<shadow type="text">
<field name="TEXT">y</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">text</field>
</shadow>
</value>
</block>
<block type="text_multiline"></block>
<block type="text_join"></block>
<block type="text_append">
Expand Down Expand Up @@ -369,6 +352,36 @@
</shadow>
</value>
</block>
<block type="text_count">
<value name="SUB">
<shadow type="text"></shadow>
</value>
<value name="TEXT">
<shadow type="text"></shadow>
</value>
</block>
<block type="text_replace">
<value name="FROM">
<shadow type="text">
<field name="TEXT">x</field>
</shadow>
</value>
<value name="TO">
<shadow type="text">
<field name="TEXT">y</field>
</shadow>
</value>
<value name="TEXT">
<shadow type="text">
<field name="TEXT">text</field>
</shadow>
</value>
</block>
<block type="text_reverse">
<value name="TEXT">
<shadow type="text">text</shadow>
</value>
</block>
</category>
<category name="{catLists}" colour="260">
<block type="lists_create_with">
Expand Down

0 comments on commit 130131d

Please sign in to comment.