Commit Graph

143 Commits

Author SHA1 Message Date
Neil Fraser
aca1a43ec8 Fix regular expressions.
1) Simplifications.
2) Enable toolbox category colours to be specified using the full range of CSS formats (not just hue or #rrggbb).
3) Fix bug where `Blockly.utils.checkMessageReferences('%{BKY_today}  %{BKY_xxx}')` returns true.
2019-06-10 11:03:22 -07:00
Neil Fraser
6947010c49 Change Rect to use top/bottom/left/right
Instead of top/left/height/width.  Given our uses of Rect, it makes the math slightly simpler.

This is a setup for using Rect in other places.  Currently it is only used to describe delete areas.
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
f2c57dea1b Remove goog.math.Rect dependency 2019-06-07 10:32:57 -07:00
Neil Fraser
e8d8798ecf Remove goog.events.BrowserFeature dependency. 2019-06-07 10:32:57 -07:00
Neil Fraser
069423e7cd Remove last traces of goog.color. 2019-06-05 16:41:04 -07:00
Neil Fraser
ed9330cf57 Move Blockly.hueToRgb to Blockly.utils.colour
Also adds support for ‘#f00’, ‘rgb(255, 0, 0)’ and ‘red’ for block colours, in addition to ‘#ff0000’ (and of course hue).
2019-06-05 16:41:04 -07:00
Neil Fraser
dce0b77424 Fix 19 warnings in theme-related code. (#2523)
* Fix 19 warnings in theme-related code.

Resolves #2414

* Remove suppressPrefixSuffix property definition

The mixin code throws an error if property exists on both objects.

* eslint has strange ideas about indentation.
2019-05-30 10:05:06 -07:00
Neil Fraser
9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -07:00
Neil Fraser
25bc3e0268 Fix require statements.
Also throw error instead of string.
And stop using goog.asserts.
2019-05-17 15:04:39 -07:00
Neil Fraser
25adb40e66 Prefix and suffix edge cases for flow statements.
Call suffix code on break/continue before executing the break/continue.
Call prefix code for enclosing loop before executing continue.
2019-05-14 17:19:31 -07:00
Beka Westberg
9a9c6612f8 Changed buttons and labels to respect <sep> elements in toolbox. (#2395) 2019-04-22 12:23:04 -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
amber-cd
c2f30d4ca6 Update toolbox.js
Changed style attribute to categorystyle.
2019-03-05 08:39:20 -05: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
Beka Westberg
0f86d6b69c Fixes block input sticking to the screen when navigated away. 2019-02-21 06:57:20 -08:00
alschmiedt
40a1ae752b Adds support for category styles 2019-01-09 11:18:44 -08:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -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
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
dce60fd152 Replace ReferenceError with Error.
Change to 4-space indentation rather than aligning with parent structure.
2018-07-11 12:20:02 -07:00
Neil Fraser
c51cf0b79c Remove goog.dom.removeNode 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
15817e78a1 Fix case where lack of colour attribute results in null. (#1894)
Fixes regression in #1893. Patch on change in #1831.
Verify typeof colour variable before passing through Number().
Missing attributes return null, and Number(null) === 0, resulting in a red hues category color.
2018-05-31 12:31:18 -07:00
Isabelle Taylor
629763e8ff Add warning message for unrecognized toolbox colour value. (PR #1881)
Fixes #1831
2018-05-21 15:44:46 -07:00
Neil Fraser
662d79443f Add 'ordered' option to descendant getting functions. (#1786) 2018-04-17 11:41:03 -07:00
Rachel Fenichel
52e0241f66 Add argsIgnorePattern to the eslintrc 2018-04-06 13:29:22 -07:00
Rachel Fenichel
4c9b602523 Move event classes into separate files, and update requires accordingly 2018-02-27 17:47:33 -08:00
Rachel Fenichel
3e62ffc20a Split at higher level for multiline function calls 2018-01-24 11:26:41 -08:00
Rachel Fenichel
1e3450a051 Indentation lint that blocks moving to eslint 4.0 2018-01-23 17:27:35 -08:00
picklesrus
d1886572d0 Fix #1487 and only add the delete cursor if the block is not deletabl… (#1491)
* Fix #1487 and only add the delete cursor if the block is not deletable. Also add a grab cursor when it is not deletable so the cursor keeps the grab hand when over the toolbox.  This changes the toolbox api slightly, but the methods it touches are @package so it should be okay.
2017-12-04 10:36:47 -08:00
picklesrus
e0f7862547 spacing changes 2017-11-02 14:05:29 -07:00
picklesrus
de8d13eaa1 Fix lint errors so we can eventually run eslint on travis. 2017-11-02 14:05:29 -07:00
Neil Fraser
4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Rachel Fenichel
da6d392878 Allow the toolbox to scroll (#1319)
* Allow the toolbox to scroll

* Switch from onMouseDown to onClick_ for toolbox category taps and clicks.
2017-09-18 12:44:48 -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
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
picklesrus
52f76013b5 Change how blockly handles cursors. The old way was quite slow becau… (#1057)
* Change how blockly handles cursors.  The old way was quite slow because it changed the stylesheet directly.  See issue #981 for more details on implementation and tradeoffs.  This changes makes the following high level changes: deprecate Blockly.Css.setCursor, use built in open and closed hand cursor instead of custom .cur files, add css to draggable objects to set the open and closed hand cursors.
2017-04-21 14:57:54 -07:00
vicng
ae2aaa2159 - Allows use of Blockly's messaging format for category name, colour,… (#1028)
...in toolbox XML.
- Updated code editor demo to use this message format
- Re-built blockly_compressed.js
2017-04-07 15:32:50 -07:00
Rachel Fenichel
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -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
5b86b9792d Don't get Toolbox element unless needed. 2016-12-07 00:22:46 -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
Rachel Fenichel
afca4264ca Add option to style flyout buttons as labels 2016-10-31 15:20:16 -07:00