Commit Graph

190 Commits

Author SHA1 Message Date
BeksOmega
1c4ba38300 Added Max Instances Property to Workspace Options (#2130)
* Added Max Instances property to Blocks

* eslint cleanup

* eslint cleanup 2

* Moved maxInstances property from block to workspace (as a map of block type to max instances). isDuplicate() changed to correctly handle siblings/branches.

* eslint cleanup

* Changed checking types to map. Added hasBlockLimits. Fixed Nits.

* Added limit_instances test block. eslint fixes.

* fixup! Added limit_instances test block. eslint fixes.

* Changed sorting objects to a private static function of the workspace. Fixed nits. Undeleted .eslintrc

* Reverted .gitignore file.

* Added getBlockTypeCounts() to utils. Added isCapacityAvailable() to workspace. Changed clipboard to save typeCountsMap rather than object.
2018-11-27 16:34:21 -08:00
Neil Fraser
db0dbc69ee Update todos and requires. 2018-10-16 11:34:10 -07:00
Neil Fraser
aa09ad9175 Line wrap at 80. 2018-10-16 11:34:10 -07:00
Rachel Fenichel
870e95a255 Fix inconsistent return type warning 2018-09-25 14:22:12 -07:00
Rachel Fenichel
a0e90627f7 Add some functions for insertion markers 2018-09-13 15:55:49 -07:00
Andrew n marshall
b8a1873f01 Converting bad block warning into an error. 2018-08-31 12:42:38 -07:00
Rachel Fenichel
b89487e332 Ignore whether parent has multiple inputs 2018-08-06 11:18:00 -07:00
Rachel Fenichel
a8d52903e2 update comment with todo 2018-08-06 10:29:12 -07:00
Rachel Fenichel
b65491e656 Heal rows when unplugging, and add tests 2018-08-03 13:54:29 -07:00
Neil Fraser
dce60fd152 Replace ReferenceError with Error.
Change to 4-space indentation rather than aligning with parent structure.
2018-07-11 12:20:02 -07:00
Neil Fraser
06d90c9b34 Remove goog.array 2018-07-11 12:20:02 -07:00
Neil Fraser
03bf9f5e71 Remove goog.string 2018-07-11 12:20:02 -07:00
Neil Fraser
3909bd420a Remove all goog.asserts and goog.isXxx
First step to reducing Closure’s footprint.
2018-07-11 12:20:02 -07:00
Mark Gibson
709d31b729 Fix case of duplicate var (i) 2018-06-19 11:00:24 +01:00
Rachel Fenichel
f623004b3a Small changes 2018-05-16 12:52:12 -07:00
Rachel Fenichel
a8767ee6c9 Add a referencesVariables function to field 2018-04-25 15:15:05 -07:00
Andrew n marshall
2bfff4a335 Warn if jsonInit() receives a colour attribute without a value. (#1795)
* Warn if jsonInit() receives a colour attribute without a value.
 * Extract colour init code into function.
 * Adding block type name to prior warnings.
2018-04-18 13:35:30 -07:00
Neil Fraser
662d79443f Add 'ordered' option to descendant getting functions. (#1786) 2018-04-17 11:41:03 -07:00
Johnny Yang
6c2d63300d mark properties @protected instead of @private so they can be used by Blockly.BlockSvg 2018-04-16 01:33:04 +10: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
52e0241f66 Add argsIgnorePattern to the eslintrc 2018-04-06 13:29:22 -07:00
Rachel Fenichel
6d83b9bc28 Add keyword-spacing rule to eslint 2018-03-19 13:10:29 -07:00
Rachel Fenichel
4c9b602523 Move event classes into separate files, and update requires accordingly 2018-02-27 17:47:33 -08:00
Andrew n marshall
9cd6b1ec24 Print a warning if JSON color value is invalid. (#1639)
Ignores the invalid color, defaulting to black.
2018-02-21 13:55:32 -08:00
Mark Gibson
54f0e06e21 Customising field types using a register of fields #1584 (#1594)
Implement #1584 - Fields now registered by their JSON type name, allowing new custom fields and overriding of the standard fields. Replaces the manual switch statement for loading fields from JSON block definitions.
2018-02-14 10:14:59 -08:00
Rachel Fenichel
5e0928e4f3 Break circular dependency 2018-02-13 10:44:07 -08:00
Andrew n marshall
dc7783ee01 Warn conflicts with Blockly.Generator.prototype (#1603)
Console warning if block prototypeName conflicts with Blockly.Generator.prototype.
2018-02-12 13:44:54 -08:00
Mark Gibson
2308ae8c22 Remove underscore from fromJson_ 2018-02-07 18:18:35 +00:00
Mark Gibson
d40ef474ae See issue #1486 - adds fromJson_ fn to every Blockly.Field, removing Block.newField*FromJson_ helpers 2018-02-07 12:22:26 +00:00
Rachel Fenichel
870219e750 Get rid of the last indentation lint (that is checked by eslint) and turn indentation back to erroring instead of warning. 2018-01-25 17:33:43 -08:00
Rachel Fenichel
cb75946a3c Set indent problems to warnings, and fix all errors. 2018-01-25 12:43:11 -08:00
Rachel Fenichel
7314bdfb3a Fix #1499 and add some validation 2018-01-17 16:54:12 -08:00
Rachel Fenichel
a43b0e7010 Respond to commit comments and make compressed blockly work again 2018-01-10 17:02:02 -08:00
Rachel Fenichel
bd4e4daebb Update comments and use try/catch with setGroup. 2018-01-09 13:31:13 -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
d69519bdab Fix headless 2017-12-19 16:10:07 -08:00
Rachel Fenichel
6218750207 Fix events for variable fields on new blocks; fix tests 2017-12-19 11:28:23 -08:00
Rachel Fenichel
77a47aee94 Fix html escaping and flyouts opening 2017-12-07 16:08:00 -08:00
Rachel Fenichel
cc6eeb8c68 Clean up TODOs and move potential variable map to the flyout workspace 2017-12-07 10:43:12 -08:00
Rachel Fenichel
38d134aa4f Tests 2017-12-06 15:49:20 -08:00
Rachel Fenichel
1506a36b58 Fix events for variable renaming 2017-12-06 14:41:56 -08:00
Rachel Fenichel
25913884ab Delete by id 2017-11-30 17:21:12 -08:00
Rachel Fenichel
112fcccb31 Fix renaming 2017-11-30 17:12:39 -08:00
Rachel Fenichel
b870c3ccb9 Allow variables of different types to share the same name. 2017-11-30 13:16:16 -08:00
Rachel Fenichel
8c51935025 More lint for unused variables 2017-11-03 14:04:36 -07:00
Neil Fraser
6635dada6d Allow external code to load new audio. (#1409)
If external code can ‘play’, it should be able to ‘load’.  Resolves
compile error in Blockly Games.  Feel free to push back if this API
shouldn’t be public.

Also fix compiler warnings on block defs.  ‘undefined’ means undefined, ‘=‘ means optional.
2017-11-01 17:47:24 -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
Isaac Dunn
f8f807f53c Store Block hue so it can be extracted reliably (#1293)
Adds `Block.getHue()` to retrieve the block colour when set via a hue.
The hue value is stored in the new `.hue_` field, which is null if the colour was set via a hex string.
2017-09-04 08:45:33 -07:00
picklesrus
5518873389 Revert "Remove all all instances calling setValue on variable fields with the name instead of the id" (#1296)
* Revert "Create WorkspaceViewport class (#1291)"

This reverts commit 6c00d77c9e.

* Revert "Remove all all instances calling setValue with name. (#1254)"

This reverts commit 8e8b6b27af.
2017-08-28 16:55:44 -07:00