Repository navigation
Added new input fields / blocks and changed renderer - #9
Conversation
|
Cool! |
|
One thing I noticed randomly reading through this pull request: There is another big advantage to using Validators though: It can not only be used to check if an input is correct, it can also be used, to correct the user input, if it is not a valid input. This could look something like this for, e.g., point ranges: // When -5 is entered, the range is invalidated and corrected!
-[-5, 10]
+[0, 10]
// When 10 is entered, the field detects, that 20 > 10, and swaps them!
-[20, 10]
+[10, 20]when validating and correcting, or // Tooltip on hover: Range is invalid!
-[-5, 10]when just validating. Edit: You can even use validators to add warnings to a block: https://blocklycodelabs.dev/codelabs/validation-and-warnings/index.html |
| // if (index !== 0) { | ||
| // input.appendField(new Blockly.FieldLabel(' ')) // empty placeholder | ||
| // } |
There was a problem hiding this comment.
if this is no longer required, I suggest removing it
There was a problem hiding this comment.
This is still required. I just forgot to remove the // after testing.
| domToMutation, | ||
|
|
||
| updateShape: function () { | ||
| // get current status for recreation after +- |
There was a problem hiding this comment.
get current status for block recreation after clicking the +- buttons
| domToMutation, | ||
|
|
||
| updateShape: function () { | ||
| // get current status for recreation after +- |
There was a problem hiding this comment.
same as above. although I'm not sure this comment is necessary, the code is fairly clear to understand
| RAILBLOCKS_NUMBER_RANGE_TEXT: '%1 bis %2', | ||
| RAILBLOCKS_NUMBER_RANGE_TOOLTIP: 'Erstellt eine Reihe von Nummern.', | ||
| RAILBLOCKS_INT_RANGE_TEXT: '%1 bis %2', | ||
| RAILBLOCKS_INT_RANGE_TOOLTIP: 'Erstellt eine Reihe von Nummern.', |
There was a problem hiding this comment.
Nummern klingt irgendwie komisch. Ja, es sind Nummern weil es Ids sind, aber allgemein würde ich glaube ich eher Zahlen sagen
Added new input fields and blocks:
Changed renderer to zelos: