Commit Graph

75 Commits

Author SHA1 Message Date
picklesrus
e1cd21842a Add a workspace drag surface that blocks and bubble get moved to duri… (#778)
* Add a workspace drag surface that blocks and bubble get moved to during a workspace drag.
The surface is translated using translate3d instead of svg's translate attribute so that
the browser does not have to repaint the entire workspace on every mouse move.
This is very similar to the block drag surface.

* Address code review comments

* add back hasClass_ utility removed in #748 and stop using contains since it is not supported in IE
2016-12-15 11:02:49 -08:00
picklesrus
a82bd49d7e Split the scrollbar and flyout out into their own SVG elements. They (#771)
* Split the scrollbar and flyout out into their own SVG elements. They
are siblings of the workpsace SVG.  This paves the way to make performance
improvements to workspace dragging.
2016-12-09 16:19:19 -08:00
Neil Fraser
4cda20dbbf Fix speling. 2016-11-19 02:40:11 -08:00
Neil Fraser
f6aef459fc API-breaking cleanup. But doubtful anyone will be affected. (#748)
* Make add/removeClass return whether they did anything.
* Move more functions onto utils.
* Move bind functions to Blockly.
* Routine recompile.
2016-11-15 13:54:33 -08:00
picklesrus
7f02c19bfe Improve performance of block dragging. This is a backport of the blo… (#732)
Improve performance of block dragging.  This is a backport of the block drag surface from scratch-blocks.  At the beginning of a block drag, blocks get moved to a drag surface which then translates using translate3d to avoid repainting the entire svg on every mouse move.  At the end of the drag, the blocks are dropped back in the svg in their new position.
2016-11-15 13:19:49 -08:00
Neil Fraser
144be4d49f Block highlighting
* Separate block selection (editing) from highlighting (execution).
* Remove add/removeDragging functions. They clutter the API for no reason.
2016-10-26 18:39:56 -07:00
Rachel Fenichel
ed983333eb bindEventWithChecks_ for internal use, and bindEvent_ with old behaviour but deprecated 2016-09-23 13:46:11 -07:00
Rachel Fenichel
b771d8daf4 Cleanup 2016-09-07 18:14:05 -07:00
Rachel Fenichel
2774cc1663 Fix longpress in flyout; leave debug messages in 2016-09-01 13:08:59 -07:00
Rachel Fenichel
1c025672b3 Clear touch identifier at the ends of more drags. Includes flyout background, right-clicks on blocks, and loading sounds. 2016-08-31 15:56:37 -07:00
Rachel Fenichel
cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
Jean-Michel DECORET
927cabe992 Develop - Modals support (#512)
* * apply bootstrap3 integration fixes

* Injection subcontainer

Include svg and div into a master container, which allow css better
positioning (overflow scrolling problem)

* * Fix toolbox positioning (rtl and ltr). Because toolbox if relative to injection div, only adjust it to left (ltr) or right (rtl) edge

* * fix style (thanks to @NeilFraser)

* * revert msg files
2016-07-30 20:36:35 -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
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
666536807a Add comments; scroll to start for always open flyout 2016-05-13 14:26:32 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -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
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
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Neil Fraser
9f260501fe Remove duplicate getBlockById function. 2016-04-18 03:14:55 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07:00
Neil Fraser
4ac1204550 Set field.sourceBlock in headless Blockly. 2016-04-04 17:47:15 -07:00
rachel-fenichel
be3c761fc0 lint 2016-03-29 15:22:45 -07:00
rachel-fenichel
e2f1a6c843 Fix annotations 2016-03-29 14:26:56 -07:00
rachel-fenichel
0686762a12 Move options to their own file; clean up initialization code. 2016-03-29 14:15:29 -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
5097963cb1 Reduce code duplication in 'if' block. 2016-03-01 18:21:02 -08:00
Neil Fraser
fee94ae405 Allow injection based on CSS selector (based on PR 249). 2016-02-29 15:11:00 -08:00
Neil Fraser
e6db687234 Fix startScale on workspaces without a fixed flyout. 2016-02-24 19:27:03 -08:00
Neil Fraser
dc1f03a168 Merge pull request #231 from carlosperate/toolbox_nodes
Allow XML DOM nodes to be injected as toolbox in IE
2016-01-08 15:13:47 -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
carlosperate
bda78da155 Allow nodes input to toolbox injection in IE 2016-01-05 00:56:57 +00:00
Neil Fraser
00ba0acf40 Clean up build file from previous PR. 2015-11-13 21:11:24 -08:00
Neil Fraser
a485e63df2 Allow zooming of non-scrolling workspaces. 2015-10-21 14:38:39 -07:00
Neil Fraser
dcd463b550 Add 'startScale' and remove 'enabled' options on zoom. 2015-10-21 13:25:02 -07:00
Neil Fraser
8ecfab014f Separate overlapping emboss filter and disabled pattern across multiple Blockly instances. Issue 184. 2015-09-28 12:20:28 -07:00
Neil Fraser
37777828f4 Fix disconnect sound in FF. 2015-09-22 11:14:25 -07:00
Neil Fraser
c14951c928 Add disconnect sound and animation. 2015-09-20 14:28:39 -07:00
Neil Fraser
5b7fec7092 Add zooming feature.
By carloslfu.
2015-08-19 17:21:05 -07:00
Neil Fraser
09f5ac6f7b Remove non-functioning workspace long-click. 2015-07-13 17:48:50 -07:00
Neil Fraser
e0f90e6e33 Adding more type documentation. 2015-07-13 15:03:22 -07:00
Neil Fraser
d819db2acf Lint corrections. 2015-07-02 19:41:10 -07:00
Neil Fraser
edd3e3bf33 Lint corrections. 2015-06-17 13:05:24 -07:00
Neil Fraser
c5b88b1116 Kill SVG when disposing main workspace. 2015-05-02 21:08:18 -07:00
Neil Fraser
d83f5872c6 Don't allow snapping to grid with 0 spacing. 2015-04-30 17:59:56 -07:00
Neil Fraser
3ff69d47fe Inject can now take an ID. Also, fix unit tests. 2015-04-29 20:26:04 -07:00
Neil Fraser
ede636361d Simplify workspace resizing. 2015-04-28 17:55:45 -07:00
Neil Fraser
c014799df8 Fix black workspace background in IE11. 2015-04-28 15:06:22 -07:00