Commit Graph

72 Commits

Author SHA1 Message Date
duzc2dtw@gmail.com 0ee877b4bf fix indent 2017-12-09 02:09:58 +08:00
duzc2dtw@gmail.com f770b29491 fix #1173 2017-12-09 02:03:28 +08: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
Neil Fraser 631c978174 Fix typos. 2017-10-20 13:29:23 -07:00
Rachel Fenichel 078b4fceb3 Revert some whitespace changes to appease eslint (#1370) 2017-10-19 16:08:54 -07:00
Neil Fraser 5c00256e96 Style improvements. No functional changes. (#1367) 2017-10-17 15:19:50 -07:00
RoboErikG 26e74f72d6 Missed one use of string instead of .property in extensions.js (#1262) 2017-08-04 11:34:33 -07:00
RoboErikG fab59facee Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS (#1253)
* Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS

We were using strings to check for the existence of properties on
a mutator, which breaks if those properties were renamed by the
closure compiler. This updates all of the uses to direct function
references so that anyone building with advanced optimizations turned
on will get the correct method references in their mutators.

fixes #1251

* Update to extensions.js for advanced optimizations

Some minor updates to making extensions.js work with advanced
optimizations.

* use === undefined instead of typeof == 'undefined'
2017-08-03 15:18:41 -07:00
Neil Fraser fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
Rachel Fenichel c30928a177 Make some functions private and add tests 2017-02-24 15:51:59 -08:00
Rachel Fenichel aa8e996799 Handle mutations with both mixins and functions 2017-02-23 17:07:06 -08:00
Rachel Fenichel 4b0c32e91f Add safety checks for mutators and non-mutator extensions 2017-02-23 15:55:13 -08:00
Rachel Fenichel 455432250e Use mutator extension for controls_if block 2017-02-22 17:05:52 -08:00
Andrew n marshall a4cfd5cbc8 Porting Loop blocks to JSON (#919)
* Improved documentation on `Blockly.Extensions.buildTooltipForDropdown`
 * Replaced incorrect uses of `@mixes` JSDoc annotation (on mixin extensions) with `@augments Blockly.Block`.
 * Added Blockly.Extensions.buildTooltipWithFieldValue() extension helper.
2017-02-08 11:36:38 -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
Andrew n marshall e95991cba8 Adding @namespace annotations for JSDoc. (#900) 2017-02-01 09:10:35 -08:00
Tim Dawborn 14ee069543 Remove use of Array.prototype.includes which is not implemented in IE or Edge < 14. Fixes google/blockly#876. 2017-01-27 13:51:18 +11:00
Andrew n marshall 624afeee94 Blockly.Extensions.buildTooltipForDropdown(..): Deferred validation. (#870)
Defer tooltip message string check until after load, when all Blockly.Msg should be loaded.
Avoids validation in headless mode, due to lack of document.readyState.
2017-01-26 15:12:32 -08:00
Andrew n marshall 7b0275cd70 Porting math.js blocks to JSON (#846)
Moving all `math.js` definitions into a single JSON array, complete with i18n syntax for all messages, dropdowns, and tooltips.

Adding Blockly.Extensions.buildTooltipForDropdown(..) to facilitate the creation and error-checking of tooltips that update based on the value of a dropdown.

Now warn on raw string in JSON 'extensions'.
2017-01-23 10:23:55 -08:00
Andrew n marshall 78dc5ed9c2 JSON definitions for colour blocks (#838)
Replaces old colour block definitions with a Blockly.defineBlocksWithJsonArray(..) call. Generator unit tests continue to load and pass, signifying compatibility with prior block definitions.

Replaces extension 'math_number_tooltip' with the reusable 'parent_tooltip_when_inline' extension, also used by colour_picker. Includes tests.
2017-01-18 13:48:46 -08:00
Andrew n marshall a47bd93f4c Adding extensions for JSON support of dynamic blocks. (#834)
Adding support for extensions, functions that can assist with loading blocks, much like init functions, but that can be referenced from JSON definitions. This allows JSON definitions to define dynamic blocks such as onchange handlers and mutators.

Rewrote math_number as an example pure JSON block.
2017-01-18 12:45:39 -08:00