Commit Graph

241 Commits

Author SHA1 Message Date
Neil Fraser
7653785ae6 Add missing require for utils.colour
Pushed without review since it’s activily breaking users (bug report filed from Blockly Games).
2019-09-21 08:40:56 -07:00
Beka Westberg
9e5df6216a Fixed comment ownership. (#2923)
* Moved comment icons to use a model-based system. The block holds the model of the comment, and the comment icon holds a reference to it.
* Reorganized the setVisible function.
* Changed how xml.js serializes and deserializes comments.
2019-09-20 13:16:07 -07:00
Neil Fraser
a1e3973499 Make block comments an optional module. (#3053)
Measured as a 5 KB *increase* in code size, but that's because some other commit just landed between my tests. It's like running down an up escalator.
2019-09-19 14:53:28 -07:00
Neil Fraser
84a814cda1 Make mutator an optional module. (#3048) 2019-09-19 11:39:55 -07:00
Sam El-Husseini
8fae0411f7 Check if a type exists before testing instanceof (#3031)
* Check if a type exists before instance of
2019-09-17 16:28:18 -07:00
Neil Fraser
5650fe51a2 Typos. 2019-09-12 18:24:48 -07:00
Neil Fraser
e43e19d19a Remove three functions deprecated in 2015
We’ve had four years of console warnings, and this next release is known to be breaking.  Each is trivial to fix in code.
2019-09-12 18:04:45 -07:00
Sam El-Husseini
8ab51c8639 Remove closure base file dependency (#2976)
* Trim down closure's base dependency even further by removing the dependency on closure's base file.
2019-09-11 17:30:51 -07:00
alschmiedt
7bba4fa59c Moves the cursor to correct location when block is deleted (#2887)
* Moves the cursor to correct location when block is deleted

* Moves cursor on block mutation
2019-08-21 16:33:16 -07:00
Beka Westberg
0872d022e1 Changed utils.fields -> fieldRegistry. Also removed useless tooltip requires. 2019-08-16 09:57:28 -07:00
Beka Westberg
cdc90f4059 Refactored field utilities. 2019-08-16 09:57:27 -07:00
Sam El-Husseini
174fe53516 Minor jsdoc issue (#2826)
The JavaScript closure compiler barfs at this. No such thing as JSDOC @throw.
2019-08-14 14:40:54 -07:00
Beka Westberg
654467e9ac Added disposed = false properties to fields, connections, and blocks. Changed applicable unit tests from isNotOk -> isFalse. 2019-08-07 07:17:41 -07:00
Beka Westberg
6f03634730 Moved disposed into finally block. 2019-08-07 07:11:17 -07:00
Beka Westberg
057cee51f8 Added disposed property to blocks (for use in unit tests). 2019-08-07 07:07:30 -07:00
Beka Westberg
8921fa96a9 Removed redundant connection disposal code from block. 2019-08-07 07:07:30 -07:00
Neil Fraser
45e5fb4157 More JSDoc and lint corrections 2019-07-30 17:00:40 -07:00
Neil Fraser
6aedfab4d1 Misc JSDoc fixes. (#2747) 2019-07-30 16:28:48 -07:00
Beka Westberg
3d813803ca updateVariableName -> refreshVariableName 2019-07-26 12:55:43 -07:00
Beka Westberg
20837da54f Deprecated field setText function. 2019-07-19 08:57:34 -07:00
Beka Westberg
f873ddb1c6 Added Field Tooltip Support to the JSON (#2657)
* Added support for setting a field's tooltip via JSON.

* Added a test block to the playground.
2019-07-18 12:21:37 -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
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
Beka Westberg
247aafae7e Added updateColour to field. 2019-04-29 16:53:59 -07:00
Jim Jiang
1b10d134a5 Add Block.setEnabled (#2386)
* Implement Block.setEnabled()

From issue #1593. This commit:
- add setEnabled
- deprecate setDisabled

* Update setDisabled calls to setEnabled

Add setEnabled and deprecate setDisabled in
- core/block_svg

Update calls in
- blocks/loops
- blocks/procedures
- core/block_events
- core/events
- core/flyout_base
- core/xml
- tests/workplace_svg/procedure_svg_test

* Implement changes from comments from RoboErikG

- Implement isEnabled()
- Make this.disabled @private
- Make setDisabled(disabled) call setEnabled(!disabled)
- Update setEnabled to use isEnabled()

* Utilize isEnabled() and fix typos

Fix missing parentheses
Implement isEnabled() more widely
Fix lint and parentheses errors

* Change prevDisabledState to prevEnabledState
2019-04-23 08:49:07 -07:00
alschmiedt
1034ba835c Adds check for a targetConnection 2019-04-02 14:42:41 -07:00
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Neil Fraser
405b1e4e78 Lint issues found while debugging. 2019-03-27 15:47:29 -07:00
Andrew n marshall
f05eed64eb Check against healing child shadow blocks.
Fixes #2227, healing values.
Also applies to shadow next blocks.
Added a playground test block group with a shadow statement.
2019-02-07 13:15:41 -08:00
alschmiedt
58c365e377 Changes colour names 2019-02-06 14:24:41 -08:00
alschmiedt
d747bb080a Access colours using bracket notation 2019-01-19 11:53:09 -08:00
alschmiedt
af35702f3e Final fixes 2019-01-10 12:04:47 -08:00
alschmiedt
9bfb30bcf2 Fixing review comments 2019-01-10 09:13:02 -08:00
alschmiedt
caf664db04 Small fixes 2019-01-09 15:38:30 -08:00
alschmiedt
55a46f8299 Fixes error thrown for style defined inline 2019-01-09 13:44:22 -08:00
alschmiedt
bac9a16da0 Adds hat style 2019-01-08 15:13:00 -08:00
alschmiedt
f480b1ff79 Changes Blockly style to be Blockly theme. 2019-01-08 11:40:57 -08:00
alschmiedt
1f742bf83d Fixing review comments 2019-01-07 10:38:49 -08:00
alschmiedt
1b3955d9d6 Fixing review comments 2018-12-21 07:52:50 -08:00
alschmiedt
ebe8492d3d Add error message for when style is not set 2018-12-20 09:04:45 -08:00
alschmiedt
9afe497b7e Fixes jsdocs 2018-12-19 08:45:20 -08:00
alschmiedt
b9efa72161 Small cleanup 2018-12-18 14:05:44 -08:00
alschmiedt
2481274406 Small cleanup 2018-12-18 13:36:23 -08:00
alschmiedt
be78838335 Allows user to define style name using variables in json 2018-12-18 10:50:49 -08:00
alschmiedt
4918da9538 Adds ability to provide a hue value for primary colour 2018-12-12 11:39:23 -08:00