Commit Graph

83 Commits

Author SHA1 Message Date
Rachel Fenichel
6092e4c517 Calls to getAllBlocks should pass a value for _ordered_ 2018-09-13 16:06:19 -07:00
RoboErikG
9eacd7d3b9 Disable/enable function calls along with their definitions (#2019)
Fixes #1344

Extends the event listener on procedure caller blocks to also check
for their definition being enabled/disabled and update their own
state in response.
2018-08-23 11:18:29 -07:00
Andrew n marshall
dec9a2c743 Correcting annotations of procedure block mixin functions. 2018-08-22 12:55:16 -07:00
Gokula Krishna
eef7e8f923 Change the XML attribute key from var-id to varid 2018-07-25 10:56:22 +08:00
Gokula Krishna
2c3ef64609 Remove varId attribute while saving 2018-07-24 17:29:35 +08:00
Gokula Krishna
97d3956c43 Prioritize current key var-id 2018-07-24 13:31:04 +08:00
Gokula Krishna
6275c6eef7 Change XML attribute for procedure from varId to var-id 2018-07-24 11:12:17 +08:00
Andrew n marshall
4860e34f51 Removing goog.* uses from blocks/*.js files (#1975)
* Removing goog.arrays.equals() in blocks/procedures.js, with minor refactor.
* Replacing goog.dom.createDom() in blocks/procedures.js, blocks/variables.js,  blocks/variables_dynamic.js, and blocks/loops.js.
2018-07-16 17:01:12 -07:00
Neil Fraser
c8bfc888c8 Throw errors instead of strings. (#1974)
Blocks and generators
2018-07-16 16:33:44 -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
Rachel Fenichel
23666664fa Fix context menus on blocks with variables 2018-04-12 16:56:07 -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
3a4adb3b0d Scroll to the procedure definition from the procedure call context menu 2018-04-05 17:57:47 -07:00
Sam El-Husseini
134b32fe56 Don't show create var getter in block contextmenu when in flyout 2018-03-27 23:40:54 -07:00
Rachel Fenichel
74fd58131b Serialize variable IDs in procedure definitions 2018-02-20 13:18:48 -08:00
Rachel Fenichel
af59e27d96 Cleanup 2018-02-16 11:02:03 -08:00
Rachel Fenichel
f3a4664dea Delete extra variables at the end of a procedure argument edit 2018-02-15 17:18:23 -08:00
Rachel Fenichel
3e62ffc20a Split at higher level for multiline function calls 2018-01-24 11:26:41 -08:00
Rachel Fenichel
9a53e96d53 More lint fixes 2018-01-23 18:22:53 -08:00
Rachel Fenichel
b593d44379 Make the potential variable map null when not needed 2018-01-12 14:51:02 -08:00
Rachel Fenichel
1fa27fa043 Update comments and remove unused functions 2018-01-12 12:03:28 -08:00
Rachel Fenichel
5d6d7519cd Remove some TODOs; add a variable-referencing block to the simple playground flyout 2018-01-08 14:14:26 -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
38d134aa4f Tests 2017-12-06 15:49:20 -08:00
Rachel Fenichel
5169b2da18 Get rid of workspace.deleteVariable 2017-12-05 13:44:08 -08:00
Rachel Fenichel
e4844cd120 Move getOrCreateVariable to variables.js 2017-12-05 13:08:01 -08:00
Rachel Fenichel
3c76028e14 Add TODOs and fix return type 2017-11-30 13:16:17 -08:00
Rachel Fenichel
b870c3ccb9 Allow variables of different types to share the same name. 2017-11-30 13:16:16 -08: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
marisaleung
aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00
Rachel Fenichel
4152542c2f Fix some lint errors 2017-02-03 14:01:18 -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
Neil Fraser
122f69f92c Disable break/return blocks in addition to warning. 2016-10-19 17:04:07 -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
Rachel Fenichel
c7a5944ea3 Create variables from procedure definitions 2016-08-11 14:59:11 -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
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
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Rachel Fenichel
8597c94a49 lint 2016-05-24 15:35:38 -07:00
Neil Fraser
c1872750ae Fix recursive undo/redo loop in logic_compare and logic_ternary blocks. 2016-03-27 02:20:30 -07:00