Commit Graph

122 Commits

Author SHA1 Message Date
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -07:00
Sam El-Husseini
7d174727b0 Fix warnings for code used by blocks (#3362) 2019-10-30 08:11:18 -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
526528354f Fix 10 warnings related to visibility (#3275) 2019-10-17 11:46:57 -05:00
alschmiedt
cf04a9529b Fix compilier warnings for keyboard nav (#3196)
* Fix compilier warnings for keyboard nav
2019-10-08 11:34:39 -07:00
Rachel Fenichel
608ce7b93c Merge pull request #3133 from BeksOmega/fixes/ConnectionTracking
Connection Tracking Pt 3: Changed connections to use 'tracked_' property
2019-10-07 11:05:10 -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
Beka Westberg
df5b5766c1 General cleanup. 2019-10-01 19:22:19 -07:00
Beka Westberg
afbb2cca1e Moved all database related code out of headless and into rendered. 2019-09-27 18:00:06 -07:00
Beka Westberg
1baf7d1dcf Added a bunch of connection related tests. 2019-09-27 15:56:29 -07:00
Monica Kozbial
e1e9513e86 Disconnect child block always for block.dispose(/* healStack */ true) (#3073)
* Disconnecting child block even if it cannot be connected to parent block.

* Bump disconnected child block.

* Added method for behavior on failed connection and updated expected behavior of unplug in unit tests.

* Removing obsolete TODO and calling new helper method in tests.
2019-09-25 10:47:29 -07:00
Beka Westberg
654467e9ac Added disposed = false properties to fields, connections, and blocks. Changed applicable unit tests from isNotOk -> isFalse. 2019-08-07 07:17:41 -07:00
Beka Westberg
a4b4f09071 Fixed connection dispose jsdoc. 2019-08-07 07:07:30 -07:00
Beka Westberg
49405a88bd Changed connections to handle disposing of connected blocks. 2019-08-07 07:07:29 -07:00
Abby
1c26b6d79b Adds helper functions for keyboard nav 2019-07-24 11:42:37 -07:00
Neil Fraser
9f6c1c316a Refactor workspace.connectionDBList
It seems wrong that Blockly.ConnectionDB.init reaches in to create a property on workspace.
It seems wrong that this database isn’t disposed of when the workspace is.
It seems unnecessary that disposed connections need to drop their reference *to* the workspace’s database since the connection object is going away anyway, and the databases aren’t.
2019-06-12 13:15:39 -07:00
Neil Fraser
cf91b82bb0 Fix three new and ten existing Closure warnings.
Current count: 638
2019-06-07 10:32:57 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
4161ba0fa7 Move goog.global to Blockly.utils.global
Can’t use Blockly.global since that’s the last file to load.
2019-05-17 15:04:39 -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
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Rachel Fenichel
90f6832d06 Fix insertion marker flickering on value inputs (PR #2295)
Merge from rachel-fenichel/bugfix/2255
2019-02-15 12:43:45 -08:00
Rachel Fenichel
b606bc5ec6 Don't distinguish between first statement connection and others 2018-11-30 14:36:37 -08:00
Rachel Fenichel
5938c6df3b Fix #2131 2018-11-30 14:34:14 -08:00
Rachel Fenichel
ef23820b83 Add private annotation 2018-11-19 13:00:10 -08:00
Rachel Fenichel
a8b0b90c6f Add warning for default case in canConnectToPrevious_ 2018-11-19 12:55:04 -08:00
Rachel Fenichel
d70e89d1e0 Cleanup 2018-11-19 12:51:18 -08:00
Rachel Fenichel
991b70410e Minor cleanup 2018-11-19 12:44:43 -08:00
Rachel Fenichel
53d8ac8b0b Prefer inserting to wrapping for c-shape blocks 2018-11-19 11:16:03 -08:00
Rachel Fenichel
17823db4df Fix problem with connecting a statement into a stack, but not a c-shape block 2018-11-14 11:22:57 -08:00
Neil Fraser
db0dbc69ee Update todos and requires. 2018-10-16 11:34:10 -07:00
Rachel Fenichel
5d8d30935e Restructure isConnectionAllowed to match scratch blocks 2018-09-14 13:58:31 -07:00
Rachel Fenichel
da309e264f Add info to annotation 2018-09-13 11:04:31 -07:00
Tianwei Du
dcab9c1013 Add connection.getCheck function #2048 (#2049)
* Add connection.getCheck function #2048

* remove unused argument

* fix eslint error

* fix eslint error
2018-09-13 11:02:39 -07:00
Neil Fraser
0583bee502 Correct requires for goog.dom 2018-07-11 12:20:02 -07:00
Neil Fraser
06d90c9b34 Remove goog.array 2018-07-11 12:20:02 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Johnny Yang
419fe9e8a5 mark properties @protected instead of @private so they can be used by Blockly.RenderedConnection 2018-04-16 01:34:52 +10:00
Rachel Fenichel
4c9b602523 Move event classes into separate files, and update requires accordingly 2018-02-27 17:47:33 -08:00
marisaleung
aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00
Rachel Fenichel
98914fcf6b Dragging changes, rebased on develop (#1078)
* Add block drag surface translateSurfaceBy

* Add dragged connection manager

* Add gesture.js

* Add GestureHandler

* Implemented gesture skeleton

* Most basic workspace dragging

* Add dragged connection manager

* cleanup

* doc

* more cleanup

* Add gesture handler

* Add translateSurfaceInternal

* core/block_dragger.js

* cleanup

* Pull in changes to dragged connection manager

* Pull in changes to dragged connection manager

* comments

* more annotations

* Add workspace dragger

* Add coordinate annotations

* Start on block dragging

* Limit number of concurrent gestures

* Add some TODOs

* start using dragged connection manager

* Set origin correctly for dragging blocks

* Connect or delete at the end of a block drag.

* cleanup

* handle field clicks and block + workspace right-clicks

* move code into BlockDragger class, but still reach into Gesture internals a lot

* Clean up block dragger

* Call blockDragger constructor with correct arguments

* Enable block dragging in a mutator workspace

* Add workspace dragger

* click todos

* Drag flyout with background

* more dragging from flyout

* nit

* fix dragging from flyouts

* Remove unused code and rename gestureHandler to gestureDB

* Rename gesture handler

* Added some jsdoc in gesture.js

* Update some docs

* Move some code to block_svg and clean up code

* Lots of coordinate annotations

* Fix block dragging when zoomed.

* Remove built files from branch

* More dragging work (#1026)

-- Drag bubbles while dragging blocks
-- Use bindEventWithChecks to work in touch on Android. Not tested anywhere else yet.
-- Handle dragging blocks while zoomed
-- Handle dragging blocks in mutators
-- Handle right-clicks (I hope)
-- Removed lots of unused code

* More dragging work (#1048)

- Removed gestureDB
- Removing uses of terminateDrag
- Cleaned up disposal code

* Dragging bugfixes (#1058)

- Get rid of flyout.dragMode_ and blockly.dragMode_
- Make drags from the flyout start from the top block in the group
- Block tooltips from being scheduled or shown during gestures
- Don't resize mutator bubbles mid-drag

* Fix events in new dragging (#1060)

* rebuild for testing

* unbuild

* Fix events

* rebuild

* Fix up cursors

* Use language files from develop

* Remove handled TODOS

* attempt to fix IE rerendering bug, and recalculate workspace positions on scroll

* Rebuild all the things

* Comment cleanup; annotations; delete unused variables.
2017-05-05 12:42:53 -07:00
Andrew n marshall
79becd6b31 Add no-op stub .neighbors() for headless Connection. 2017-02-13 16:28:43 -08:00
Andrew n marshall
24ebbcaad0 Improving errors/warnings with Block.toDevString() and Connection.toString(). (#911) 2017-02-06 14:15:20 -08:00
Sean Lip
bf3b5f9d0d Fix a bug where splicing a block between two linked blocks disconnects the group and messes up the focus. 2017-01-27 18:33:39 -08:00
Rachel Fenichel
2474ec53ab Stop bumping neighbours in headless blockly 2017-01-27 11:33:04 -08:00
rachel-fenichel
7a1db20765 Allow terminal blocks to replace other terminal blocks (#433)
* Allow terminal blocks to replace other terminal blocks

* Updated test to allow replacing terminal blocks
2016-06-17 14:34:28 -07:00
Rodrigo Queiro
c09624a1b8 Remove reference to undefined variable (#413)
REASON_MUST_DISCONNECT was removed by a refactor in 2a1ffa1.
2016-06-08 10:01:04 -07:00
Neil Fraser
9ca00656ad Properly deal with shadow statement blocks in stacks. 2016-06-05 16:58:27 -07:00