Commit Graph

62 Commits

Author SHA1 Message Date
Aaron Dodson ede7e8c18d chore: Remove declareLegacyNamespace() from field_* files 2021-09-23 14:29:56 -07:00
Monica Kozbial bec82da358 Remove require destructuring (#5294) 2021-08-03 15:07:14 -07:00
kozbial e997330085 Fix require order in core/field_label.js 2021-07-23 18:32:59 -07:00
kozbial 0889defe55 clang-format core/field_label.js 2021-07-23 18:32:59 -07:00
kozbial 4945825d6e Migrate core/field_label.js named requires 2021-07-23 18:32:59 -07:00
kozbial a765a3016e Migrate core/field_label.js to goog.module 2021-07-23 18:32:59 -07:00
kozbial 78fee48459 Migrate core/field_label.js to ES6 const/let 2021-07-23 18:32:59 -07:00
Neil Fraser cba7a68207 Allow inheriting of fromJson in fields 2021-07-11 23:19:01 -07:00
Neil Fraser dd0314bc0b Normalize comments 2021-05-19 09:57:14 -07:00
Sam El-Husseini 63d26dc186 Add extra requires check (#4677)
* Add extra requires check
2021-03-05 09:50:51 -08:00
Monica Kozbial 4ac4332f5e Update logic for field default values. (#3953)
* Update logic for field default values.

* Fix bugs

* Use contant for default value.

* Fix FieldColour

* Update field number tests.

* Update field angle test.

* Minor update.

* Update field checkbox test.

* Undo enabling logging

* Remove only.

* Update field colour test.

* Update invalid test cases for field colour

* Update field label tests

* Update field textinput test.

* Minor cleanup

* Make lint happy.
2020-06-12 15:18:28 -07:00
Neil Fraser 4e2f8e6e02 Use SPDX licences.
This is a followup to #3127.
At the time, SPDX licenses were pending approval by Google.
2020-02-11 13:27:20 -08:00
Sam El-Husseini 2dea7038d5 Moves field layout constants into the renderer (#3437)
* Add field constants into renderer constants
2019-11-13 16:41:35 -08:00
Sam El-Husseini d0772ad496 Fix compiler warnings related to fields. (#3144)
* Fix compiler warnings related to fields.
2019-10-03 15:58:46 -07:00
Neil Fraser b46a4fe286 Bring our license format up to date (#3127)
* Google changed from an Inc to an LLC.

This happened back in 2017 but we didn’t notice.  Officially we should update files from Inc to LLC when they are changed as part of regular edits, but this is a nightmare to remember for the next decade.

* Remove project description/titles from licenses

This is no longer part of Google’s header requirements.  Our existing descriptions were useless (“Visual Blocks Editor”) or grossly obselete (“Visual Blocks Language”).

* License no longer requires URL.

* Fix license regexps.
2019-10-02 14:46:56 -07:00
Sam El-Husseini a57c7ffb13 Clean up fields by passing the right type in fromJson (#3095) 2019-09-26 12:03:17 -07:00
Beka Westberg 92eea22628 Label Field Config (#2984)
* Added label field configuration.
2019-09-16 16:53:06 -07:00
Sam El-Husseini f3f3329355 Fix configure method (#2915)
* Fix configure method.
2019-09-12 17:01:03 -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
Neil Fraser 096959fde9 Cleanup of last fortnight’s commits. (#2865)
No functional changes.
2019-08-19 14:07:48 -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
Rachel Fenichel 3802a0c960 Remove getCorrectedSize for fields 2019-08-05 16:01:50 -07:00
Neil Fraser 45e5fb4157 More JSDoc and lint corrections 2019-07-30 17:00:40 -07:00
Sam El-Husseini 57868e7e83 Remove all calls to goog.math (#2739)
* Replace calls to goog.math.Size and goog.math.Coordinate with Blockly equivelants
2019-07-30 11:22:08 -07:00
Rachel Fenichel fc4372dbc2 Add TODOs with github issue number 2019-07-22 16:29:44 -07:00
Rachel Fenichel f469a388ed Add getCorrectedSize functions to fields 2019-07-17 11:00:20 -07:00
Beka Westberg 0122f36450 Fixed field disposal, and reorganized editor creation. 2019-06-11 13:30:50 -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
Beka Westberg f0d6fbd192 Reorganized field view initialization. 2019-05-31 10:38:18 -07:00
Beka Westberg f16c9c0beb Refactored field validation. 2019-05-24 14:23:42 -07:00
Beka Westberg acd96aa2c5 Added Field Value Tests (#2459)
* Added field value tests.

* Fixed field image src param.

* Fixed falsy values with label fields.

* Fixed falsy values with text input fields.

* Fixed some angle field tests.

* Fixed other text input when editing tests.

* Fixed colour tests.

* Cleaned up some number and variable field tests.

* Added angle field > 360 degrees tests.

* Fixed variable validator tests.

* Split setValue tests into sub-suites.

* Fixed angle >360 tests

* Changed var declarations to property declarations.
2019-05-17 15:19:14 -07:00
Beka Westberg 354d402c49 Refactored field.init into field.initView and field.initModel 2019-05-03 07:12:46 -07:00
Beka Westberg e8573bc0db Added isSerializable function and SERIALIZABLE property to fields. 2019-04-21 08:28:37 -07:00
Beka Westberg 0617cc7fea Added isDirty_ property to fields. 2019-04-15 16:37:11 -07:00
Neil Fraser e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Rachel Fenichel 3aa0cac22b Fix setting tooltips in init 2018-10-17 13:27:32 -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 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
Rachel Fenichel 615c403b44 Use @nocompress annotation to fix advanced compilation. 2018-03-01 12:35:55 -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
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
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 01ab0b4ab6 Add arrow to images in dropdown menus. Fold updateTextNode_ into render_. 2016-11-06 21:19:07 -08:00
Neil Fraser 4ac1204550 Set field.sourceBlock in headless Blockly. 2016-04-04 17:47:15 -07:00
Neil Fraser c429949a4e Add Create, Delete, and Change events.
Not counting change for mutators.
2016-01-20 19:11:03 -08:00
Neil Fraser 3f8e586fe8 Use prototypes for primitive properties. 2015-09-12 19:31:22 -07:00
Neil Fraser db940ca493 Fix reversed height and width on image fields. 2015-09-07 18:52:07 -07:00