Commit Graph

1594 Commits

Author SHA1 Message Date
Neil Fraser
ed0b5adcd1 Wrong language. 2019-05-17 15:04:39 -07:00
Neil Fraser
04e39c20f8 Fix indentation bug if no xfix exists in function 2019-05-14 17:19:31 -07:00
Neil Fraser
c0e14c3a7c Add method to suppress prefix/suffix from blocks.
This allows generators to have more control over the placement of suffix.  Needed for ‘if’ blocks and function calls which require their suffix code to be somewhere other than the end.
Also, add loop’s prefix to ‘break’ blocks, since the loop’s suffix will be the next statement hit.
Also, reuse procedures_callreturn generator for procedures_callnoreturn.
2019-05-14 17:19:31 -07:00
Neil Fraser
25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -07:00
Neil Fraser
0259f8bb48 Add extra suffix when generating if/return block.
Also fix loops in Lua.
2019-05-14 17:19:31 -07:00
Neil Fraser
ba18ae2159 Add STATEMENT_SUFFIX
Also remove need to manually indent INFINITE_LOOP_TRAP.  This is a breaking change for Python users of this property.  However, very few users of this property exist, given that the existing code breaks if the block ID has a $ in it (also fixed in this PR).
2019-05-14 17:19:31 -07:00
Neil Fraser
28ad3a9bd3 Blockly.utils.userAgent moved to Blockly.userAgent 2019-05-10 16:56:26 -07:00
Neil Fraser
25ddecab50 Undo workaround for IE10.
Due to no longer supporting IE10, we don’t need the code added here: 92f3880008
2019-05-10 16:39:32 -07:00
Neil Fraser
fa8c7f3884 Lint fix. 2019-05-10 14:30:31 -07:00
Neil Fraser
4062030731 Remove goog.userAgent dependency. 2019-05-10 14:03:21 -07:00
asunwoo98
e25734ff25 typo fix in createVariable documentation in variable.js (#2443) 2019-05-06 13:09:50 -07:00
Beka Westberg
354d402c49 Refactored field.init into field.initView and field.initModel 2019-05-03 07:12:46 -07:00
Navid Zandi
44501f17cc Resolve field angle overlap render problem (#2418)
* Rebuild and update version numbers

* rebuild

* Update version number to 1.20190419.0

* Resolve field angle overlap render problem

* use block.getColourBorder() function
2019-05-02 13:38:48 -07:00
Neil Fraser
834fa64674 Use Element constants and ‘i’ variable.
I don’t care about whether we use the Element constants or the ubiquitously known 1 & 3 integers.  But we had a mix.
Also, ’x’ is usually used for horizontal location, ‘i’ is an iterator.
No functional change.
2019-05-02 09:56:37 -07:00
Neil Fraser
6f433d7521 Don’t preserve IDs during cut/copy/paste or flyout
Previously, if the XML of a toolbox contained a block ID, the first creation of this block would inherit this ID.  Thus two realtime collaborators could realistically end up with conflict.  Likewise, cut and paste could generate similar conflict.
2019-05-02 09:56:37 -07:00
Beka Westberg
3afcd23535 Removed explicitly setting variable type to two single quotes. 2019-05-01 14:31:20 -07:00
Beka Westberg
247aafae7e Added updateColour to field. 2019-04-29 16:53:59 -07:00
Beka Westberg
79d75b9f3d Fixed buttons being rendered as labels if they come after a label. (#2410) 2019-04-25 18:21:42 -07:00
Beka Westberg
123b5dc91e Added fromXml and toXml to fields. 2019-04-25 16:00:09 -07:00
Beka Westberg
5c4c816a9b Removed setVisible from the public API (#2406) 2019-04-24 16:07:47 -07:00
Beka Westberg
ce816b93bf Added field_label_serializable. (#2399) 2019-04-24 10:43:09 -07:00
Jim Jiang
1b10d134a5 Add Block.setEnabled (#2386)
* Implement Block.setEnabled()

From issue #1593. This commit:
- add setEnabled
- deprecate setDisabled

* Update setDisabled calls to setEnabled

Add setEnabled and deprecate setDisabled in
- core/block_svg

Update calls in
- blocks/loops
- blocks/procedures
- core/block_events
- core/events
- core/flyout_base
- core/xml
- tests/workplace_svg/procedure_svg_test

* Implement changes from comments from RoboErikG

- Implement isEnabled()
- Make this.disabled @private
- Make setDisabled(disabled) call setEnabled(!disabled)
- Update setEnabled to use isEnabled()

* Utilize isEnabled() and fix typos

Fix missing parentheses
Implement isEnabled() more widely
Fix lint and parentheses errors

* Change prevDisabledState to prevEnabledState
2019-04-23 08:49:07 -07:00
asunwoo98
aa4d885cba Validate newValue parameter in setValue (#2392)
* Validate newValue parameter in setValue

* bugfix

* alternate fix

* test

* cleanup
2019-04-22 16:00:37 -07:00
Rachel Fenichel
a84e86f097 Merge pull request #2366 from alschmiedt/Documentation_Update
Documentation update
2019-04-22 14:45:38 -07:00
alschmiedt
1ca7d6a28b Clarifies what statementToCode does 2019-04-22 14:20:05 -07:00
Beka Westberg
9a9c6612f8 Changed buttons and labels to respect <sep> elements in toolbox. (#2395) 2019-04-22 12:23:04 -07:00
Beka Westberg
e8573bc0db Added isSerializable function and SERIALIZABLE property to fields. 2019-04-21 08:28:37 -07:00
ahigerd
bc77024670 Reorganize conditionals for block context menu (#2390)
* Reorganize conditionals for block context menu

* Disable comments and disabling in block factory
2019-04-18 08:49:07 -07:00
Beka Westberg
0617cc7fea Added isDirty_ property to fields. 2019-04-15 16:37:11 -07:00
RoboErikG
ec78eeb39b Propagate the visible state when blocks connect (#2003)
* Propagate the visible state when blocks connect

This fixes #1967.

In rendered connections when connecting:
- If the superior connection is hidden this hides the newly connected block.
- If the superior connection isn't hidden it makes sure the block is visible.

In rendered connections when disconnecting:
- If the superior connection is hidden, make the disconnected block stack visible.

TODO before review:
 - write tests.
 - update collapsed message

* Add missing overrides

* Add tests for hidden connections and fix a bug while disposing
2019-04-15 16:23:19 -07:00
Beka Westberg
f88c704d69 Fixed visible floating point errors in number fields. (#2384) 2019-04-15 13:26:20 -07:00
Rachel Fenichel
6bb27052ee Merge pull request #2383 from google/fraser-angle
Angle picker's degree symbol left of number in both LTR and RTL.
2019-04-15 12:33:38 -07:00
Beka Westberg
b93253c69c Fixed Mutator Flyout Being Positioned Incorrectly RTL (#2378)
* Fixed mutator flyout being positioned incorrectly.

* Changed flyout_horizonal and flyout_vertical to check this.targetWorkspace_.toolboxPosition instead of targetWorkspaceMetrics.toolboxPosition.
2019-04-15 10:02:07 -07:00
Neil Fraser
8c99cccbc3 Degree symbol left of number in both LTR and RTL.
Resolves issue #2380.
2019-04-13 20:30:56 -07:00
Rachel Fenichel
1bd7c7bffd Merge pull request #2376 from alschmiedt/rever_hideChaff_fix
Reverts hideChaff fix
2019-04-11 14:25:24 -07:00
alschmiedt
be4da5feeb Reverts hideChaff fix 2019-04-11 11:43:37 -07:00
Rachel Fenichel
9c0e138e22 Merge pull request #2367 from alschmiedt/mutator_fix
Updates function call
2019-04-08 17:30:33 -07:00
asunwoo98
ef1c6d08d4 typo fix in line 134 of field.js for documentation 2019-04-08 18:00:38 -04:00
alschmiedt
c4f8313792 Updates function call 2019-04-08 14:14:56 -07:00
alschmiedt
98a1c06e7a Changed jsdoc 2019-04-08 10:48:22 -07:00
RoboErikG
5056e23389 Fix margins/checkbox in RTL dropdown menus (#2356)
Fixes #2337 by adding in correct positioning for RTL selected states
and fixing an incorrect margin value.
2019-04-05 15:55:00 -07:00
alschmiedt
97d670c0ea Updates documentation 2019-04-05 12:00:04 -07:00
alschmiedt
4fca16730c core/generator.js 2019-04-05 11:59:05 -07:00
alschmiedt
dcbac91ba3 Merge pull request #2360 from alschmiedt/Bump_RTL
Fixes bumping too much when in RTL
2019-04-04 16:26:14 -07:00
alschmiedt
a759fffcc1 Fixes bumping too much when in RTL 2019-04-04 15:54:17 -07:00
alschmiedt
124a8f1e40 Merge pull request #2359 from alschmiedt/Hide_chaff_bug
Hides chaff on document mouseup
2019-04-04 14:08:55 -07:00
alschmiedt
db7a87555f Hides chaff on document mouseup 2019-04-04 11:24:22 -07:00
Tiara Tan
e79dcecb22 Rename WorkspaceSvg.getFlyout_ (#2357) 2019-04-03 14:22:42 -07:00
alschmiedt
380d05dd08 Merge pull request #2355 from alschmiedt/unplug_fix
Adds check for a targetConnection
2019-04-02 17:18:07 -07:00
alschmiedt
1034ba835c Adds check for a targetConnection 2019-04-02 14:42:41 -07:00