Commit Graph

365 Commits

Author SHA1 Message Date
Rachel Fenichel
5d6d7519cd Remove some TODOs; add a variable-referencing block to the simple playground flyout 2018-01-08 14:14:26 -08:00
Neil Fraser
7413db1089 Code style 2018-01-05 15:56:20 -08:00
Rachel Fenichel
ea6bf607fa Add displayRenamedVar to procedures_defnoreturn 2018-01-04 16:38:36 -08:00
Rachel Fenichel
832dae009e Cleanup 2018-01-04 16:32:23 -08:00
Rachel Fenichel
77cf3ddc33 Track variable IDs for procedure arguments 2018-01-04 16:16:12 -08:00
Rachel Fenichel
9b091a8f9e Update procedure generators 2018-01-02 16:27:17 -08:00
Rachel Fenichel
66975c8f94 Rebase 2017-12-15 13:44:27 -08:00
Rachel Fenichel
399f1a5c11 Tests 2017-12-13 11:50:08 -08:00
Rachel Fenichel
61db23c78a Get rid of workspace.deleteVariable 2017-12-13 11:50:08 -08:00
Rachel Fenichel
1ce46ab88b Move getOrCreateVariable to variables.js 2017-12-13 11:50:07 -08:00
Rachel Fenichel
24462fbc91 Add TODOs and fix return type 2017-12-13 11:50:07 -08:00
Rachel Fenichel
779be46a92 Allow variables of different types to share the same name. 2017-12-13 11:50:07 -08:00
Tianwei Du
492462e1d4 Develop (#1481)
* variables_dynamic

* make test , and i18n

* Issue #1470

* Blockly.Constants.VariablesDynamic.CUSTOM_CONTEXT_MENU_VARIABLE_MUTATION
to make sure setCheck before event trigger

* Update built files from develop.

* fix copyright ,quotes , comments ,  and optimize some flow.

* quotes,change UI , change category custom name

* single setter , remove mutator , colour typo , typed variables create button message

* undo the indent edits.
2017-12-08 08:53:24 -08:00
RoboErikG
bcedc130bb Fix #1444 - broken mutator for text_charat (#1451)
* Fix #1444 - broken mutator for text_charat

There might no longer be an input named AT on a text_charat block
which the mutator had been depending on. There is now a boolean on
the block for isAt, though, so use that directly instead.

The

* Address comments
2017-11-15 12:21:07 -08:00
RoboErikG
53e6bddff5 Use msg references in block JSON for text_charat (#1426) 2017-11-06 13:05:09 -08:00
Rachel Fenichel
432881d2c1 Make quote images meet line length requirements 2017-11-03 14:04:36 -07:00
Rachel Fenichel
8c51935025 More lint for unused variables 2017-11-03 14:04:36 -07:00
RoboErikG
c4b2899007 Fix #1397 by being more careful with mutator (#1410)
* Fix #1397 by being more careful with mutator

The text_charAt mutator was replacing more of the title string than
necessary, which would lead to losing some of the relevant text in
the label. Updated the mutator to only add/remove a new input on the
end instead of replacing the default dummy input.

* Code cleanup
2017-11-02 09:37:31 -07: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
Andrew n marshall
f992ea0f9c Fix #1369: resource loading order constraints, interpolation tokens in message expansion (PR #1383)
This fixes race condition in #1369 by using message references instead of explicit string lookups. This required fixing a bug the token interpolation parser that was breaking on the inner '"%1"' for these tooltips.
2017-10-24 13:02:14 -07:00
RoboErikG
2514976e80 Fix typo in mixin name (#1375)
There was a typo in the name of the loop check mixin. Fixes the immediate issue though we should post a warning if trying to register a mixin that doesn't exist.
2017-10-20 15:18:19 -07:00
Neil Fraser
5c00256e96 Style improvements. No functional changes. (#1367) 2017-10-17 15:19:50 -07:00
Tom
a6245f4c6e Compile messages with externs and demo with advanced optimizations (#1259)
* Revert "Fix synonyms when compiled. (#1248)"

This reverts commit f08afbb351.

* Revert "Compatibility for Closure Compiler. (#1240)" [fc8d4c9]

* Adding exports to all messages.

* Fixed missing dependency to Blockly.defineBlocksWithJsonArray()

* Adding a fully compiled demo draft (still simple optimizations).

* Demo optimizations switched to advanced and enabled exports (for Blockly.Msg).

* Message interpolation updated to use the exported (global) Blockly.Msg array.

* Adding some debug compilation options to the build script.

* Adding SVG externs.

* Fixed Blockly.inject's config array to work with compilation.

* Reverting all compiled code.

This fixes commit b307ba1151.
This fixes commit dec6910b67.

* Reverting all compiled code.

This fixes commit 824c806ec3.

* Removing old todo

* Merge commit 'fe96bec765f0eb58c5321101965100c2716760ed' into compile-messages-with-externs

* commit 'fe96bec765f0eb58c5321101965100c2716760ed':
  Fixes positional index for Czech translation (#1264)
  Missed one use of string instead of .property in extensions.js (#1262)
  Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS (#1253)
  Fix type tags and todo placement.
  Procedure block renames variable in mutator if there is a case change.

* Fixes based on review by @NeilFraser
- 80 cols
- using goog.global instead of window
- @export on the same line as messages

* BF: Moving the msg dependency earlier, since Blockly.Msg.en is filling the Blockly.Msg object, which is empty without Blockly.Msg.en (and the rest of the code is using it as Blockly.Msg).

* Updating some texts in the demo's html file to be more descriptive.

* Commenting the debug options in the build, to maximize the optimizations. They are not removed, to allow anybody to turn them on if needed (since they are not documented on the Closure Compiler's REST API pages).

* BF: fixed blocks_compressed.js compilation, as it now requires Blockly namespace to exist.

* SVG externs file updated based on the one in https://github.com/google/closure-compiler/blob/master/contrib/externs/svg.js (eliminating 2 warnings)
2017-08-08 11:16:49 -07:00
marisaleung
d37309497f Procedure block renames variable in mutator if there is a case change. 2017-08-02 16:49:06 -07:00
RoboErikG
1539941427 Fix issue with compression stripping dropdown options (#1207) 2017-06-30 15:48:20 -07:00
RoboErikG
df84c71c66 Convert more text blocks to JSON format (#1163)
* Convert more text blocks to JSON format

Converts text_charAt, text_indexOf, text_isEmpty, and text_length
to JSON.

Includes a rebuild to pick up message changes.
2017-06-12 10:36:36 -07:00
marisaleung
aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00
RoboErikG
fa72e02dc5 Convert more text blocks to json (#1147)
* Convert more text blocks to json

Converts the mutator blocks for text_join and the text_append block
to JSON format.
2017-06-01 14:21:16 -07:00
RoboErikG
039f536cf3 Convert text_join block to JSON + mutator format (#1140) 2017-05-31 10:22:44 -07:00
Andrew n marshall
a21d04b804 Making text_count use a text color (like text_length, which also returns a number). (#1027) 2017-04-10 16:26:30 -07:00
picklesrus
36fa5f6016 Fix #986. Looks like the original PR just forgot this block. (#992) 2017-03-23 10:20:42 -07:00
Andrew n marshall
b5f91dd054 Typo in comment. 2017-03-02 08:34:27 -08:00
Rachel Fenichel
aa8e996799 Handle mutations with both mixins and functions 2017-02-23 17:07:06 -08:00
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