Commit Graph

1002 Commits

Author SHA1 Message Date
Evan W. Patton e1e94271c4 Implement Blockly.Events.filter in linear time (#1205)
* Implement Blockly.Events.filter in linear time

For large App Inventor projects (order 1k+ blocks, 100+ top-level
blocks), the O(n^2) behavior of Blockly.Event.filter was causing
performance issues when rearranging blocks or pasting from the
backpack. This commit provides a linear merge implementation using a
key that uniquely identifies a block so that multiple events targeting
the same block are merged. This change benefits from O(1) amortized
lookup using an object as a key-value store.

* Add event filter unit tests and fix logic bugs

* Update Blockly.Events.filter unit tests
2017-08-18 14:18:47 -07:00
Rachel Fenichel a3586db023 Bring the most recently edited stack to the front at the end of a drag. (#1283) 2017-08-18 14:16:46 -07:00
Rachel Fenichel b2492dec67 Escape variable names correctly when serializing to XML (#1279) 2017-08-18 11:18:49 -07:00
picklesrus 859d63633e Fix #1275 by adding a more specific rule for overflow:visible on the … (#1280)
* Fix #1275 by adding a more specific rule for overflow:visible on the drag surface svg.  This wins out over a common bootstrap rule that says: svg:not(:root) {overflow:hidden} and helps avoid a difficult problem for Blockly users to diagnose.

* Update css.js
2017-08-15 13:20:51 -07:00
Sam El-Husseini 4c4c8be142 Fix wrong width of field_dropdown with an image on Edge / IE (#1278) 2017-08-14 16:09:27 -07:00
Rachel Fenichel 4b9fc09fed Code cleanup in BlockSvg.prototype.tab (#1277) 2017-08-14 15:34:44 -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 685a41d599 Merge pull request #1261 from marisaleung/develop
Fix type tags and todo placement.
2017-08-04 13:56:36 -07:00
RoboErikG 26e74f72d6 Missed one use of string instead of .property in extensions.js (#1262) 2017-08-04 11:34:33 -07:00
RoboErikG fab59facee Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS (#1253)
* Update extensions.js to be compatible with ADVANCED_OPTIMIZATIONS

We were using strings to check for the existence of properties on
a mutator, which breaks if those properties were renamed by the
closure compiler. This updates all of the uses to direct function
references so that anyone building with advanced optimizations turned
on will get the correct method references in their mutators.

fixes #1251

* Update to extensions.js for advanced optimizations

Some minor updates to making extensions.js work with advanced
optimizations.

* use === undefined instead of typeof == 'undefined'
2017-08-03 15:18:41 -07:00
marisaleung 5f21a43caf Fix type tags and todo placement. 2017-08-03 12:35:14 -07:00
marisaleung 0fce3e9a3d Merge pull request #1238 from marisaleung/develop_fixFunctionTouch
Fix Blockly.Procedures.isNameUsed return values.
2017-08-01 09:55:18 -07:00
Neil Fraser fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
marisaleung 234c53157f Fix Blockly.Procedures.isNameUsed return values.
Add tests for Procedures.isNameUsed() so this bug never happens again.
2017-07-28 12:02:14 -07:00
marisaleung db2f9a2b09 Add opt_type to Blockly.Variables.CreateVariable. 2017-07-21 13:43:13 -07:00
marisaleung baf2d68262 Merge pull request #1230 from marisaleung/develop_addVariableTypes
Add VariableType checks.
2017-07-21 10:54:59 -07:00
marisaleung 733d869f8e Add VariableType checks. 2017-07-20 16:47:37 -07:00
Rachel Fenichel d2f7d5a71a Use the same math for dragging blocks out of horizontal and vertical flyouts. (#1215)
* Use the same math for dragging blocks out of horizontal and vertical flyouts.

* Update flyout_base.js
2017-07-19 11:30:08 -07:00
Tom c85106a920 Typo in a deprecated variable's value (#1228)
Misspelled variable name, should be Blockly.PROCEDURE_CATEGORY_NAME.
2017-07-18 11:23:29 -07:00
marisaleung 170b16706f Modularize Rename Variable prompt and allow custom context menus for flyout. 2017-07-06 15:41:18 -07:00
Sam El-Husseini 21b05d2a69 Only add a block in the flyout if it is not disabled (#1204)
* Only add a block in the flyout if it is not disabled

* PR feedback

* remove previous fix
2017-06-30 14:51:18 -07:00
Rachel Fenichel de67108b17 Fix #1160 (#1197)
Fix "Connection UI Effect not playing on block connect"
2017-06-29 15:13:56 -07:00
marisaleung 15d47840b1 Fire field variable change event with variable value, not name. 2017-06-29 11:24:25 -07:00
marisaleung 3c8e0ebbeb Dropdown Create does not create a missing variable twice. 2017-06-27 16:51:19 -07:00
marisaleung fba60bf7a5 Fix flyout dropdown bug. 2017-06-26 10:41:17 -07:00
marisaleung 11167ca28c Merge pull request #1181 from marisaleung/develop_fixCheckBoxBug
Fix checkbox delete bug.
2017-06-22 14:41:48 -07:00
marisaleung 95594bd070 Always open flyout fields are editable. 2017-06-22 10:59:12 -07:00
marisaleung 7c71b9e7fc Fix checkbox delete bug. 2017-06-20 15:13:10 -07:00
marisaleung 912712cbf5 Merge pull request #1180 from marisaleung/develop_removeTodos
Remove out of date todo comments.
2017-06-20 15:08:59 -07:00
marisaleung d937920afc Remove out of date todo comments. 2017-06-20 13:15:28 -07:00
marisaleung 7b664d90e9 Followup RefreshToolbox. 2017-06-20 10:40:20 -07:00
marisaleung 803681efa1 createVariable in workspaceSvg takes in id and type. 2017-06-19 17:06:07 -07:00
CoryDCode 1ee550aa24 Fixing the accessible variable stuff so it interacts correctly with (#1170)
variableMap.
2017-06-13 09:47:27 -07:00
marisaleung d852a2b116 In DropdownCreate check for Msg.DELETE_VARIABLE. 2017-06-09 16:22:25 -07:00
marisaleung 833c2d0c40 Fire VAR events and test. 2017-06-09 14:42:14 -07:00
marisaleung 7b29eca8e7 Merge pull request #1150 from marisaleung/develop_varEvents
Add VAR events.
2017-06-08 15:54:29 -07:00
marisaleung aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00
marisaleung e9a480c51f Add VAR events. 2017-06-08 15:15:17 -07:00
Rachel Fenichel 2d532225d3 Split flyout into flyout_base, flyout_horizontal, and flyou_vertical
* Rename flyout to flyout_base

* flyout_base minus horizontal and vertical code

* Add flyout_vertical and flyout_horizontal

* review fixes + toolbox and workspace use

* Fix hat block case

* rebuild uncompressed

* Fix travis problem

* Fix build problem
2017-06-08 13:36:11 -07:00
marisaleung d6ea50b8b8 Merge pull request #1157 from marisaleung/wrapInTryCatch
Wrap Error in Try Finally Block.
2017-06-07 10:26:31 -07:00
marisaleung 7f873b12c4 Wrap Error in Try Finally Block. 2017-06-07 10:00:04 -07:00
marisaleung 7e18ddd218 Merge pull request #1156 from marisaleung/develop_accessiblebugfix
Field Variable setValue() looks up variable.
2017-06-06 15:31:05 -07:00
marisaleung 0040ff636c Field Variable setValue() looks up variable. 2017-06-06 15:29:28 -07:00
CoryDCode f48a68a9ef Adding automatically-generated variable lists to the accessible toolbox. (#1149)
Fixing a bug with the core-only uncompressed file not finding its own directory.
2017-06-05 13:42:51 -07:00
marisaleung ccf3ad1473 Add BLOCK events and constructor tests. 2017-06-01 12:38:38 -07:00
marisaleung ca6fc462c4 Fix #1109 2017-05-26 17:25:23 -07:00
marisaleung 4c4cc7bb3b Merge pull request #1135 from marisaleung/develop_deserialization_variables_at_top
Deserialization variables at top.
2017-05-26 14:52:20 -07:00
marisaleung 5415c899d7 Merge pull request #1124 from marisaleung/develop_appease_lint
Appease eslint: semicolons and such.
2017-05-26 14:30:40 -07:00
CoryDCode e2ee3aa9c9 Setting up accessible Blockly for Closure compilation. (#1134)
Moving closure compilation into the build file.

Fixing up goog.requires for accessible blockly. Adding accessible to the build script.
2017-05-26 10:43:02 -07:00
marisaleung f7f664063b Deserialization variables at top. 2017-05-25 14:03:37 -07:00