Commit Graph

303 Commits

Author SHA1 Message Date
Rachel Fenichel
cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
Rachel Fenichel
7a7932acc7 No longer drops mouseUps; fixed lint per neil's comments 2016-08-18 14:46:28 -07:00
Rachel Fenichel
6b7965a727 Ignore everything but the first touch stream 2016-07-20 17:03:24 -07:00
Rodrigo Queiro
d3d0ca4fd0 Record whether the workspace has been dragged (#475)
* Record whether the workspace has been dragged

This fixes #473 by differentiating between a touch on an unmovable block
and using it to drag the workspace.

* Remove isScrolling and add DRAG_BEGIN

Applied after PR review.
2016-07-12 11:34:02 -07:00
Neil Fraser
2dab19c015 Ensure that if a procedure call exists, so does its definition.
Specifically, if a call is copied, then the def is deleted, then the
call is pasted, the def should be created.
2016-07-08 15:50:09 -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
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
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
rachel-fenichel
4de98b9f83 Merge pull request #291 from rachel-fenichel/feature/horizontal_toolbox_port
Horizontal toolbox layout with positioning at start or end.
2016-05-13 16:08:30 -07:00
Rachel Fenichel
71d3023a50 jsdoc 2016-05-12 13:24:08 -07:00
Rachel Fenichel
954b061e4a Merge branch 'develop' into feature/dragged_connection_list 2016-05-12 13:20:16 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -07:00
Neil Fraser
3ecdd2fc61 Merge branch 'master' into develop 2016-05-10 16:50:13 -07:00
Neil Fraser
28c62ce00b Merge pull request #358 from picklesrus/develop-selectable
An alternate (and less expensive) way to keep stuff outside of the bl…
2016-05-09 16:02:17 -07:00
Rodrigo Queiro
005706096f Fix typo in svgResize 2016-05-09 09:13:37 -07:00
rachel-fenichel
f468b6a6cb Merge pull request #357 from rachel-fenichel/feature/field_number_js
Add lightweight field_number
2016-05-05 12:32:01 -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 #296. 2016-05-04 15:00:57 -07:00
Rachel Fenichel
d89d8a2113 Add lightweight field_number 2016-05-04 13:30:18 -07:00
Rachel Fenichel
e596e23012 Position toolbox correctly at bottom 2016-04-27 16:38:22 -07:00
Rachel Fenichel
2591e12a46 Fix janky scrolling in vertical case 2016-04-26 18:16:26 -07:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Neil Fraser
6d58f7959f Don't fire click when editing a field. Issue #336 part 1. 2016-04-19 21:14:49 -07:00
rachel-fenichel
21e999678c correctly position trash can and zoom controls when the flyout is always open; add flyout and toolbox size to main workspace metrics; get rid of flyout's vertical offset. 2016-04-13 15:30:11 -07:00
rachel-fenichel
90b1cce5d5 Correctly locate and size scrollbar for all toolbox positions. 2016-04-13 13:56:09 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07:00
Neil Fraser
effa81f622 Create fromJson for events. Add master-slave demo. 2016-04-06 14:27:15 -07:00
rachel-fenichel
5c8ff88587 Keep a list of connections that are being dragged 2016-04-05 16:13:19 -07:00
Neil Fraser
960b07daab Fix grouping of disconnect and delete. 2016-04-03 15:45:19 -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 #297 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
05fc1ad91b Add workspace.clearUndo 2016-03-25 19:03:18 -07:00
Neil Fraser
d086634394 Lint and recompile. 2016-03-18 15:19:26 -07:00
rachel-fenichel
b37efe829e Move constants to their own file 2016-03-18 14:35:18 -07:00
Neil Fraser
06ff90bcaf Merge pull request #274 from picklesrus/bbox-develop
Replace the call to getBBox() in getMainWorkspaceMetrics
2016-03-11 14:24:01 -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
Rachel Fenichel
9de572283e Refactor: pull rendering code out of block_svg 2016-02-25 13:55:36 -08:00
Neil Fraser
36fe3994c9 Misc cleanup. 2016-01-15 15:36:06 -08:00
Neil Fraser
4b0ed0d372 Add custom event file. 2016-01-12 16:47:18 -08:00
Neil Fraser
4253de041a Remove old realtime. 2016-01-08 13:03:22 -08:00
Neil Fraser
3bce368115 Simplify workspace options by removing svg property. 2016-01-07 17:01:01 -08:00
Neil Fraser
e1acdf5caf Allow RGB colours. 2015-12-13 19:13:05 +01:00
Neil Fraser
96e130d113 Remove old realtime files. 2015-12-02 22:37:55 -08:00
James Tarling
9b438fd88d Fix to Blockly.doCommand to call Blockly.Realtime.isEnabled 2015-12-01 11:01:06 +00:00
Neil Fraser
349146743b Remove dependency on goog.cssom. 2015-09-29 15:40:19 -07:00
Neil Fraser
f23702f2c7 Turn off debugging in compiled mode. 2015-09-21 18:05:34 -07:00
Neil Fraser
317db942d5 Fix jump when blocks are added from top of flyout. Issue 179. 2015-09-21 16:23:33 -07:00