Commit Graph

207 Commits

Author SHA1 Message Date
RoboErikG
0142aa0e94 Don't require flyouts to run Blockly (#1502)
* Don't require flyouts to run Blockly

There was a bug with Dynamic Variables that made them required for Blockly
to run. This adds checks so that the flyouts only get registered if they're
included. Also does a rebuild of core to pick up the fix.

* Also fix dependencies so dynamic vars don't get stripped
2017-12-08 14:18:09 -08:00
Tianwei Du
492462e1d4 Develop (#1481)
* variables_dynamic

* make test , and i18n

* Issue #1470

* Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_MUTATION
to make sure setCheck before event trigger

* Update built files from develop.

* fix copyright ,quotes , comments ,  and optimize some flow.

* quotes,change UI , change category custom name

* single setter , remove mutator , colour typo , typed variables create button message

* undo the indent edits.
2017-12-08 08:53:24 -08:00
Rachel Fenichel
662757ab7d Switch to parentNode for IE 2017-11-20 16:50:21 -08:00
Neil Fraser
5707657569 Stop blocks from exploding.
Uncompiled a goog.math.Coordinate toStrings as a nice “(1, 2)”, but
complied it toStrings as a useless “[object Object]”.  Fixes #1448.
2017-11-14 15:44:09 -08:00
Neil Fraser
8cedef49ac Cleanup. 2017-11-07 14:23:41 -08:00
Neil Fraser
2445a752b7 Resolve another 20 warnings. 2017-10-24 14:06:29 -07:00
Neil Fraser
4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
picklesrus
b3ba25ab5c Disable workspace resizing at the beginning of cleanup blocks and re-enable at the end. (#1331) 2017-09-21 16:20:17 -07:00
Sam El-Husseini
9c0de1ae8d Avoid IE and Edge re-rendering (#1326)
* Fix wrong width of field_dropdown with an image on Edge / IE

* Avoid re-rendering on IE and Edge by using getBBox().width to compute the text width on those browsers
2017-09-19 15:04:25 -07:00
Rachel Fenichel
6c00d77c9e Create WorkspaceViewport class (#1291)
* Create WorkspaceViewport class

* Update comments

* Move workspace viewport functions back to the workspace for now

* whitespace
2017-08-24 15:51:31 -07:00
marisaleung
5f21a43caf Fix type tags and todo placement. 2017-08-03 12:35:14 -07:00
Neil Fraser
fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
Rachel Fenichel
d2f7d5a71a Use the same math for dragging blocks out of horizontal and vertical flyouts. (#1215)
* Use the same math for dragging blocks out of horizontal and vertical flyouts.

* Update flyout_base.js
2017-07-19 11:30:08 -07:00
marisaleung
912712cbf5 Merge pull request #1180 from marisaleung/develop_removeTodos
Remove out of date todo comments.
2017-06-20 15:08:59 -07:00
marisaleung
d937920afc Remove out of date todo comments. 2017-06-20 13:15:28 -07:00
marisaleung
7b664d90e9 Followup RefreshToolbox. 2017-06-20 10:40:20 -07:00
marisaleung
803681efa1 createVariable in workspaceSvg takes in id and type. 2017-06-19 17:06:07 -07:00
marisaleung
aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00
Rachel Fenichel
2d532225d3 Split flyout into flyout_base, flyout_horizontal, and flyou_vertical
* Rename flyout to flyout_base

* flyout_base minus horizontal and vertical code

* Add flyout_vertical and flyout_horizontal

* review fixes + toolbox and workspace use

* Fix hat block case

* rebuild uncompressed

* Fix travis problem

* Fix build problem
2017-06-08 13:36:11 -07:00
Rachel Fenichel
c0b906f4b6 Create grid object (#1131)
* Create grid object

* Doc

* Units!  Thanks @RoboErikG
2017-05-24 16:14:24 -07:00
Rachel Fenichel
620a210106 Move audio code to a new file (#1122)
* move audio code to a new file

* dispose

* null check
2017-05-22 16:58:31 -07:00
marisaleung
8d5edb3e55 Merge pull request #1096 from marisaleung/develop
Assign variable UUID to field_variable dropdown.
2017-05-15 10:56:56 -07:00
marisaleung
6492f2988a Assign variable UUID to field_variable dropdown. 2017-05-15 10:43:53 -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
marisaleung
f19b2c87aa Renames Blockly.workspaceDragSurface to Blockly.WorkspaceDragSurface.
Fixes #880.
2017-04-11 14:01:25 -07:00
picklesrus
847d83e4af Another attempt to fix #904 to keep the page from jumping to the focused workspace in IE 11 (#974) 2017-03-10 14:58:09 -08:00
picklesrus
9b98573327 Cross browser friendly fix for #904. This calls blur and focus from … (#972)
* Cross browser friendly fix for #904.  This calls blur and focus from workspace.markFocused and removes the event listener on focus events.  markFocused is called from all of our mouse down handlers, which triggers the focus event leading to an infinite loop of focus.  As far as I can tell, there are no uses of the focus handler that actually did anything for us.
2017-03-08 14:27:53 -08:00
picklesrus
63c899e4e1 Potential fix for #888. Stops checking whether we are mid workspace drag since we do not always get mosue up events when blockly is in an iframe. (#899) 2017-03-06 16:19:29 -08:00
picklesrus
ab042d4dd8 Fix bug #904 by explicitly grabbing focus on the workspace svg element. (#964) 2017-03-03 16:15:02 -08:00
Rachel Fenichel
1a8383180e Workspace isDraggable 2017-02-08 12:31:52 -08:00
Rachel Fenichel
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -08:00
Rachel Fenichel
0062658cfa Add some safety 2017-01-25 14:49:46 -08:00
Rachel Fenichel
4872a6ad7f Enable custom flyout categories. 2017-01-23 17:21:48 -08:00
picklesrus
8aa8b1b3ba Add ability to add a class to a scrollbar so that different types of … (#837)
* Add ability to add a class to a scrollbar so that different types of scrollbars can
be distinguished from each other. You used to be able to do this by looking at the parent
element but now all the scrollbars are siblings in the dom.

Also, use this new class to fix #816 so that layering of the flyout and workspace scrollbars
are done correctly.
2017-01-18 13:02:08 -08:00
Neil Fraser
59f408592a Replace 'const' with 'var'.
This unbreaks IE10 and advanced compiled apps such as Blockly Games.
2017-01-16 20:35:28 -08:00
Rachel Fenichel
a0e6d4bbb5 Don't connect to blocks under the flyout. 2017-01-05 16:06:15 -08:00
picklesrus
eb64921da5 Fix #794 and make the workspace grid drag along with the workspace. (#801)
There was some IE specific code that also applies to Edge so just updated
a conditional to include Edge.
2017-01-03 14:36:31 -08:00
picklesrus
91938c3fb8 Use the drag surface when scrolling using the scrollbars. #783 (#789) 2017-01-03 10:02:28 -08:00
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
Rodrigo Queiro
8384f8fe05 Make zoom speed independent of event granularity
Before, touchpads would give "smoother" scrolling by delivering lots of
mousewheel events with small distance changes. Because the code only
looked at the sign of deltaY, ten 5px scrolls would zoom 10x more than
one 50px scroll.

This change makes zooming with a touchpad more like zooming with a
mousewheel. On my laptop, a full-scale zoom (fully out to fully in) was
about a 5mm finger movement before, and is now about 3cm.

Fixes #758.
2016-12-09 11:12:28 +01:00
Rachel Fenichel
086fd720b2 Associate flyout button callbacks directly with workspaces 2016-12-08 13:05:19 -08:00
Neil Fraser
97644fdf04 Improve comments. 2016-12-03 06:34:18 -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
Rachel Fenichel
b5822e2925 Revert "Revert "Rebuild nov 3 16""
This reverts commit c8ca24a000.
2016-11-11 17:05:13 -08:00
Neil Fraser
c8ca24a000 Revert "Rebuild nov 3 16" 2016-11-08 16:46:00 -08:00
Rachel Fenichel
da5c7bcd2a Fix workspace factory bug and rebuild 2016-11-08 16:44:16 -08:00
Rachel Fenichel
80e9a5663c Fix bug with longpress and touch on ios 2016-11-08 16:18:05 -08:00