Commit graph

103 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
Neil Fraser
36130cbc39 Don't fire change event on fields that haven't been named yet. 2016-06-15 01:30:04 -07:00
Neil Fraser
04ebbb3b76 Fix undo on fields with validators with side effects. 2016-06-14 18:42:49 -07:00
Tim Mickel
bde38f4dbe Properly center text in fields based on calculated width ()
* Properly center text in fields based on calculated width

* RTL fix for horizontal centering of fields

* Add comments for RTL case
2016-06-14 17:32:36 -04:00
Tim Mickel
82cc3b6a1c Initial pass of vertical reporter rendering ()
* Smaller minimum Y for blocks with outputConnection, single field

* Vertical centering of inline connections

* Update cursorX to include input width

* Add new MIN_BLOCK_X for blocks with output

* Re-add vertical Y padding for inline inputs

* Use the correct row height in vertical centering

* Only pad input.renderHeight for input connections

* Add rounded corners for reporters

* Update "equals" block output type

* Add drawing boolean pointy shape

* Adding field corner radii to vertical; fixing max height.

* Removing extra console.log

* Correcting vertical FIELD_WIDTH and FIELD_WIDTH_MIN_EDIT

* Correct vertical FIELD_TOP_PADDING

* Use getSize() in field.init

* Fix spacing in renderDrawRight_
2016-06-08 17:13:44 -04: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
3605dfb9c0 Undo decimation of variable redeclarations 2016-05-10 14:40:48 -07:00
Rachel Fenichel
640b38f38e lint 2016-05-05 13:13:48 -07:00
Tim Mickel
f212b10870 Vertical demo blocks
* Implement example text-based vertical blocks

* Add vertical FIELD_TOP_PADDING (fix )

* Make MAX_DISPLAY_LENGTH per horizontal/vertical

Fixes 

* Vertical dark mode and playground disclaimer

* Remove generator reference from vertical demo
2016-05-05 16:13:43 -04:00
Tim Mickel
33a71b112f Implement number and string field specs ()
* Animate the font-size of text fields

* Allow WidgetDiv to hide immediately, no animation

And add calls to this where the div animation may become out of sync with the field itself.

* Fix CSS colour substitution to replace all

* Add box-shadow to text field

* Fix padding on blocklyHtmlInput

* Add utility for measuring text using canvas

* Grow the input textbox based on the text size

* Fix the text field width to a maximum depending on render mode

* Fix text input field height for scaling

* Position text input field based width

* Animate out width, height, margin of text input

* Fix scale of marginLeft and extra 1px

* Fix height, padding, font-weight on text input field

* Make input field text smaller on truncation per spec

* Re-apply change to Blockly.WidgetDiv.disposeAnimationTimer_

* Add comment to Blockly.Field.maxDisplayLength
2016-04-15 16:44:30 -04:00
Tim Mickel
2fc35e5797 Add comments and CSS style for field refactor 2016-04-05 20:43:54 -04:00
Tim Mickel
e413d47f4d Remove borderRect_, clean up, and fix RTL 2016-04-05 12:19:01 -04:00
Neil Fraser
4ac1204550 Set field.sourceBlock in headless Blockly. 2016-04-04 17:47:15 -07:00
Rodrigo Queiro
46ed2fa129 Merge pull request from drigz/bugfix/field-active-area
Increase active area on one-field-blocks 
2016-04-04 11:09:55 +02:00
Rodrigo Queiro
a6a39fb49b Use text cursor on whole of horizontal input field
We do this by applying the style to the same element we apply the click
target to, ie the whole block if it only has one field.
2016-04-04 11:07:20 +02:00
Tim Mickel
a65109f423 Merge remote-tracking branch 'Google/master' into google-master-april-1
# Conflicts:
#	blockly_compressed_horizontal.js
#	blockly_uncompressed_vertical.js
#	blocks_compressed.js
#	core/block.js
#	core/block_svg.js
#	core/blockly.js
#	core/connection.js
#	core/field_textinput.js
#	core/workspace_svg.js
#	generators/lua/lists.js
#	generators/lua/text.js
#	msg/js/he.js
#	msg/js/id.js
#	msg/js/sr.js
#	msg/js/zh-hant.js
#	msg/json/en.json
2016-04-01 14:44:46 -04:00
Rodrigo Queiro
4daf3cd16f Increase active area on one-field-blocks
If a block only has one field, the mouseup event (which triggers editing
of editable fields) will be bound to the block instead of the field.

Fixes .
2016-03-31 16:43:17 +02:00
Neil Fraser
ac0b5e7871 Use ENUM for dragMode. Blocks no longer sticky when created from disappearing flyout. 2016-03-29 08:36:11 -07:00
Neil Fraser
d086634394 Lint and recompile. 2016-03-18 15:19:26 -07:00
Ray Schamp
9d82e79e9c Update inputs to match spec 2016-02-23 16:59:53 -05:00
Neil Fraser
63c112932b Rename Field.setChangeHandler to Field.setValidator 2016-02-10 14:33:13 -08:00
Neil Fraser
c429949a4e Add Create, Delete, and Change events.
Not counting change for mutators.
2016-01-20 19:11:03 -08:00
Neil Fraser
36fe3994c9 Misc cleanup. 2016-01-15 15:36:06 -08:00
Neil Fraser
890d8d8d73 Fix zoom center button. Reverse disconnect wiggle. 2015-09-22 17:28:51 -07:00
Troy McKinnon
6d6716c3d3 adding type annotations 2015-09-22 13:32:14 -05:00
Neil Fraser
6f2f3914f6 Double rendering speeds by adding a cache to prevent repeated calls to getComputedTextLength. 2015-09-15 16:20:13 -07:00
Neil Fraser
db940ca493 Fix reversed height and width on image fields. 2015-09-07 18:52:07 -07:00
Neil Fraser
f601bdc3c7 Fix FF editor location by a pixel. 2015-08-21 14:13:07 -07:00
carlosperate
055c11155d Update getScaledBBox_ to return new object to fix issue in IE. 2015-08-21 18:51:25 +01:00
Neil Fraser
5b7fec7092 Add zooming feature.
By carloslfu.
2015-08-19 17:21:05 -07:00
Neil Fraser
94d3b6f4ea Add ellipsis to long fields. 2015-07-21 18:24:07 -07:00
Neil Fraser
45fd0e9d44 Remove unused field clone. 2015-07-20 16:17:21 -07:00
Neil Fraser
09f5ac6f7b Remove non-functioning workspace long-click. 2015-07-13 17:48:50 -07:00
Troy McKinnon
68dbb71610 adding missing type documentation to public fields 2015-07-13 16:44:11 -05:00
Neil Fraser
9050e32954 Adding JsonInit method of creating blocks. 2015-06-08 15:54:18 -07:00
Neil Fraser
17961f7f58 Support multiple Blockly instances. 2015-04-28 13:51:25 -07:00
Neil Fraser
a494cbf0e7 Don't allow connections twixt immovable blocks. 2015-02-25 18:07:04 -08:00
Neil Fraser
c9addf7e31 Improve accuracy of goog.require calls. 2015-02-06 15:27:25 -08:00
Neil Fraser
1c39a638e3 Lint fixes. 2015-01-22 15:58:10 -08:00
Neil Fraser
7e47df59a9 Routine recompile. 2015-01-15 14:29:42 -08:00
Neil Fraser
3a14ea3952 Merge pull request from BrianGeppert/bugfix/dont-ignore-ios-events
Don't ignore touch events on iOS 7.1.2 or later.
2015-01-15 14:11:41 -08:00
Neil Fraser
a624b5d2da Hide hidden fields (issue 37). 2015-01-05 12:04:01 -08:00
Neil Fraser
48bffac316 Partially fix mutators (issue 38). 2015-01-01 14:30:37 -08:00
Neil Fraser
df89e1060a Remove some DOM creation from headless fields. 2014-12-24 00:22:01 -08:00
Neil Fraser
0f8d01209c Headless workspaces and blocks. 2014-12-23 11:22:02 -08:00
Brian Geppert
0b06776404 Don't ignore touch events on iOS 7.1.2 or later. 2014-12-07 11:35:41 -06:00
Neil Fraser
6539211104 Change official project URL. 2014-10-07 13:09:55 -07:00
Neil Fraser
7122410373 Changing project location from Google Code to GitHub. 2014-09-08 15:18:02 -07:00
Neil Fraser
d998a1c8ec Update to latest version. 2014-09-08 14:26:52 -07:00
ellen.spertus
6ee38cdec3 Automatic commit Tue Jan 28 03:00:09 PST 2014 2014-01-28 03:00:09 -08:00