Commit Graph

610 Commits

Author SHA1 Message Date
Rachel Fenichel ef4882d90d Add variable deletion as dropdown action 2016-07-07 14:39:45 -07:00
Rachel Fenichel 4a81ecb601 Create variable list, and use it for add and rename 2016-07-07 14:38:56 -07:00
Rachel Fenichel 94e0a7ff4c Change params of flyout.layout 2016-07-07 14:38:04 -07:00
Rachel Fenichel cb3bef8f32 Flyout button with click handler 2016-07-07 14:37:12 -07:00
Rachel Fenichel e371da3031 First pass at svg button in flyout 2016-07-07 14:35:30 -07:00
rachel-fenichel 603477d188 Merge pull request #417 from drigz/bugfix/flyout-clicks
Revise handling of mouse events on flyout blocks
2016-07-07 11:22:01 -07:00
Neil Fraser 555eac8b7f Simplify field validator chaining. 2016-06-29 17:44:12 -07:00
Rodrigo Queiro 0454c93ff8 Clean up #417 after review 2016-06-29 12:26:11 +02:00
Rodrigo Queiro 4e3faf0158 Revise handling of mouse events on flyout blocks
- allows scrolling by dragging a block up and down
- dragging a block towards the workspace creates it
- dragging a block any direction in a non-scrollable flyout creates it
- dragging a shadow block works properly
- clicks on fields in non-closeable flyouts always open editors
- clicks in closeable flyouts create the block but don't open editors

Fixes #385 and fixes #405.
2016-06-29 11:29:03 +02:00
Rodrigo Queiro 2dcb6cb68b Ignore mouseup at end of drag with isDragging (#416)
This includes both block drags and workspace scrolls and fixes #404. I
used isDragging rather than checking the origin of click so that it can
easily be extended to the case where the flyout is scrolled by dragging
a block, a la LLK/scratch-blocks#206.
2016-06-28 18:11:48 -07:00
Neil Fraser 619b915070 Merge remote-tracking branch 'origin/develop' into develop 2016-06-27 17:34:40 -07:00
Neil Fraser a92ae1c943 Merge branch 'master' into develop 2016-06-27 17:34:33 -07:00
rachel-fenichel aca074891d Fix some problems with flyout rendering (#461) 2016-06-27 17:27:08 -07:00
Neil Fraser 0be0cc89c7 Second version of FieldNumber API. 2016-06-22 15:07:07 -07:00
Andrew n marshall 425513b729 Don't output blockId if not set (e.g., toolbox category event). (#443) 2016-06-22 13:11:19 -07:00
Markus Bordihn ac0e704c69 Fixed Parse error. Non-JSDoc comment has annotations. (#451) 2016-06-22 13:10:25 -07:00
Neil Fraser 91b10cae2f Create console stub for IE 9. 2016-06-22 13:01:37 -07:00
Neil Fraser 98617d8ddc Move tokenizeIntepolation into Blockly.utils namespace. 2016-06-22 13:01:37 -07:00
Rachel Fenichel a234506324 Merge branch 'develop' into feature/cache_screen_ctm 2016-06-21 15:57:53 -07:00
Rachel Fenichel 42f620daa2 Check if matrix is null in mouseToSvg 2016-06-21 15:56:00 -07:00
Neil Fraser c8f9cb34d5 Merge branch 'master' into develop 2016-06-21 04:32:17 -07:00
Neil Fraser 93125fd1e6 Make it easy to disable unconnected blocks. 2016-06-21 04:31:45 -07:00
Neil Fraser 732e9b0659 Start using field_number. 2016-06-21 04:10:32 -07:00
Neil Fraser 4b319d461d Reduce unneeded parentheses in JS and Python. 2016-06-20 17:34:36 -07:00
rachel-fenichel 41f6f50b77 Merge pull request #438 from rachel-fenichel/feature/cache_delete_areas
Cache delete areas
2016-06-17 14:56:10 -07: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
picklesrus 567fe6a2e8 Call svgResizeContents from block_svg's dipose so that deleting blocks (#434)
from the context menu (or anywhere really) causes the workspace to
recalculate its size.
Remove the call to svgResizeContents from onMouseUp's logic for
determining whether the block is being dropped in the trash
since it calls dispose.

One side effect of this is that when you delete multiple blocks
resize gets called for each of them and the scrollbars move during
the operation. This is most obviously seen by doing an airstrike
in the playground and then deleting all the blocks at once.
2016-06-17 14:33:23 -07:00
Rachel Fenichel c4cad3c6e4 Cache screen CTM for performance improvement. 2016-06-17 14:26:04 -07:00
Rachel Fenichel 8f601345bb cache delete areas instead of recalculating them onMouseDown 2016-06-17 12:39:18 -07:00
Neil Fraser 36130cbc39 Don't fire change event on fields that haven't been named yet. 2016-06-15 01:30:04 -07:00
Neil Fraser 04ebbb3b76 Fix undo on fields with validators with side effects. 2016-06-14 18:42:49 -07:00
Neil Fraser 02b2c219eb Prevent selected block from ending up underneath a bumped block. 2016-06-14 17:36:50 -07:00
Andrew n marshall 592b2e1a51 Updating URLs to reflect new docs. (#418)
* Updating URLs to reflect new docs. Removing -blockly in URLs.

* Rebuilt.
2016-06-14 10:15:35 -07:00
picklesrus 33ba6e8fad Fix #423 by calling workspace's resize when the flyout reflows. (#430) 2016-06-14 10:13:03 -07:00
Neil Fraser fd6f743f0e Remove unneeded generated parens around function calls in indexOf blocks. 2016-06-13 18:49:18 -07:00
picklesrus 6851baea12 Fix #425. Attash the resize handler to the workspace so it can be removed (#429)
when workspace.dispose() is called.
2016-06-13 14:46:58 -07:00
Neil Fraser 477562b597 Prevent collisions between user functions and helper functions. 2016-06-12 12:19:14 -07:00
Neil Fraser 8c94a16bc6 Fix error when undoing a shadow block replacement. Issue #415. 2016-06-10 18:19:25 -07:00
picklesrus f64f6f7d6f Trigger a contents resize in block's moveBy. (#422)
This fixes #420 but and it also fixes some other similar problems
with copy/paste and other users of moveBy.
2016-06-10 13:46:44 -07:00
Neil Fraser dcc7de52a5 Merge branch 'master' into develop 2016-06-09 17:30:45 -07:00
picklesrus 1aecb78dd1 Fix issue #406 by calling resize from the keypress handler on text inputs. (#408) 2016-06-09 02:35:32 -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 3012d52808 Line wrap comments in generated code. 2016-06-08 00:12:58 -07:00
Rodrigo Queiro 0585a667ec Fix typo in flyout.js (#402) 2016-06-07 09:54:57 -07:00
Rodrigo Queiro 736ff96ead Fix typo in flyout.js (#403) 2016-06-07 09:54:37 -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 57131165b0 Routine recompile 2016-06-03 16:12:59 -07:00
picklesrus 213469a479 Change the blockly workspace resizing strategy. (#386)
* Add a new method to be called when the contents of the workspace change and
the scrollbars need to be adjusted but the the chrome (trash, toolbox, etc)
are expected to stay in the same place.

Change a bunch of calls to svgResize to either be removed or call the new
method instead.  This is a nice performance win since the offsetHeight/Width
call in svgResize can be expensive, especially when called as often as we do -
there was some layout thrashing.

This also paves the way for moving calls to recordDeleteAreas
(which is also expensive) to a more cacheable spot than on every
mouse down/touch event.

of things (namely the scrollbars)

* Fix size of graph demo when it first loads by calling svgResize.
The graph starts with fixed width and was relying on a resize event
to fire (which I believe was removed in commit
217c681b86).

* Fix the resizing of the code demo.  The demo's tab min-width used to
match the toolbox's width was only being set on a resize event, but
commit 217c681b86 changed how that worked.

* Fix up some comments.

* Use specific workspaces rather than Blockly.getMainWorkspace().

* Make workspace required for resizeSvgContents and update
some calls to send real workspaces rather than ones that are
null.

Remove the private tag on terminateDrag_ because it is only
actually called from outside the BlockSvg object.

* Remove a rogue period.

* Recategorize BlockSvg.terminateDrag_ to @package instead of @private so that
other developers don't use it, but it still can be used by other Blockly classes.

* Add a TODO to fix issue #307.

* Add @package to workspace resizeContents.
2016-06-03 16:11:55 -07:00