Commit Graph

167 Commits

Author SHA1 Message Date
Andrew n marshall
9cd6b1ec24 Print a warning if JSON color value is invalid. (#1639)
Ignores the invalid color, defaulting to black.
2018-02-21 13:55:32 -08:00
Mark Gibson
54f0e06e21 Customising field types using a register of fields #1584 (#1594)
Implement #1584 - Fields now registered by their JSON type name, allowing new custom fields and overriding of the standard fields. Replaces the manual switch statement for loading fields from JSON block definitions.
2018-02-14 10:14:59 -08:00
Rachel Fenichel
5e0928e4f3 Break circular dependency 2018-02-13 10:44:07 -08:00
Andrew n marshall
dc7783ee01 Warn conflicts with Blockly.Generator.prototype (#1603)
Console warning if block prototypeName conflicts with Blockly.Generator.prototype.
2018-02-12 13:44:54 -08:00
Mark Gibson
2308ae8c22 Remove underscore from fromJson_ 2018-02-07 18:18:35 +00:00
Mark Gibson
d40ef474ae See issue #1486 - adds fromJson_ fn to every Blockly.Field, removing Block.newField*FromJson_ helpers 2018-02-07 12:22:26 +00: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
Rachel Fenichel
cb75946a3c Set indent problems to warnings, and fix all errors. 2018-01-25 12:43:11 -08:00
Rachel Fenichel
7314bdfb3a Fix #1499 and add some validation 2018-01-17 16:54:12 -08:00
Rachel Fenichel
a43b0e7010 Respond to commit comments and make compressed blockly work again 2018-01-10 17:02:02 -08:00
Rachel Fenichel
bd4e4daebb Update comments and use try/catch with setGroup. 2018-01-09 13:31:13 -08:00
Rachel Fenichel
5d6d7519cd Remove some TODOs; add a variable-referencing block to the simple playground flyout 2018-01-08 14:14:26 -08:00
Rachel Fenichel
d69519bdab Fix headless 2017-12-19 16:10:07 -08:00
Rachel Fenichel
6218750207 Fix events for variable fields on new blocks; fix tests 2017-12-19 11:28:23 -08:00
Rachel Fenichel
77a47aee94 Fix html escaping and flyouts opening 2017-12-07 16:08:00 -08:00
Rachel Fenichel
cc6eeb8c68 Clean up TODOs and move potential variable map to the flyout workspace 2017-12-07 10:43:12 -08:00
Rachel Fenichel
38d134aa4f Tests 2017-12-06 15:49:20 -08:00
Rachel Fenichel
1506a36b58 Fix events for variable renaming 2017-12-06 14:41:56 -08:00
Rachel Fenichel
25913884ab Delete by id 2017-11-30 17:21:12 -08:00
Rachel Fenichel
112fcccb31 Fix renaming 2017-11-30 17:12:39 -08:00
Rachel Fenichel
b870c3ccb9 Allow variables of different types to share the same name. 2017-11-30 13:16:16 -08:00
Rachel Fenichel
8c51935025 More lint for unused variables 2017-11-03 14:04:36 -07:00
Neil Fraser
6635dada6d Allow external code to load new audio. (#1409)
If external code can ‘play’, it should be able to ‘load’.  Resolves
compile error in Blockly Games.  Feel free to push back if this API
shouldn’t be public.

Also fix compiler warnings on block defs.  ‘undefined’ means undefined, ‘=‘ means optional.
2017-11-01 17:47:24 -07: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
Isaac Dunn
f8f807f53c Store Block hue so it can be extracted reliably (#1293)
Adds `Block.getHue()` to retrieve the block colour when set via a hue.
The hue value is stored in the new `.hue_` field, which is null if the colour was set via a hex string.
2017-09-04 08:45:33 -07:00
picklesrus
5518873389 Revert "Remove all all instances calling setValue on variable fields with the name instead of the id" (#1296)
* Revert "Create WorkspaceViewport class (#1291)"

This reverts commit 6c00d77c9e.

* Revert "Remove all all instances calling setValue with name. (#1254)"

This reverts commit 8e8b6b27af.
2017-08-28 16:55:44 -07:00
marisaleung
8e8b6b27af Remove all all instances calling setValue with name. (#1254) 2017-08-24 14:34:01 -07:00
marisaleung
733d869f8e Add VariableType checks. 2017-07-20 16:47:37 -07:00
marisaleung
aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -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
Andrew n marshall
8c46d7c798 Improve errors when validating JSON block definitions. (#1086)
goog.asserts to not run from blockly_compressed.js. User data validation should always run.
2017-05-05 11:14:54 -07:00
picklesrus
28572dadac Rebuild blockly_uncompressed to pick up a testing change to make travis happy. Fix a build warning from a multi-line string in the process. (#1059) 2017-04-21 16:20:13 -07:00
marisaleung
21bf339e5d bumpNeighbours_ function moved to block_svg.
Fixed #1009
2017-04-17 15:22:53 -07:00
Rachel Fenichel
f2f522d77a Miscellaneous comment cleanup 2017-04-05 15:52:49 -07:00
Rachel Fenichel
05312c9bf7 Merge pull request #952 from rachel-fenichel/feature/if_else_update
Use mutator extension for controls_if block
2017-02-27 19:56:32 -08:00
Rachel Fenichel
4b0c32e91f Add safety checks for mutators and non-mutator extensions 2017-02-23 15:55:13 -08:00
Andrew n marshall
3db3cf551f Fix #945 (annotations) and an eslint issue (constant condition) 2017-02-22 23:15:39 -08:00
Rachel Fenichel
455432250e Use mutator extension for controls_if block 2017-02-22 17:05:52 -08:00
Andrew n marshall
afd1fdeb15 .utils.replaceMessageReferences(..) now gracefully returns non-string arguments. 2017-02-14 11:00:34 -08:00
Andrew n marshall
750c0300ec Addressing comments. 2017-02-14 11:00:34 -08:00
Andrew n marshall
dc0d3beba3 Moving FieldImage string dereferencing back into Block.interpolate_() (part of jsonInit()). This sets a clear boundary of where dereferencing should happen.
Towards this, I've added message dereferencing for other field types here, as well.  I've used a pattern of field-type specific helper functions.
2017-02-14 11:00:34 -08:00
Andrew n marshall
640fb9c733 Dereference string table references when loading variable fields from JSON. 2017-02-14 11:00:34 -08:00
Andrew n marshall
79becd6b31 Add no-op stub .neighbors() for headless Connection. 2017-02-13 16:28:43 -08:00
Andrew n marshall
24ebbcaad0 Improving errors/warnings with Block.toDevString() and Connection.toString(). (#911) 2017-02-06 14:15:20 -08:00
Andrew n marshall
680fc4b6d3 Porting Logic blocks to JSON (#913)
Extensions, mixins, mutators and constants now grouped under the new namespace Blockly.Constants.Logic.
2017-02-06 13:40:05 -08:00
Rachel Fenichel
e429e0c42f Merge pull request #912 from rachel-fenichel/lint
Fix some lint errors
2017-02-06 12:39:45 -08:00
Andrew n marshall
15827c5d30 Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin(). (#907)
Adds Block.prototype.mixin() and Blockly.Extensions.registerMixin().
This adds support for a common use pattern in extensions, and adds
error checking to avoid future incompatibilities.
2017-02-06 10:00:08 -08:00
Rachel Fenichel
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -08:00
Sean Lip
2c72590a01 Use the empty field placeholder for dropdowns that do not have a value selected. 2017-01-30 16:23:40 -08:00