Commit graph

292 commits

Author SHA1 Message Date
Troy McKinnon
ad3541992e add a few type definitions 2016-09-30 16:26:44 -05:00
Rachel Fenichel
ed983333eb bindEventWithChecks_ for internal use, and bindEvent_ with old behaviour but deprecated 2016-09-23 13:46:11 -07:00
Rachel Fenichel
ba1238812f Revert "Revert "Ignore everything but the first touch stream"" 2016-09-23 13:36:53 -07:00
Rachel Fenichel
b2faa41eb1 Revert "Ignore everything but the first touch stream" 2016-09-22 15:26:52 -07:00
Rachel Fenichel
029148dd25 Merge branch 'develop' of https://github.com/google/blockly into merge_sept_22 2016-09-22 14:55:57 -07:00
Tim Mickel
4bbfa87b05 Stack glow proportional to scale () 2016-09-21 13:21:13 -04:00
Rachel Fenichel
5232f8f1bf Get rid of reflow since scratch-style toolboxes are fixed size. 2016-09-08 16:54:10 -07:00
Rachel Fenichel
b771d8daf4 Cleanup 2016-09-07 18:14:05 -07:00
Rachel Fenichel
109e4bb352 Move code to touch.js 2016-09-07 17:42:09 -07:00
Rachel Fenichel
c373d6d091 Make context menus work again; fix dragging from the toolbox with variables. 2016-09-07 15:49:20 -07:00
Rachel Fenichel
a979a422e4 Merge branch 'develop' of https://github.com/google/blockly into merge_sept_01 2016-09-01 16:52:08 -07:00
Rachel Fenichel
706d74c81e Handle touches on/in comments and right-clicks on the workspace 2016-09-01 14:15:03 -07:00
Rachel Fenichel
b77c080678 Fix bugs with missing mouseUp events on mutators. Also stop filtering out key presses. 2016-08-25 15:18:53 -07:00
Rachel Fenichel
e02e695bde Require constants in workspaceSvg, which uses them during initialization. 2016-08-25 13:28:05 -07:00
Rachel Fenichel
cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
rachel-fenichel
21fea1279c Merge pull request from google/feature/variable_management
Integrate variable management into develop.
2016-08-18 15:56:18 -07:00
Katelyn Mann
33e9d75457 Fix for .
Add a isMutator member similar to isFlyout to workspace_svg so it knows whether
it is mutator or not. Allow blocks to access that property so that they can recalculate
coordinates appropriately.
2016-08-16 11:19:29 -07:00
rachel-fenichel
c7dea98e88 Merge pull request from picklesrus/develop-screenctm-bugs
Fix for .  Recalculate the things that use screen coordinates (de…
2016-08-12 17:15:20 -07:00
Katelyn Mann
244733467d Fix for . Recalculate the things that use screen coordinates (delete area and
screen transformation matrix) when a scroll happened.
This is not done using a scroll handler since the update
is expensive (getScreenCTM and getClientBoundingRect) and we don't need to do it
until the scroll is done and the user is interacting with blocks again.
2016-08-12 16:56:22 -07:00
Rachel Fenichel
4b5d4d4c26 Merge branch 'feature/variable_management' of https://github.com/google/blockly into feature/variable_management 2016-08-12 15:52:48 -07:00
Rachel Fenichel
a2b3a3638a Merge branch 'develop' into feature/variable_management 2016-08-12 14:32:26 -07:00
Katelyn Mann
bbd57a9a16 Fix by changing workspace's dispose method to remove the injectDiv wrapper of the
svg. The wrapper div was introduced in .
2016-08-11 11:00:02 -07:00
Rachel Fenichel
350e1ff2cc Merge remote-tracking branch 'upstream/develop' into feature/variable_management_merge_develop 2016-08-08 16:58:51 -07:00
Emma Dauterman
831a14e1e4 Made Blockly.WorkspaceSvg.cleanUp public 2016-08-02 17:18:12 -07:00
rachel-fenichel
b4a938f804 Merge pull request from drigz/bugfix/476
Check flyout in isDragging()
2016-07-19 10:58:48 -07:00
Rachel Fenichel
dfc142eb37 Merge remote-tracking branch 'googsblockly/feature/variable_management' into feature/variable_management 2016-07-15 15:32:42 -07:00
Neil Fraser
4f498dc99c Make tooltips reflect from-end indexing behaviour. 2016-07-15 14:55:05 -07:00
Rachel Fenichel
f040929bd8 Merge remote-tracking branch 'upstream/develop' into feature/merge_develop 2016-07-15 13:07:07 -07:00
Rodrigo Queiro
74e905c611 Check flyout in isDragging()
We also have to record startFlyout_ on background scrolls - before
dragMode_ wasn't being reset by terminateDrag() for background scrolls,
which would suppress clicks from that point on.

Fixes .
2016-07-15 10:35:45 +02:00
Rachel Fenichel
18be9d1de8 Merge branch 'feature/variable_management' of https://github.com/google/blockly into feature/variable_management 2016-07-13 14:36:35 -07:00
Rodrigo Queiro
d3d0ca4fd0 Record whether the workspace has been dragged ()
* Record whether the workspace has been dragged

This fixes  by differentiating between a touch on an unmovable block
and using it to drag the workspace.

* Remove isScrolling and add DRAG_BEGIN

Applied after PR review.
2016-07-12 11:34:02 -07:00
Rodrigo Queiro
ab03c4f411 Remove out-of-date comment ()
This comment made sense [before multiple workspace support](67140282a0/core/blockly.js (L297)), where it was near a (Blockly.readOnly || isTargetSvg) check. Now, this logic is implemented in BlockSvg.onMouseDown_() instead.
2016-07-11 16:43:29 -07:00
Rachel Fenichel
8e652db9fe Merge branch 'develop' of https://github.com/google/blockly into feature/pull_google/7_11 2016-07-11 15:53:14 -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
Tim Mickel
51f38c0c95 Add basic value reporting that uses drop-down ()
* Add basic value reporting that uses drop-down

* Encode HTML entities for value reporting
2016-07-07 18:35:41 -04:00
Rachel Fenichel
13c6c63daa Create variables from the flyout 2016-07-07 14:39:45 -07:00
Rachel Fenichel
cb3bef8f32 Flyout button with click handler 2016-07-07 14:37:12 -07:00
Neil Fraser
555eac8b7f Simplify field validator chaining. 2016-06-29 17:44:12 -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
Rodrigo Queiro
2dcb6cb68b Ignore mouseup at end of drag with isDragging ()
This includes both block drags and workspace scrolls and fixes . I
used isDragging rather than checking the origin of click so that it can
easily be extended to the case where the flyout is scrolled by dragging
a block, a la .
2016-06-28 18:11:48 -07:00
Tim Mickel
d98844de34 Getters for getters for workspace's flyout and flyout's workspace; give blocks unique ID from flyout blocks () 2016-06-23 18:17:36 -04:00
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
Rachel Fenichel
a234506324 Merge branch 'develop' into feature/cache_screen_ctm 2016-06-21 15:57:53 -07: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
c4cad3c6e4 Cache screen CTM for performance improvement. 2016-06-17 14:26:04 -07:00
Rachel Fenichel
8f601345bb cache delete areas instead of recalculating them onMouseDown 2016-06-17 12:39:18 -07:00
Neil Fraser
fd6f743f0e Remove unneeded generated parens around function calls in indexOf blocks. 2016-06-13 18:49:18 -07:00
picklesrus
6851baea12 Fix . Attash the resize handler to the workspace so it can be removed ()
when workspace.dispose() is called.
2016-06-13 14:46:58 -07:00
Tim Mickel
e7477f63f0 Fix duplicate deleteOption code from merge of workspace_svg () 2016-06-06 17:20:27 -04:00