Commit Graph

3871 Commits

Author SHA1 Message Date
picklesrus
b3ba25ab5c Disable workspace resizing at the beginning of cleanup blocks and re-enable at the end. (#1331) 2017-09-21 16:20:17 -07:00
Rachel Fenichel
8050ce929c Code cleanup: widget creation (#1332) 2017-09-20 16:38:13 -07:00
Sam El-Husseini
9c0de1ae8d Avoid IE and Edge re-rendering (#1326)
* Fix wrong width of field_dropdown with an image on Edge / IE

* Avoid re-rendering on IE and Edge by using getBBox().width to compute the text width on those browsers
2017-09-19 15:04:25 -07:00
Eric Rosenbaum
cc8a12a574 Scale Firefox scrolling for mouse only, not trackpad (#1324) 2017-09-19 10:47:23 -07:00
Eric Rosenbaum
d0e1141a9f Add margin only for buttons, not labels (#1322) 2017-09-19 10:46:49 -07:00
Nick Allred
c5be6e1722 Subtract metrics.contentTop from metrics.viewTop so that the flyout does not begin to scroll down once the delta is smaller than the value of metrics.contentTop (#1309) 2017-09-18 13:21:43 -07:00
Rachel Fenichel
dd50dde23d Make dropdowns update correctly when you switch between images. (#1321) 2017-09-18 13:09:07 -07:00
Rachel Fenichel
d4c21cea3a Fix field_image click handler (#1320) 2017-09-18 13:01:19 -07:00
Rachel Fenichel
da6d392878 Allow the toolbox to scroll (#1319)
* Allow the toolbox to scroll

* Switch from onMouseDown to onClick_ for toolbox category taps and clicks.
2017-09-18 12:44:48 -07:00
Rachel Fenichel
e669466475 Code cleanup in FieldDropdown (#1289)
* Helper functions for rendering an image or text option.

* Break showEditor_ into smaller helper functions

* More decomposition, and function comments.
2017-09-15 12:26:39 -07:00
Neil Fraser
ddd4700e1d Strip licences from compiled code. (#1318) 2017-09-14 17:23:50 -07:00
Sam El-Husseini
6e3a2b7218 Fix flyout labels causing flyout scrolling issues (#1301) 2017-09-05 10:26:58 -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
Rachel Fenichel
6c00d77c9e Create WorkspaceViewport class (#1291)
* Create WorkspaceViewport class

* Update comments

* Move workspace viewport functions back to the workspace for now

* whitespace
2017-08-24 15:51:31 -07:00
marisaleung
8e8b6b27af Remove all all instances calling setValue with name. (#1254) 2017-08-24 14:34:01 -07:00
Rachel Fenichel
62e4730ba5 Add annotations for units to scrollbar.js (#1290)
* Add annotations for units to scrollbar.js

* Update comments
2017-08-24 10:58:16 -07:00
Rachel Fenichel
00b2b85e8c Decompose the showEditor_ function in FieldTextInput (#1285)
* Explicit annotations

* Decompose the showEditor_ function in FieldTextInput

* Remove extra newline
2017-08-18 15:19:05 -07:00
Rachel Fenichel
2d5f1156d7 Clean up code in FieldTextInput (#1284)
* Clean up code in FieldTextInput

* Explicit annotations

* Remove extra newline
2017-08-18 14:55:40 -07:00
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