Commit graph

114 commits

Author SHA1 Message Date
Neil Fraser
555eac8b7f Simplify field validator chaining. 2016-06-29 17:44:12 -07:00
Rodrigo Queiro
2dcb6cb68b Ignore mouseup at end of drag with isDragging ()
This includes both block drags and workspace scrolls and fixes . 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 .
2016-06-28 18:11:48 -07:00
Rachel Fenichel
a234506324 Merge branch 'develop' into feature/cache_screen_ctm 2016-06-21 15:57:53 -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
fd6f743f0e Remove unneeded generated parens around function calls in indexOf blocks. 2016-06-13 18:49:18 -07:00
picklesrus
6851baea12 Fix . Attash the resize handler to the workspace so it can be removed ()
when workspace.dispose() is called.
2016-06-13 14:46:58 -07:00
Neil Fraser
57131165b0 Routine recompile 2016-06-03 16:12:59 -07:00
picklesrus
213469a479 Change the blockly workspace resizing strategy. ()
* 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 .

* Add @package to workspace resizeContents.
2016-06-03 16:11:55 -07:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Neil Fraser
0242238a44 Remove sound and animation on delete during undo/redo. 2016-05-21 06:14:33 -07:00
Neil Fraser
006bb36b89 Prevent sounds from playing on top of each other. 2016-05-21 05:55:24 -07:00
Neil Fraser
29e10e0976 Routine recompile. 2016-05-14 03:50:35 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -07:00
Rachel Fenichel
32eed0d2f8 Merge branch 'develop' into cleanup/lint 2016-05-10 14:43:09 -07:00
Rachel Fenichel
3605dfb9c0 Undo decimation of variable redeclarations 2016-05-10 14:40:48 -07:00
Rachel Fenichel
640b38f38e lint 2016-05-05 13:13:48 -07:00
Katelyn Mann
ca16d1fefe An alternate (and less expensive) way to keep stuff outside of the blockly div
from getting selected. Use e.preventDefault instead of adding and removing
classes on mousedown and mouseup.  This keeps the browser from having to
potentially recacluate style on mousedown and mouseup events.
2016-05-04 19:12:38 -07:00
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue . 2016-05-04 15:00:57 -07:00
Neil Fraser
554fe18ab9 Use direct call to comment's resize rather than event. 2016-05-04 14:49:00 -07:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Neil Fraser
fd7d4a2bef Make scrollCenter public, remove zoomReset. 2016-04-21 04:52:43 -07:00
Neil Fraser
c785cabe40 Use more coordinates. 2016-04-19 23:24:42 -07:00
Katelyn Mann
b69ab459bd Fix bad merge. Commit 36e0764e57 and e39a0b7069 collided on their use/removal of the event param to one of the zoom functions. 2016-04-18 16:53:32 -07:00
Neil Fraser
e08f0aa05b Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	core/workspace_svg.js
2016-04-14 00:25:25 -07:00
Neil Fraser
36e0764e57 Fix zoomToFit if there are no scrollbars. Issue . 2016-04-14 00:23:17 -07:00
Neil Fraser
701d828090 Merge pull request from picklesrus/doubleclick
Add event preventDefault() calls to the end of zoom button handlers s…
2016-04-11 17:47:56 -07:00
Katelyn Mann
e39a0b7069 Add event preventDefault() calls to the end of zoom button handlers so the
browser doesn't try to handle them itself.  This keeps it from selecting text
on double clicks.
2016-04-11 15:33:05 -07:00
Neil Fraser
5e0c04dccd Merge branch 'master' into develop 2016-04-07 14:36:57 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07:00
rachel-fenichel
576830c309 Blockly.parseToolboxTree_ -> Blockly.Options.parseToolboxTree 2016-04-07 13:38:36 -07:00
Neil Fraser
61b3fbfe11 Move block database to workspace. 2016-04-05 18:43:39 -07:00
Neil Fraser
4e42a1b78e Swap order of arguments on domToWorkspace. 2016-04-04 18:31:41 -07:00
rachel-fenichel
e2f1a6c843 Fix annotations 2016-03-29 14:26:56 -07:00
Neil Fraser
ac0b5e7871 Use ENUM for dragMode. Blocks no longer sticky when created from disappearing flyout. 2016-03-29 08:36:11 -07:00
Neil Fraser
92f224dd52 Merge pull request from picklesrus/develop-perf-1
Remove Blockly.removeAllRanges and replace it with calls to add/remove
2016-03-28 12:17:11 -07:00
Katelyn Mann
b11bd4fb71 Remove Blockly.removeAllRanges and replace it with calls to add/remove
css to mark text as unselectable instead.  I can't prove this is
significantly faster with numbers since the call to setup the time out
costs ~.1ms and the call when the timer fires is ~.05.  This happens on almost
every mouse event though.  Plus, it seems to remove a flicker of highlighting when
frames are skipped and keeps scrolling via the scrollbar from highlighting.
2016-03-28 10:06:43 -07:00
Neil Fraser
65a25ffb7e Don't offer to cleanup blocks in non-scrolling workspace. 2016-03-24 21:31:13 -07:00
Neil Fraser
d086634394 Lint and recompile. 2016-03-18 15:19:26 -07:00
Neil Fraser
a7892d1aee Raise error if statement block returns tuple. 2016-03-18 14:17:31 -07:00
Neil Fraser
6ae436a153 Add undo/redo context menu options on workspace. 2016-03-17 14:44:26 -07:00
Neil Fraser
8fb1178ed8 Update message descriptions. 2016-03-14 16:00:25 -07:00
Neil Fraser
06ff90bcaf Merge pull request from picklesrus/bbox-develop
Replace the call to getBBox() in getMainWorkspaceMetrics
2016-03-11 14:24:01 -08:00
rachel-fenichel
f978826f77 Require ConnectionDB where needed; recompile 2016-03-11 12:16:25 -08:00
Neil Fraser
2a1ffa11c4 Add undo/redo. Also refactor connections.
Bugs in undoing mutators and renaming variables.
2016-03-03 17:48:54 -08:00
picklesrus
a67f841671 Replace the call to getBBox() in getMainWorkspaceMetrics
with a manual calculation. getBBox() can cause the browser to
re-layout the whole page and we have much of the information
(e.g. individual block height and width) we need already cached.

Note that getBoundingRectangle's calculation is slightly different
than the one returned by getBBox.  It is off by 3 in the y direction
due to how one of the curves is drawn. This new calculation is
technically more accurate.
2016-02-29 16:29:15 -08:00
Neil Fraser
4d4521bed3 Fix scaled RTL coordinates. 2016-02-25 11:08:59 -08:00
Neil Fraser
f0d04ba16b Fix RTL flyout events. 2016-02-24 16:52:55 -08:00
Neil Fraser
6e6a04b879 Add X/Y coordinates and block ID to create event. 2016-02-16 21:57:22 -08:00
Neil Fraser
0fab13400a Fire function events instead of DOM events. 2016-02-11 21:40:33 -08:00