Commit Graph

104 Commits

Author SHA1 Message Date
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 e1e746b845 Fixed how fields handle size. 2019-05-31 07:32:43 -07:00
Neil Fraser 9f528922a7 Fix some dependencies 2019-05-24 15:45:05 -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
Neil Fraser e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
Beka Westberg 969687ec34 Added flipRtl Support for FieldImages (#2203)
* Added flipRtl support for FieldImages. Added a flipRtl test block.

* Added blockfactory support.

* Fixed JSDoc.
2019-01-10 08:59:35 -08:00
Sandeep Dubey b5146036e1 Fix #1632: Added alt attribute to the field image. (#2178)
* Added alt for field image.

* Removed lint issues.
2018-12-18 13:38:53 -08:00
Rachel Fenichel 3aa0cac22b Fix setting tooltips in init 2018-10-17 13:27:32 -07:00
duzc2dtw@gmail.com c92a4f31f5 fix #1887 2018-09-11 00:57:52 +08: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
Neil Fraser 1d385f8d69 Require goog.userAgent in the correct files. 2018-04-11 16:59:35 -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
Rachel Fenichel 3e62ffc20a Split at higher level for multiline function calls 2018-01-24 11:26:41 -08:00
Rachel Fenichel fb897d7786 Even more lint. 90 errors remaining. 2018-01-23 18:33:30 -08:00
Rachel Fenichel 7ef19b6851 Fix #1467 2017-12-06 17:00:22 -08:00
Neil Fraser e100c66659 Linting. 2017-10-24 14:06:29 -07:00
Neil Fraser 5c00256e96 Style improvements. No functional changes. (#1367) 2017-10-17 15:19:50 -07:00
Rachel Fenichel d4c21cea3a Fix field_image click handler (#1320) 2017-09-18 13:01:19 -07:00
Neil Fraser fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
Rachel Fenichel 104958e25f Cleanup: semicolons, spacing, etc. (#1116) 2017-05-19 16:27:48 -07:00
Derek Brown 63fe91180b Add image_onclick option (#1080) 2017-05-19 16:18:54 -07:00
picklesrus fd7d8b1ac8 Fix #967 by overriding the updateWidth method in FieldImage blocks to be a no-op. FieldImage fields should not change size after the width is set in init. The updateWidth and, therefore, getCachedWidth is now being called by BlockSvg renderFields_ (see commit d55d9cbd9f). IIUC, updateWidth/getCachedWidth was only called from render before which is overridden in FieldImage to be a no-op already. (#979) 2017-03-17 16:15:40 -07: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 6b692a0802 Initial text block, with a mixin to generate quote image fields. (#923)
Text block now uses the extension "text_quotes", supported by Blockly.Constants.Text.QUOTE_IMAGE_MIXIN.quoteField_(fieldName), so that each platform can use the best platform appropriate image (size, density, etc.) for the quotes.
2017-02-13 15:00:02 -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 594c46785f Remove obsolete Gecko image hack. Apparently this has been fixed in Gecko. 2016-11-14 17:36:02 -08:00
Neil Fraser 4ac1204550 Set field.sourceBlock in headless Blockly. 2016-04-04 17:47:15 -07:00
Troy McKinnon 482c62dfa2 adding additional type annotations 2015-12-01 14:04:54 -06:00
Neil Fraser b5844c45e2 Fix images on blocks that are created collaped. Issue #190. 2015-10-09 15:32:21 -07:00
Neil Fraser db940ca493 Fix reversed height and width on image fields. 2015-09-07 18:52:07 -07:00
carlosperate a43c426986 Remove additional height to the FieldImage size. 2015-08-21 17:25:05 +01:00
Neil Fraser 5b7fec7092 Add zooming feature.
By carloslfu.
2015-08-19 17:21:05 -07:00
Neil Fraser 45fd0e9d44 Remove unused field clone. 2015-07-20 16:17:21 -07:00
Neil Fraser e0f90e6e33 Adding more type documentation. 2015-07-13 15:03:22 -07:00
Neil Fraser c9addf7e31 Improve accuracy of goog.require calls. 2015-02-06 15:27:25 -08:00
Neil Fraser 14e76b2bc5 Remove DOM objects from headless checkboxen, dropdowns, and images. 2015-01-06 15:23:45 -08:00
Neil Fraser 0f8d01209c Headless workspaces and blocks. 2014-12-23 11:22:02 -08:00
Neil Fraser 6539211104 Change official project URL. 2014-10-07 13:09:55 -07:00
Neil Fraser 7122410373 Changing project location from Google Code to GitHub. 2014-09-08 15:18:02 -07:00
Neil Fraser d998a1c8ec Update to latest version. 2014-09-08 14:26:52 -07:00
ellen.spertus 6ee38cdec3 Automatic commit Tue Jan 28 03:00:09 PST 2014 2014-01-28 03:00:09 -08:00