Commit graph

120 commits

Author SHA1 Message Date
Tim Mickel
ca3275eaf0 Merge google/develop June 22 ()
* Localisation updates from https://translatewiki.net.

* test page that creates random blocks and randomly drags them around the page

* Localisation updates from https://translatewiki.net.

* add missing return in fake drag

* get rid of drag_tests file:

* Generated JS helper functions should be camelCase.

Complying with Google style guide.

* Localisation updates from https://translatewiki.net.

* Fix extra category error. Clean up code, rename variables, reduce line lengths, fix lint issues.

* Remove claim that good.string.quote should be used.

* Change the blockly workspace resizing strategy. ()

* Add a new method to be called when the contents of the workspace change and
the scrollbars need to be adjusted but the the chrome (trash, toolbox, etc)
are expected to stay in the same place.

Change a bunch of calls to svgResize to either be removed or call the new
method instead.  This is a nice performance win since the offsetHeight/Width
call in svgResize can be expensive, especially when called as often as we do -
there was some layout thrashing.

This also paves the way for moving calls to recordDeleteAreas
(which is also expensive) to a more cacheable spot than on every
mouse down/touch event.

of things (namely the scrollbars)

* Fix size of graph demo when it first loads by calling svgResize.
The graph starts with fixed width and was relying on a resize event
to fire (which I believe was removed in commit
217c681b86).

* Fix the resizing of the code demo.  The demo's tab min-width used to
match the toolbox's width was only being set on a resize event, but
commit 217c681b86 changed how that worked.

* Fix up some comments.

* Use specific workspaces rather than Blockly.getMainWorkspace().

* Make workspace required for resizeSvgContents and update
some calls to send real workspaces rather than ones that are
null.

Remove the private tag on terminateDrag_ because it is only
actually called from outside the BlockSvg object.

* Remove a rogue period.

* Recategorize BlockSvg.terminateDrag_ to @package instead of @private so that
other developers don't use it, but it still can be used by other Blockly classes.

* Add a TODO to fix issue .

* Add @package to workspace resizeContents.

* Routine recompile

* Fix unit tests.

* Fix inheritance on rendered connection.

Closure compiler on maximum compression breaks badly due to lack of
@extends attribute.

* Add toolbox location and toolbox mode options to playground.

* Increase commonality between playgrounds.

* Properly deal with shadow statement blocks in stacks.

* Localisation updates from https://translatewiki.net.

* Use a comment block for function comments in generated JS, Python and Dart.

* Fix typo in flyout.js ()

* Fix typo in flyout.js ()

* Line wrap comments in generated code.

* Remove reference to undefined variable ()

REASON_MUST_DISCONNECT was removed by a refactor in 2a1ffa1.

* Fix airstrike by grabbing the correct toolbox element. ()

Probably broken in 266e2ffa9a.

* Localisation updates from https://translatewiki.net.

* Fix issue  by calling resize from the keypress handler on text inputs. ()

* Remove shadow blocks from Accessible Blockly demo. Update README.

* Generate for loops on one line.

* Introduce a common translation pipe; remove local stringMap attributes. Fix variable name error in paste functions. Minor linting.

* Fix precedence on isIndex blocks.

* Add indexing setting for JavaScript Generation ()

Adding setting to allow for switching between zero and one based indexing for Blockly Blocks such that the generated code will use this flag to determine whether one based or zero based indexing should be used. One based indexing is enabled by default.

* Remove unused functions and dependencies.

* Remove the unnecessary construction of new services.

* Fix sort block in JS to satisfy tests.

* Trigger a contents resize in block's moveBy. ()

This fixes  but and it also fixes some other similar problems
with copy/paste and other users of moveBy.

* Consolidate the usages of the 'blockly-disabled' label.

* Fix error when undoing a shadow block replacement.  Issue .

* Unify setActiveDesc() and updateSelectedNode() in the TreeService. Move function calls made directly within the template to the correct hooks.

* Standardize naming of components.

* Prevent collisions between user functions and helper functions.

* Localisation updates from https://translatewiki.net.

* Fix . Attash the resize handler to the workspace so it can be removed ()

when workspace.dispose() is called.

* Change the TreeService to a singleton.

* Remove unneeded generated parens around function calls in indexOf blocks.

* Fix  by calling workspace's resize when the flyout reflows. ()

* Updating URLs to reflect new docs. ()

* Updating URLs to reflect new docs. Removing -blockly in URLs.

* Rebuilt.

* Routine recompile

* Prevent selected block from ending up underneath a bumped block.

* Fix undo on fields with validators with side effects.

* Don't fire change event on fields that haven't been named yet.

* Localisation updates from https://translatewiki.net.

* Fix tree focus issues.

* Fix remaining focus issues on block deletion.

* cache delete areas instead of recalculating them onMouseDown

* Cache screen CTM for performance improvement.

* Call svgResizeContents from block_svg's dipose so that deleting blocks ()

from the context menu (or anywhere really) causes the workspace to
recalculate its size.
Remove the call to svgResizeContents from onMouseUp's logic for
determining whether the block is being dropped in the trash
since it calls dispose.

One side effect of this is that when you delete multiple blocks
resize gets called for each of them and the scrollbars move during
the operation. This is most obviously seen by doing an airstrike
in the playground and then deleting all the blocks at once.

* Allow terminal blocks to replace other terminal blocks ()

* Allow terminal blocks to replace other terminal blocks

* Updated test to allow replacing terminal blocks

* Refactor how activeDescendant is set. Introduce helper functions to ensure that calls like pasteAbove() preserve the focus.

* Localisation updates from https://translatewiki.net.

* Remove unnecessary logging.

* Reduce unneeded parentheses in JS and Python.

* Start using field_number.

* Make it easy to disable unconnected blocks.

* Routine recompile.

* Check if matrix is null in mouseToSvg

* Remove js/ localizations pre-merge

* Fix change to block_render_svg

* Fix error in xml.js

* Playground merge

* Add simple toolboxes to playgrounds

* Fix flyout reference in events listener

* Move tokenizeIntepolation into Blockly.utils namespace.

* Use simpler message interpolation in Code demo.

* Create console stub for IE 9.

* Don't output blockId if not set (e.g., toolbox category event). ()

* Fix block in multi-playground

* Increase commonality between playgrounds.

# Conflicts:
#	tests/multi_playground.html
#	tests/playground.html

* Remove "show flyouts" button

* Recompile for merge June 22
2016-06-22 17:50:16 -04:00
Tim Mickel
f1c7cae728 Remove maxBlocks (fix ) ()
* Remove `maxBlocks` (fix )

* Also remove filterForCapacity_

* More references to remainingCapacity
2016-06-21 15:54:03 -04:00
Rachel Fenichel
53d9c6b351 Merge branch 'develop' of https://github.com/google/blockly into feature/pull_upstream_6_01 2016-06-06 11:14:48 -07:00
Tim Mickel
b385828a43 Vertical shapes pass ()
* Add if, if-else, equals; remove old if-elses

* Naming fixes and removal of a dummy input for if-else

* Fix spacing constants; add correct notches.

* Fixing inner notches and connections on vertical statements

* Fix size of extra row after last statement input

* Add minimum block width

* Vertical hat shape to spec

* Larger vertical minimum block width

* Remove INLINE_PADDING_Y and increase MIN_BLOCK_X

INLINE_PADDING_Y, a fixed padding for the internal inputs, shouldn't be necessary in Scratch Blocks. Instead, we'll attempt to center the inputs vertically, and give a padding eventually not for inline inputs but rather for non-shadow blocks in inputs...

* Remove code for horizontal puzzle tabs

* Remove code for "external naked fields"

* Start hats are always on in Scratch Blocks

* Update vertical playground to start at 75%

* Vertical field alignment in vertical rendering

* Increase size of vertical green flag icon

* Minimum width for blocks with C- or E-.

* Remove unused field alignment code

* Fix up inner spacing on statement input

* Fix overhang to avoid clobbering height calculation

* Subtract correct height in getHeightWidth

* Subtract notch height in drawing statement bay

* Add MIN_STATEMENT_INPUT_HEIGHT

* Update size of extra row after statement input

* Don't add extra pixel on statement input connection

* Fix psuedo-height for blocks with no next connection

* Rows after a statement input take the same size as EXTRA_STATEMENT_ROW_Y

* Simplify height management to never include notches

* Consolidate inputRows.rightEdge calculation

* Clean up tab removal

* Fix domToWorkspace in vertical_playground.html

* Render constant newlines

* Updating NOTCH_LEFT_PADDING to NOTCH_START_PADDING

* Update comments about vertical field centering; spacing

* Remove old comment about baseline

* Simplify logic for positioning inline inputs

* Ensure inputs in the first row don't overlap with notch
2016-05-27 13:21:40 -04:00
rachel-fenichel
e14e42192c Merge pull request from rachel-fenichel/cleanup/more_lint
More lint and eslint configuration.
2016-05-25 15:36:03 -07:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Rachel Fenichel
6208ba62fb Rename a variable for clarity 2016-05-25 13:47:19 -07:00
Rachel Fenichel
2f4bc8a0b1 lint fixes 2016-05-24 14:17:43 -07:00
Rachel Fenichel
59e065ae5b Merge branch 'develop' of https://github.com/google/blockly into feature/merge_upstream_horizontal_toolbox 2016-05-23 13:07:11 -07:00
Neil Fraser
29e10e0976 Routine recompile. 2016-05-14 03:50:35 -07:00
Rachel Fenichel
f38b43419c Combine horizontal and vertical flyout scrolling 2016-05-13 16:07:53 -07:00
Rachel Fenichel
65aceaa1dc Fix docstrings and add horizontal scrolling. 2016-05-13 15:30:47 -07:00
Rachel Fenichel
666536807a Add comments; scroll to start for always open flyout 2016-05-13 14:26:32 -07:00
Tim Mickel
2fc4ecd520 Fix deprecated call to domToBlock in flyout 2016-05-12 22:00:34 -04:00
Rachel Fenichel
9073cec9d7 small cleanup after merge 2016-05-12 18:35:45 -07:00
Rachel Fenichel
624a20efdd Merge branch 'develop' of https://github.com/google/blockly into google-blockly/develop 2016-05-12 18:30:42 -07:00
Rachel Fenichel
8cfd48554a clean up margins 2016-05-11 16:40:42 -07:00
Rachel Fenichel
e0cda58701 fix variable naming in createnewblock. 2016-05-11 15:15:12 -07:00
Rachel Fenichel
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -07:00
Rodrigo Queiro
8415db4085 Hide dropdowns when scrolling the flyout
Fixes . This hides both WidgetDiv and DropDownDiv without animation,
otherwise they can float over other blocks as they're animating out.
2016-05-09 09:03:50 -07:00
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue . 2016-05-04 15:00:57 -07:00
Tim Mickel
4feb56c188 Add click events to non-closing flyout blocks. ()
* Add click events to non-closing flyout blocks. Issue .

# Conflicts:
#	core/flyout.js

* Recompile
2016-05-03 15:43:29 -04:00
Rachel Fenichel
8f51fb1e48 remove duplicate code 2016-05-02 15:23:02 -07:00
Rachel Fenichel
8d539f56f3 Preserve create and delete events in the flyout 2016-04-27 11:33:09 -07:00
Rachel Fenichel
cb1188af45 Add TODOs 2016-04-27 10:31:01 -07:00
Rachel Fenichel
2591e12a46 Fix janky scrolling in vertical case 2016-04-26 18:16:26 -07:00
Rachel Fenichel
60dfbb455e offset correctly when opening for the first time 2016-04-26 15:10:49 -07:00
Rachel Fenichel
9dd2b00074 Avoid some unnecessary calls to resize() 2016-04-26 13:30:27 -07:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07:00
Tim Mickel
0ca0b26037 Drop-down and field bug fixes ()
* Only reset icon menu field colour if block still exists

* Hide drop-downs and WidgetDiv on block creation
2016-04-25 15:38:10 -04:00
Tim Mickel
366734c0cb Add flyout scroll mode per
* Add flyout dragMode_ and function to determine intention

* A click on the block rect is also checked for mode
2016-04-23 12:59:38 -04:00
Neil Fraser
6c0bf9f966 Routine recompile. 2016-04-21 06:05:25 -07:00
Neil Fraser
9e034b2716 Merge pull request from picklesrus/develop-hatblock
Take into account height of the hat for hat blocks.
2016-04-21 05:27:35 -07:00
Neil Fraser
e65d6964bd Merge pull request from rachel-fenichel/cleanup/flyout_listeners
Decompose functions in flyout.  Does not change behaviour.
2016-04-21 05:19:00 -07:00
Neil Fraser
703ac981da Routine recompile. 2016-04-20 16:44:13 -07:00
rachel-fenichel
c8f98a7ded Decompose functions in flyout. Does not change behaviour. 2016-04-20 14:14:53 -07:00
Neil Fraser
52eb6adcc2 Add click events to non-closing flyout blocks. Issue . 2016-04-20 05:03:05 -07:00
rachel-fenichel
ac15b8b179 Use Infinity instead of a large number 2016-04-19 14:37:50 -07:00
rachel-fenichel
8882c727a3 remove log statements 2016-04-19 14:27:13 -07:00
rachel-fenichel
84d2388add works in horizontal rtl! 2016-04-19 13:58:58 -07:00
Tim Mickel
0fb21a90fe Separate CORNER_RADIUS from block positioning in flyout; set radius to 0 ()
* Separate CORNER_RADIUS from BLOCK_MARGIN

* Set flyout CORNER_RADIUS to 0 by default

* Fix comment
2016-04-14 17:58:39 -04:00
rachel-fenichel
4fd9f096de decompose Blockly.Flyout.prototype.show 2016-04-14 13:21:35 -07:00
rachel-fenichel
a1509a4467 toolbox -> flyout 2016-04-14 12:50:10 -07:00
Rodrigo Queiro
7ec2f4b624 Merge pull request from drigz/bugfix/toolbox-scroll-cutoff
Include margins in the toolbox content size
2016-04-14 10:05:54 +02:00
Neil Fraser
b5a2f75cee Add tooltips to input holes in flyout. 2016-04-13 15:54:05 -07:00
rachel-fenichel
21e999678c correctly position trash can and zoom controls when the flyout is always open; add flyout and toolbox size to main workspace metrics; get rid of flyout's vertical offset. 2016-04-13 15:30:11 -07:00
Katelyn Mann
79f91266ac Take into account height of the hat for hat blocks.
Also, position hat blocks correctly in the flyout/toolbox.
This fixes .
2016-04-12 14:59:58 -07:00
rachel-fenichel
01955c6615 lint 2016-04-12 13:14:49 -07:00
rachel-fenichel
d1c9fcd83c Rename variables 2016-04-12 11:37:47 -07:00
Rodrigo Queiro
2dc9caf53a Include margins in the toolbox content size
Before the size reported by the SVG was used, which didn't include the
margins and underestimated the true size, meaning the right-hand edge of
the last block being cut off.
2016-04-12 15:50:07 +02:00