Commit Graph

79 Commits

Author SHA1 Message Date
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
a9fdf7844a Fix ordering of requires
Search and replace of a name strikes again.
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
5bf7069a2f Remove goog.math.Coordinate 2019-06-07 10:32:57 -07:00
Neil Fraser
e8d8798ecf Remove goog.events.BrowserFeature dependency. 2019-06-07 10:32:57 -07:00
Andrew n marshall
411ec9724e Replacing node.parentNode.removeChild(node)
...with Blockly.utils.removeNode(..), which includes
a null/undefined check on parentNode before continuing.
2018-09-04 13:31:53 -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
c51cf0b79c Remove goog.dom.removeNode 2018-07-11 12:20:02 -07:00
Neil Fraser
51e86263c7 Correct requires for goog.math.* 2018-07-11 12:20:02 -07:00
Neil Fraser
8f7674ea08 Correct requires for goog.events 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
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Rachel Fenichel
870219e750 Get rid of the last indentation lint (that is checked by eslint) and turn indentation back to erroring instead of warning. 2018-01-25 17:33:43 -08:00
Neil Fraser
8cedef49ac Cleanup. 2017-11-07 14:23:41 -08:00
Neil Fraser
4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Rachel Fenichel
62e4730ba5 Add annotations for units to scrollbar.js (#1290)
* Add annotations for units to scrollbar.js

* Update comments
2017-08-24 10:58:16 -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
Rachel Fenichel
55096aeb16 Fix #1051 (#1084) 2017-05-05 09:36:24 -07:00
Rachel Fenichel
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -08:00
Tim Dawborn
39731c6ddc Change CSS transforms to work with older browsers (#879)
* Change the setting of the CSS transform properties on SVG nodes to set both the unprefixed version and the `-webkit-` prefixed version so that Blockly correctly renders in order browsers, such as Safari < 9 and iOS Safari < 9.2. For discussion of this issue, see https://groups.google.com/forum/#!topic/blockly/o3pERaRQhSg

* Correct the separation between the CSS transform property and the rest of the CSS that was in the variable misleadingly called "transform".
2017-01-27 09:19:58 -08:00
Andrew n marshall
10108cc697 jsdoc corrections (#874) 2017-01-26 17:33:55 -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
picklesrus
91938c3fb8 Use the drag surface when scrolling using the scrollbars. #783 (#789) 2017-01-03 10:02:28 -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
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
Neil Fraser
6300faf85e Set main workspace when scrollbar clicked. Issue #704 2016-10-23 20:31:59 -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
1d1321a00d Changes per neil's comments, plus a rebuild 2016-09-21 16:25:44 -07:00
Rachel Fenichel
109e4bb352 Move code to touch.js 2016-09-07 17:42:09 -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
b77c080678 Fix bugs with missing mouseUp events on mutators. Also stop filtering out key presses. 2016-08-25 15:18:53 -07:00
Rachel Fenichel
6b7965a727 Ignore everything but the first touch stream 2016-07-20 17:03:24 -07:00
rachel-fenichel
aca074891d Fix some problems with flyout rendering (#461) 2016-06-27 17:27:08 -07:00
Rachel Fenichel
c4cad3c6e4 Cache screen CTM for performance improvement. 2016-06-17 14:26:04 -07:00
Rachel Fenichel
5532e879eb Check for infinity with == in scrollbar 2016-05-27 10:38:41 -07:00
Rachel Fenichel
8afb04d9ee Move values to prototype and use coordinate. 2016-05-27 10:37:40 -07:00
Rachel Fenichel
06b9bb68e6 Rename knob to handle 2016-05-27 10:25:19 -07:00
Rachel Fenichel
5752913b4d Make some variables private and some functions public. 2016-05-26 15:22:24 -07:00
Rachel Fenichel
f486ac949c use helper functions to set attribute on svg and in model at the same time. 2016-05-25 16:38:19 -07:00
Rachel Fenichel
4562ff8d74 Split scrollbar code into content changes and view changes; store dimensions in variables instead of querying the dom. 2016-05-25 16:20:20 -07:00
Rachel Fenichel
d6d34bf9ce Cache host metrics and make sure something has changed before resizing scrollbars. 2016-05-25 14:09:39 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -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
Rachel Fenichel
de58c07286 Shift scrollbar position slightly 2016-04-25 14:31:47 -07:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Neil Fraser
6c0bf9f966 Routine recompile. 2016-04-21 06:05:25 -07:00
Neil Fraser
f5988e9109 Merge pull request #341 from rachel-fenichel/cleanup/scrollbar
Constrain scrollbar value in set() and decompose resize() into horizo…
2016-04-21 05:10:37 -07:00
Neil Fraser
3df4173039 Fix infinity in hidden scrollbars. Issue #340. 2016-04-20 17:45:40 -07:00
rachel-fenichel
4bc24fe3e1 Constrain scrollbar value in set() and decompose resize() into horizontal and vertical modes. 2016-04-20 11:26:01 -07:00