Commit Graph

381 Commits

Author SHA1 Message Date
Rachel Fenichel
455432250e Use mutator extension for controls_if block 2017-02-22 17:05:52 -08:00
Robert Czechowski
5a7b7b3c5a Make variable add set/get block in context menu obey block limits 2017-02-16 15:03:50 +01:00
Andrew n marshall
feed5ffc6d Renamed extension function constant, and moved variables into the mixin. 2017-02-14 09:37:45 -08:00
Andrew n marshall
6919f588f8 extension controls_if => controls_if_mutator. 2017-02-14 09:37:45 -08:00
Andrew n marshall
2e8d107682 Correcting output of the logic_null block. 2017-02-13 16:28:43 -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
Rachel Fenichel
ece21c632a Merge pull request #927 from rachel-fenichel/feature/jsonify_variable_blocks
JSONify variable blocks
2017-02-13 09:28:40 -08:00
Rachel Fenichel
74ff24e323 JSONify variable blocks 2017-02-10 17:05:02 -08:00
Rachel Fenichel
1ff9b6c4c1 JSONify simple list blocks 2017-02-10 16:05:22 -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
49c9c024e4 Correction to logic_ternary type check (#920) 2017-02-08 10:16:59 -08:00
Andrew n marshall
d97edf0dde Blockly.Constants.Math and Blockly.Constants.Colour extension constants (#916)
Also, correcting quotes in logic.js.
2017-02-06 16:20:48 -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
Benjie Gillam
7d8fa7327c Fix typo causing TypeError (#901) 2017-02-01 09:13:03 -08:00
Andrew n marshall
709295a689 Correcting math_change color 2017-01-23 17:03:05 -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
Tim Dawborn
46316c7cea Add a block to reverse a list (#844) 2017-01-21 10:48:42 -08:00
Tim Dawborn
34750bccd8 New blocks text_count, text_replace, and text_reverse (#830)
Includes generators for all languages and units tests on those generators.
2017-01-20 16:08:27 -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
Andrew n marshall
4fdd16b499 JSON support for message lookup in colour, tooltip, and help URL. (#825)
String replacement for the colour, tooltip text and help URL attributes of JSON defined blocks.
Demonstrated in logic_boolean.
2017-01-13 16:54:27 -08:00
Andrew n marshall
ac3df2759c PR #818: Adding support for string table lookups in dropdown field labels
Adding support for string table lookups in dropdown field labels specified in JSON.

Adds Blockly.utils.replaceMessageReferences() method to handle string replacement without interpolation tokens.  Effectively uses the same old code, now moved into tokenizeInterpolation_(), which takes a parseInterpolationTokens option.

Replaces the direct JavaScript references (not pure JSON, and thus not portable).

Demonstrating this behavior in the logic_boolean dropdown.
2017-01-11 15:47:56 -08:00
Rachel Fenichel
158df44a94 Init procedure blocks with empty name, and set default name in xml in Blockly.Procedures.flyoutCategory 2017-01-03 18:41:28 -08:00
Neil Fraser
fbd9276e9c Lint 2016-11-18 20:26:56 -08:00
Neil Fraser
531b6caf5d Stop some blocks from throwing errors in headless workspaces. 2016-11-18 13:32:31 -08:00
Andrew n marshall
dd95203cdc controls_ifelse: Remove right-align. Remove Boolean check on statements. (#749) 2016-11-16 09:55:58 -08:00
Neil Fraser
c27841f8df Fix compiler errors. 2016-11-15 16:41:11 -08:00
Andrew n marshall
e5d25bb686 String reference in JSON string messages (#741)
* Adds message references to message string interpolation, in the form of %{BKY_STRING}.
 * Re-adding CONTROLS_IFELSE block using the new syntax, referencing to CONTROL_IF equivalents.
2016-11-15 15:51:51 -08:00
Rachel Fenichel
82261e3d68 Remove ifelse block and messages' 2016-11-11 17:21:29 -08:00
Andrew n marshall
72ff6d9ead Adding controls_ifelse block (#722)
Adding controls_ifelse, an if/else block that is loaded from JSON and does not use mutators. This gives "else" capability to Android & iOS implementations, which don't support JavaScript mutators.

Added this block to the playground simple toolbox and all generators.
2016-10-31 11:00:39 -07:00
Neil Fraser
122f69f92c Disable break/return blocks in addition to warning. 2016-10-19 17:04:07 -07:00
Neil Fraser
7928fac3ce Collapse the five 0/1-based index flags into one option. 2016-10-06 17:54:43 -07:00
Neil Fraser
918da99f39 Wrapping lines > 80 char. 2016-09-28 23:06:09 -07:00
Chris Johnson
90d924b84a Adds default def comment only if comments enabled. 2016-09-29 00:49:06 -05:00
Neil Fraser
b614cfb1c1 Fix RTL comparator operators. 2016-08-24 02:49:53 -07:00
Rachel Fenichel
c7a5944ea3 Create variables from procedure definitions 2016-08-11 14:59:11 -07:00
Rachel Fenichel
350e1ff2cc Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop 2016-08-08 16:58:51 -07:00
picklesrus
d215314ffd Revert "Convert createDom calls to createUntypedDom" 2016-07-20 15:21:45 -07:00
Rodrigo Queiro
d9a3569706 Convert createDom calls to createUntypedDom (#481)
Unless they could be converted to use goog.dom.TagName, in which case do
that. createDom is going to require goog.dom.TagName member as the
tagName parameter. This change prepares for that.
2016-07-18 07:18:17 -07:00
Neil Fraser
4f498dc99c Make tooltips reflect from-end indexing behaviour. 2016-07-15 14:55:05 -07:00
Rachel Fenichel
f040929bd8 Merge remote-tracking branch 'upstream/develop' into feature/merge_develop 2016-07-15 13:07:07 -07:00
Neil Fraser
5ea49cdf4e Change tooltips on get/set list blocks to be 0/1 index aware. All languages. 2016-07-09 04:23:01 -07:00
Neil Fraser
b324efaa86 Change tooltip on text/list indexOf blocks to be 0/1 index aware. All languages.
Delete ta:TEXT_INDEXOF_TOOLTIP since that text does not appear to make
sense.
2016-07-08 18:58:28 -07:00
Neil Fraser
e849c93db9 Merge branch 'master' into develop 2016-07-08 16:52:18 -07:00
Neil Fraser
2dab19c015 Ensure that if a procedure call exists, so does its definition.
Specifically, if a call is copied, then the def is deleted, then the
call is pasted, the def should be created.
2016-07-08 15:50:09 -07:00
Rachel Fenichel
5418843c12 Move the change block to the variables category 2016-07-07 14:39:45 -07:00
Rodrigo Queiro
589f6ae13f Re-enable events even when an exception is thrown
This prevents a recoverable exception permanently disabling events. This
could be caused by calling domToWorkspace() to load a corrupt program.
2016-06-29 14:46:06 +02:00