Commit Graph

108 Commits

Author SHA1 Message Date
Erik Pasternak
fa6f41f395 Redo the fixes to event groups in connection.js 2019-07-19 17:06:49 -07:00
Erik Pasternak
060c2b34df Revert "Propagate the visible state when blocks connect (#2003)"
This reverts commit ec78eeb39b.
2019-07-19 17:06:38 -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
Neil Fraser
cf8ee673a9 Fix inheritance on rendered connection.
Closure compiler on maximum compression breaks badly due to lack of
@extends attribute.
2016-06-03 18:44:40 -07:00
Neil Fraser
a625d5b07c Fix unit tests. 2016-06-03 16:40:50 -07:00
Neil Fraser
1db8092f15 Do not allow shadow blocks to have non-shadow children. 2016-05-29 14:53:29 -07:00
Rachel Fenichel
954b061e4a Merge branch 'develop' into feature/dragged_connection_list 2016-05-12 13:20:16 -07:00
Rachel Fenichel
e28db7bc4e JS Doc and private 2016-05-10 15:46:51 -07:00
Rachel Fenichel
45f9b8af05 consolidation 2016-05-10 15:45:19 -07:00
rachel-fenichel
7b1fdcb7c6 make tests work; make connext_ a member function. 2016-05-10 15:45:19 -07:00
rachel-fenichel
fbaa33b888 split connection into rendered_connection and connection 2016-05-10 15:43:32 -07:00
Rachel Fenichel
640b38f38e lint 2016-05-05 13:13:48 -07:00
Neil Fraser
c785cabe40 Use more coordinates. 2016-04-19 23:24:42 -07:00
Neil Fraser
c3931df2ae Fix shadow block init on headless workspaces. 2016-04-07 16:24:27 -07:00
rachel-fenichel
5c8ff88587 Keep a list of connections that are being dragged 2016-04-05 16:13:19 -07:00
Neil Fraser
4e42a1b78e Swap order of arguments on domToWorkspace. 2016-04-04 18:31:41 -07:00
Neil Fraser
2ce0a25f92 Fix error thrown when disconnecting blocks that have never been dragged. 2016-04-02 04:53:04 -07:00