Commit Graph

134 Commits

Author SHA1 Message Date
alschmiedt
74fa3bb71a Initial commit for changing key mappings (#2787)
* Added ability to easily change key mappings
2019-08-13 13:37:01 -07:00
Beka Westberg
37efbd0559 Fixed jitter when bumping blocks if objects were too large for the workspace. (#2778) 2019-08-12 09:11:27 -07:00
alschmiedt
6dc9a07810 Integrates cursor into develop (#2710)
* Integrates cursor into blockly

* Fix review comments

* Add dispose to cursor

* Fixes dispose functionality

* Remove unnecessary dispose method
2019-07-25 11:14:40 -07:00
Neil Fraser
0213de11bc Use Rect in more places. 2019-06-07 10:32:57 -07:00
Neil Fraser
98a98bcce6 Add Blockly.utils.dom.XLINK_NS
And fix provide/require mixup.
2019-06-07 10:32:57 -07:00
Neil Fraser
848d3a3509 Move setCssTransform & createSvgElement to dom.
Also move SVG_NS and HTML_NS properties.
2019-06-07 10:32:57 -07:00
Neil Fraser
775ce34eac Simplify workspace.getBlocksBoundingBox
Previously it returned x,y,width,height.  Returning top,bottom,left,right results in simpler code, both in this function and in downstream callers.

This commit makes the minumum change to the metrics_test.  I’m happy to change the test’s data if that makes more sense.
2019-06-07 10:32:57 -07:00
Neil Fraser
02e9b25f03 Flaten bounding box data structure.
Old: a box object with two coordinate objects, each with two numbers.
New: a box object with four numbers.

The old system would make sense if there was a reason to group the top-left and bottom-right coordinates.  But in our code we only pulled out top/bottom/left/right numbers.

New code is simpler and faster.
2019-06-07 10:32:57 -07:00
Neil Fraser
3dfac9a2ba Alphabetize require statements.
Search and replace for userAgent didn’t take into account alphabetic ordering.
Also some line wraping.
2019-06-07 10:32:57 -07:00
Neil Fraser
566f182fa8 Move Blockly.userAgent to Blockly.utils.userAgent 2019-06-07 10:32:57 -07:00
Neil Fraser
d1a29739d8 Move utilities into own directory.
TODO: There are more functions which may be migrated into dom and string.
2019-06-07 10:32:57 -07:00
Neil Fraser
5c614d73c1 Add tests for XY regexs. 2019-05-24 15:45:05 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
RoboErikG
2386038138 Fix bug with in bounds bumping (#2467)
Traced one cause of Mocha tests sometimes failing to blocks being
bumped back into bounds. It looks like a block being moved to be
a child of another block was ended up out of bounds probably
because the size of the workspace isn't set yet. When the change
handler tried to move it back in it would throw an error since you
can't move child blocks with that method.
2019-05-17 17:57:53 -07:00
Neil Fraser
28ad3a9bd3 Blockly.utils.userAgent moved to Blockly.userAgent 2019-05-10 16:56:26 -07:00
Neil Fraser
4062030731 Remove goog.userAgent dependency. 2019-05-10 14:03:21 -07:00
alschmiedt
be4da5feeb Reverts hideChaff fix 2019-04-11 11:43:37 -07:00
alschmiedt
db7a87555f Hides chaff on document mouseup 2019-04-04 11:24:22 -07:00
Neil Fraser
51bfa9455d More comprehensive approach to gesture detection.
Search all workspaces.  The flaw with looking at the workspace of the selected block is that dragging a workspace is a gesture but has no selected block.
2019-03-29 15:24:37 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
alschmiedt
715fdde945 Reverts changes to fix bug with selecting dropdown 2019-03-12 10:39:09 -07:00
Rachel Fenichel
47fff5cddb Merge pull request #2313 from rachel-fenichel/feature/dropdowndiv
Add dropdowndiv and use it for the colour picker and angle fields
2019-03-01 12:54:39 -08:00
Rachel Fenichel
fd8865bda6 Merge pull request #2311 from BeksOmega/fixes/AbsoluteMetrics
Changed Absolute Metrics to Avoid Simple Toolboxes
2019-03-01 11:01:50 -08:00
Rachel Fenichel
c43988873e Don't try to bump if the object has already been deleted. 2019-02-28 17:32:55 -08:00
Beka Westberg
d0559a5eeb Fixed scroll event binding to work with multiple workspaces. 2019-02-28 15:43:52 -08:00
Beka Westberg
a0aa84d861 Changed absolute metrics to avoid simple toolboxes. 2019-02-23 14:34:26 -08:00
Beka Westberg
7e3bff2552 Readded the toolbox click subscriber. Added preventing propagation to the toolbox click subscriber. Added clearing touch identifier to the document click subscriber. 2019-02-21 14:57:19 -08:00
Rachel Fenichel
91408a3238 Add dropdowndiv file 2019-02-21 13:41:45 -08:00
Beka Westberg
0f86d6b69c Fixes block input sticking to the screen when navigated away. 2019-02-21 06:57:20 -08:00
Beka Westberg
9dec2da5c5 Movement Updates (#2247)
This is a squash and merge of a large set of changes by @BeksOmega 

* Added functionality to scrolling, dragging, and zooming.

* Fixed incorrect changes to workspaceChanged function.

* Fixed comment.

* Fixed typo.

* Removed scrollbar.set calls from workspace_svg.

* Removed scrollbar.resize() call.

* Added move options to playground.

* Fixed scroll_ calls that replaced scrollbar.set calls.

* Removed this.scrollbar checks.

* Changed zoom so that it always zooms towards the coordinates. Changed isContentBounded_ to be separate from isMovable_ (b/c of the previous change zoomControls had to be added to the bounded check). Fixed scroll_() calls... again.

* Changed procedures so the Highlight definition option is only available if the workspace is moveable.

* Fixed scrollCenter so that it works with flyout toolboxes.

* Fixed zoomToFit so that it works with horizontal flyout toolboxes.

* Fixed Typo.

* Fixed bumping blocks when the workspace is not movable.

* Fixed bumping not working with left and top toolbox positions.

* Re-Added not allowing scrollCenter if the workspace is not movable. Disabled scrollCenter button for this case.

* Cleaned up formatting.

* Fixed bumping... again. Reformatted workspaceChanged a bit.

* Changed blocks to be completely bumped into the workspace.

* Reorganized metrics-getting for workspaceChanged.

* Added bumping workspace comments. Moved event checking.

* Renamed workspaceChanged to bumpObjects.

* Added a bumpObjects developer reminder.

* Added warning to zoomToFit.

* Cleaned up some text.

* Added better inline documentation.

* Fixed up inline docs.

* Cleaned up comments.

* Fixed zoomCenter not actually zooming towards the center.

* Fixed zoomControls error on unmovable bottom-toolbox workspaces

* Fixed programatically placing blocks in an unmovable workspace.

* Removed unnecessary translate call in inject.

* Reversed removal of translate. (apparently it was necessary)

* Cleaned up code in response to first round of reviews.

* Added unit comments to the zoom function.

* Removed bumpObjectsEventChecker. Added BUMP_EVENTS list to Blockly.Events.

* Changed getWorkspaceObjectMetrics call to getBoundingRectangle().

* Fixed utils.mouseToSvg (was causing problems with zoom on wheel if the page was scrolled).

* Fixed zoom when page is scrolled (actually this time). Reverted changes to utils.mouseToSvg.

* Fixed centerOnBlock.

* Added unit docs to translate. Moved setting the grid position to the translate function.

* Added TODO's.
2019-02-18 15:28:51 -08:00
alschmiedt
e7a120e69f Merge branch 'develop' of https://github.com/alschmiedt/blockly into blockly_colours 2019-01-08 13:36:39 -08:00
alschmiedt
f480b1ff79 Changes Blockly style to be Blockly theme. 2019-01-08 11:40:57 -08:00
alschmiedt
bfc55ada27 Fixes refresh on simple toolbox withno categories 2019-01-03 12:56:19 -08:00
alschmiedt
1b3955d9d6 Fixing review comments 2018-12-21 07:52:50 -08:00
Beka Westberg
9ee7319ac5 Trashcan/Zoom Anchored to Top when Toolbox is on Bottom. 2018-12-19 10:26:07 -08:00
Rachel Fenichel
261a067a31 Merge pull request #2157 from BeksOmega/feature/TrashcanContents
Added flyout to trashcan to "get back" deleted blocks.`
2018-12-17 15:23:17 -08:00
RoboErikG
e49d07dd16 Propagate the event group when enforcing bounds on blocks (#2163)
Fixes #1653

Makes the bounds checker created in inject correctly set the event group
before moving blocks in bounds.

When a workspace can't scroll the inject method sets up an event listener
to bump blocks back into the visible bounds when dropped off the edge. The
event group wasn't being used, though, causing the move to be a separate
undo step. When undone, this would get you stuck in a loop where the
workspace would keep pulling it back into the visible range.
2018-12-12 13:03:25 -08:00
Beka Westberg
5f2d5df321 Fixed nits. Changed contents to store XML. Added removing IDs from all descendants. Removed deleteNext. 2018-12-11 16:46:24 -08:00
Beka Westberg
15b34f7e73 Added flyout to trashcan to "get back" deleted blocks.` 2018-12-07 10:44:24 -08:00
Neil Fraser
db0dbc69ee Update todos and requires. 2018-10-16 11:34:10 -07:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Neil Fraser
c6afb08c4b Add unit tests and code cleanup to utils (#1993)
* Add unit tests for new util functions
* Utils functions shouldn’t be package, not private.
* Use existing utility function for insertAfter
2018-08-03 14:31:50 -07:00
Neil Fraser
6ce31942e0 Some goog.dom removal (#1991) 2018-08-01 15:47:28 -07:00
Neil Fraser
ac2fa96d7f Replace goog.dom.createDom for creating HTML 2018-07-11 12:20:02 -07:00
Neil Fraser
284b79407e Require Blockly.utils where needed. 2018-07-11 12:20:02 -07:00
Neil Fraser
eea2794e38 Remove goog.dom.TagName 2018-07-11 12:20:02 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Andrew n marshall
e9d8e00a55 Making all blocks use the MSG colour values. (#1749)
* Making all blocks use the MSG colour values.
 * Deprecating Blockly.Constants.Lists.HUE and similar constants.
 * Removing deprecated Blockly.Blocks.lists.HUE constants.
 * Allowing message references in the Block.setColour() parameter.
 * Adding checking of older constants, ensuring they are not overwritten.
2018-04-09 17:37:47 -07:00
Rachel Fenichel
3575d53018 57 errors remaining 2018-01-23 18:42:45 -08:00
Neil Fraser
8cedef49ac Cleanup. 2017-11-07 14:23:41 -08:00