Commit Graph

369 Commits

Author SHA1 Message Date
Monica Kozbial
638ecf6023 Adding getter to procedures call for arguments_. (#3983) 2020-06-22 15:28:31 -07:00
Beka Westberg
79ce850cf8 Fix procedure callers accessing private vars 2020-04-11 16:16:25 -07:00
Monica Kozbial
a9223b0b22 Typo fixes. (#3769) 2020-03-25 15:47:27 -07:00
Jakub Vrána
00bb99e0ff Add non-nullable modifier to return type of functions never returning null (#3742) 2020-03-16 08:14:47 -07:00
Beka Westberg
fabb8c44b1 Fix procedure args handling case incorrectly 2020-02-23 10:12:08 -08:00
Beka Westberg
5445cf4cf8 Add comments to break block change listener. 2020-02-19 14:40:28 -08:00
Beka Westberg
392d25eb39 fix: Break breaking undo. 2020-02-18 16:01:18 -08:00
Neil Fraser
4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini
0bc8960d79 Update list and text create block to right align its value inputs (#3667) 2020-01-30 17:05:00 -08:00
Monica Kozbial
e2b510662c Fixing typo on "programmatically". (#3654) 2020-01-24 15:10:22 -08:00
Beka Westberg
6d1bb201f7 feat: Improved procedure arg interaction. (#3527)
* feat: Improved procedure arg interaction.

* Added docs.

* Fixed typos and typings.

* Fixed typings?

* Changed visibility to private.
2020-01-07 13:55:46 -08:00
Beka Westberg
1ce97d1c50 Added checking if the block is disposed before trying to reconnect in logic_compare block. 2019-11-04 14:41:45 -08:00
Neil Fraser
22c1eba546 Make warnings an optional module. 2019-11-01 11:52:12 -07:00
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
52bef4463c Fix warnings related to connections. (#3306)
* Fix warnings related to connections.
2019-10-23 17:56:52 -04:00
Sam El-Husseini
664cc3d6cd Fix warnings related to number of arguments passed. (#3270) 2019-10-17 11:47:30 -05:00
Sam El-Husseini
2ac4149d98 Misc compiler warnings. (#3172)
* Fix misc compiler warnings. Use ws.getToolbox() instead of ws.toolbox_
2019-10-07 11:06:56 -07:00
Sam El-Husseini
d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -07:00
Neil Fraser
b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Neil Fraser
a1e3973499 Make block comments an optional module. (#3053)
Measured as a 5 KB *increase* in code size, but that's because some other commit just landed between my tests. It's like running down an up escalator.
2019-09-19 14:53:28 -07:00
Neil Fraser
84a814cda1 Make mutator an optional module. (#3048) 2019-09-19 11:39:55 -07:00
Beka Westberg
093467aed1 Added More Procedure Unit Tests (#2630)
* Added more procedure unit tests.

* Cleanup from rebase.

* Cleanup.
2019-09-18 16:14:06 -07:00
Neil Fraser
0add3a5e3e Add require statements to all block files. 2019-09-18 13:00:44 -07:00
Neil Fraser
5650fe51a2 Typos. 2019-09-12 18:24:48 -07:00
Rachel Fenichel
6f4476c962 Textarea Field, Multiline Block (from acbart) (#2663)
* Field Textarea, text_multiline block, generators
2019-09-11 17:57:46 -07:00
Rachel Fenichel
f717add5a5 Block annotations (#2997)
* Replace `@this Blockly.Block` with `@this {Blockly.Block}` in all block files.

* Fix 9 compiler warnings (JSC_USED_GLOBAL_THIS)
2019-09-11 17:50:52 -07:00
RoboErikG
a7b560db81 Revert "Mark Blockly.Constants.Colour and .Lists depreacted. (#1797)"
This reverts commit b2cb96b5b1.
2019-09-05 15:34:20 -07:00
Rachel Fenichel
e523943ee9 Merge pull request #2615 from BeksOmega/fixes/Procedures
Fixed Procedure Empty Names & Procedure Parameters
2019-07-23 11:21:22 -07:00
Beka Westberg
b7e6d3704a Fixed Procedure Argument Escaping (#2626)
* Refactored procedure decompose to build XML node by node. Fixed argument name escaping.

* Fixed review comments.
2019-07-10 16:58:25 -07:00
alschmiedt
6e9761b249 Merge pull request #2618 from alschmiedt/dynamic_variable_error
Fixes bug with using dynamic variable in toolbox
2019-07-09 16:29:11 -07:00
Beka Westberg
c053130da3 Fixed Procedure Decomposition Not Working with >1 Arguments (#2622)
* Fixed procedure decomposition not working with >1 arguments.

* Fixed typo causing #2612.
2019-07-09 16:06:58 -07:00
alschmiedt
f30d79fbc8 Fixes bug with using dynamic variable in toolbox 2019-07-09 11:02:02 -07:00
Neil Fraser
52b6ce18a5 Fix unit tests 2019-07-08 13:29:43 -07:00
Beka Westberg
bb19b4ce0c Reenabled parameter case tests. 2019-07-08 10:44:20 -07:00
Beka Westberg
ab352114b7 Fixed renaming procedure parameters. 2019-07-08 10:39:29 -07:00
Beka Westberg
b34ca2f93b Fixed review comments. 2019-06-25 15:08:01 -07:00
Beka Westberg
85c4e4129f Added procedure tests. 2019-06-25 15:08:01 -07:00
Neil Fraser
b8cbd9e7df Resolve 13 warnings
Reduce count from 632 to 619.
Eliminate copy-paste code duplication in Field.prototype.setValue
2019-06-12 10:59:33 -07:00
Neil Fraser
cf91b82bb0 Fix three new and ten existing Closure warnings.
Current count: 638
2019-06-07 10:32:57 -07:00
Beka Westberg
73ff710a4d Added getSourceBlock function to field. (#2508) 2019-05-29 12:50:00 -07:00
Beka Westberg
f16c9c0beb Refactored field validation. 2019-05-24 14:23:42 -07:00
Neil Fraser
e642a77f5d Use conventional prefix/suffix for function calls.
Previously a function call with no return value generated:

  prefix();
  suffix();
  function();

The intent was so the prefix and suffix calls in the function body wouldn’t overlap with the prefix and suffix calls of the function call.  However, this is doomed to be inconsistent with a function call with a return value:

  prefix();
  print(function());
  suffix();

Thus since overlaping must exist, both types of function calls should have consistent suffix locations.
2019-05-17 15:04:39 -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
Beka Westberg
5c4c816a9b Removed setVisible from the public API (#2406) 2019-04-24 16:07:47 -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
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Andrew Au
d919b4369d Fix issue 2061 (#2326) 2019-03-12 09:50:49 -07:00
Beka Westberg
9dec2da5c5 Movement Updates (#2247)
This is a squash and merge of a large set of changes by @BeksOmega 

* Added functionality to scrolling, dragging, and zooming.

* Fixed incorrect changes to workspaceChanged function.

* Fixed comment.

* Fixed typo.

* Removed scrollbar.set calls from workspace_svg.

* Removed scrollbar.resize() call.

* Added move options to playground.

* Fixed scroll_ calls that replaced scrollbar.set calls.

* Removed this.scrollbar checks.

* Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again.

* Changed procedures so the Highlight definition option is only available if the workspace is moveable.

* Fixed scrollCenter so that it works with flyout toolboxes.

* Fixed zoomToFit so that it works with horizontal flyout toolboxes.

* Fixed Typo.

* Fixed bumping blocks when the workspace is not movable.

* Fixed bumping not working with left and top toolbox positions.

* Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case.

* Cleaned up formatting.

* Fixed bumping... again. Reformatted workspaceChanged a bit.

* Changed blocks to be completely bumped into the workspace.

* Reorganized metrics-getting for workspaceChanged.

* Added bumping workspace comments. Moved event checking.

* Renamed workspaceChanged to bumpObjects.

* Added a bumpObjects developer reminder.

* Added warning to zoomToFit.

* Cleaned up some text.

* Added better inline documentation.

* Fixed up inline docs.

* Cleaned up comments.

* Fixed zoomCenter not actually zooming towards the center.

* Fixed zoomControls error on unmovable bottom-toolbox workspaces

* Fixed programatically placing blocks in an unmovable workspace.

* Removed unnecessary translate call in inject.

* Reversed removal of translate. (apparently it was necessary)

* Cleaned up code in response to first round of reviews.

* Added unit comments to the zoom function.

* Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events.

* Changed getWorkspaceObjectMetrics call to getBoundingRectangle().

* Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled).

* Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg.

* Fixed centerOnBlock.

* Added unit docs to translate. Moved setting the grid position to the translate function.

* Added TODO's.
2019-02-18 15:28:51 -08:00
Deniz Susman
eb5bf10911 Typo fix in code comment (#2269)
"independent" instead of "independant".
2019-02-06 13:00:28 -08:00