Commit Graph

77 Commits

Author SHA1 Message Date
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
0bc8960d79 Update list and text create block to right align its value inputs (#3667) 2020-01-30 17:05:00 -08:00
Neil Fraser
123f436e04 Add parens around inline assignments (#3381) 2019-10-31 15:17:35 -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
Neil Fraser
84a814cda1 Make mutator an optional module. (#3048) 2019-09-19 11:39:55 -07:00
Neil Fraser
0add3a5e3e Add require statements to all block files. 2019-09-18 13:00:44 -07:00
Rachel Fenichel
6f4476c962 Textarea Field, Multiline Block (from acbart) (#2663)
* Field Textarea, text_multiline block, generators
2019-09-11 17:57:46 -07:00
Rachel Fenichel
f717add5a5 Block annotations (#2997)
* Replace `@this Blockly.Block` with `@this {Blockly.Block}` in all block files.

* Fix 9 compiler warnings (JSC_USED_GLOBAL_THIS)
2019-09-11 17:50:52 -07:00
Neil Fraser
52b6ce18a5 Fix unit tests 2019-07-08 13:29:43 -07:00
Beka Westberg
73ff710a4d Added getSourceBlock function to field. (#2508) 2019-05-29 12:50:00 -07:00
Beka Westberg
f16c9c0beb Refactored field validation. 2019-05-24 14:23:42 -07:00
Neil Fraser
e9de083361 Fix @return JSDocs. 2019-03-29 15:24:37 -07:00
alschmiedt
4982c5c310 Changes names for block styles 2019-01-08 09:40:30 -08:00
alschmiedt
1b3955d9d6 Fixing review comments 2018-12-21 07:52:50 -08:00
alschmiedt
d9c4608da8 Remove use of style variables in block definition 2018-12-20 10:09:47 -08:00
alschmiedt
034bcb00bb Replace setting colour to setting style in block definitions 2018-12-18 10:01:05 -08:00
Rachel Fenichel
5b1e249adc Fix lint 2018-06-25 12:12:24 -07:00
Neil Fraser
4cb4b42f8d Use named properties on Msg. 2018-04-27 11:50:51 -07:00
Andrew n marshall
ab8692652a Revert "Removing namespace declarations for deprecated and unused namespaces. (#1796)" (#1809)
This reverts commit 75459abfdd.
2018-04-20 08:08:11 -07:00
Andrew n marshall
75459abfdd Removing namespace declarations for deprecated and unused namespaces. (#1796)
These namespaces use to contain the original block hue constants,
but were deprecated (via comment, except for procedures) over a year
ago. With the removal of those constants, the declarations were
creating empty, unused objects.
2018-04-18 15:32:26 -07:00
Andrew n marshall
e9d8e00a55 Making all blocks use the MSG colour values. (#1749)
* Making all blocks use the MSG colour values.
 * Deprecating Blockly.Constants.Lists.HUE and similar constants.
 * Removing deprecated Blockly.Blocks.lists.HUE constants.
 * Allowing message references in the Block.setColour() parameter.
 * Adding checking of older constants, ensuring they are not overwritten.
2018-04-09 17:37:47 -07:00
Rachel Fenichel
b402f3c204 Add @this annotations in blocks/text.js 2018-03-26 14:32:49 -07:00
zgtm
14aa53e0fa Move ordinal in block 'text_getSubstring' (#1656)
On updating the block 'text_getSubstring', the ordinal string 'ORDINAL1' is moved when the corresponding corresponding input field is moved so that the ordinal string does not end up at the end of the block.
2018-02-26 10:44:01 -08:00
Andrew n marshall
f45c6faf05 Fix #1619. buildTooltipWithFieldValue() => buildTooltipWithFieldText() (#1638)
Fix #1619. buildTooltipWithFieldValue() => buildTooltipWithFieldText()

The "value" of FieldVariables was the variable id.
However, we usually want the field text for the human visible tooltip.
Refactoring and renaming buildTooltipWithFieldValue to use the field
text.
2018-02-16 16:51:18 -08:00
RoboErikG
551b05b4f1 Fix typo in BKY message key (#1616)
We had {% instead of %{

Fixes #1613
2018-02-14 10:52:49 -08:00
Rachel Fenichel
9a53e96d53 More lint fixes 2018-01-23 18:22:53 -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
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
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
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
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
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
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -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
Neil Fraser
7928fac3ce Collapse the five 0/1-based index flags into one option. 2016-10-06 17:54:43 -07:00
Neil Fraser
4f498dc99c Make tooltips reflect from-end indexing behaviour. 2016-07-15 14:55:05 -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
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Neil Fraser
29e10e0976 Routine recompile. 2016-05-14 03:50:35 -07:00
Neil Fraser
ea71cec0c7 Trivial blocks only inherit tooltip from parent if on external inputs.
Recompile.
2016-05-03 17:49:10 -07:00
Neil Fraser
39fbd24659 Remove setProcedureParameters from API (use domToMutation instead). 2016-03-22 10:48:13 -07:00
Neil Fraser
72bb08a4ec Add undo/redo.
Some bugs in undoing function argument changes.
2016-03-14 23:14:05 -07:00