Commit graph

1448 commits

Author SHA1 Message Date
Tim Mickel
179b75da59 Basic fixes for FieldColour (#482)
* Fix field_colour's borderRect_ problem

* Use actual width and height instead of NBSPs

* Get corner radius from BlockSvg

* Improve colour picker CSS to not have borders
2016-07-06 20:38:05 -04:00
joaoh1
13d730cc14 Add Pen Blocks and Sound Blocks (#475)
* Add Pen Blocks

It excludes "set pen block to [color]" Block

* Include Pen Blocks at Vertical Playground

* Fixed a little thing

* Added Sound Blocks and fixed Fake Drags

* Fixed again the same problem

Accidentaly added again

* Update vertical_playground.html

* Fixed Pen Order

* Update sound.js

* Update sound.js
2016-07-06 19:50:49 -04:00
Tim Mickel
10a4db1085 Fix duplicate input shapes #451 (#479) 2016-07-06 17:38:58 -04:00
Tim Mickel
0d91c15b31 Fix restrictor on Firefox (#478) 2016-07-06 17:33:47 -04:00
Tim Mickel
146697c0de Resolve #454 by causing bump for all cases (#480)
* Resolve #454 by causing bump for all cases

* Remove extra branch
2016-07-06 17:27:28 -04:00
Tim Mickel
5be060e9c7 Base FieldTextInput radius on output shape, not field type. (#476) 2016-07-06 15:56:45 -04:00
Tim Mickel
6b972ae7c8 Fix disabled menu style #474 (#477)
There was a missing comma in CSS
2016-07-06 15:56:39 -04:00
Tim Mickel
373dbf348f Recompile July 5 (#472) 2016-07-05 10:30:26 -04:00
Tim Mickel
c7fa4cb8e5 As a demo, round string-type outputs (#469) 2016-07-05 10:05:56 -04:00
Tim Mickel
367aaa1cf1 Add some more blocks (#468)
* Lint & menu color for keys

* Update colours to provided spec

* Finish current set of motion blocks

* Add say/think blocks; remove WeDo blocks
2016-07-05 09:58:16 -04:00
joaoh1
cd93612295 Add "When key pressed" block from Scratch 2.0 (#467)
* Add "When key Pressed" Block (Options: A to N)

+ Added "When key Pressed" Block (Contains A to N Keys, Arrows, Space and Any Options)

* Delete event.js

* Rename event.js to blocks_vertical/event.js

* Delete vertical_playground.html

* Rename vertical_playground.html to tests/vertical_playground.html

* Finished Key Options

It's better to fix the Dropdown Thing

* Fixed "When Key Pressed" Block
2016-07-05 09:20:43 -04:00
Tim Mickel
5c557bdfd3 Fix check for flyoutWorkspace in block (#466) 2016-07-01 12:50:13 -04:00
Tim Mickel
8c1033372f Add hide, show blocks, direction reporter (#465) 2016-07-01 12:46:42 -04:00
Tim Mickel
e94765b0ef More motion and looks blocks (#464)
* Add more motion blocks: set/change x/y, x/y reporters

* Add selection of looks blocks; recompile
2016-06-29 23:42:06 -04:00
Tim Mickel
218975f2ad Add a few Scratch 2.0 motion blocks (#462)
* Add a few motion blocks

* Add constants to blocks build path

* Add "go to X Y" block

* Recompile June 29
2016-06-29 20:47:16 -04:00
rachel-fenichel
9f1186216d Merge pull request #461 from rachel-fenichel/feature/checkbox_json
Add json property for adding a checkbox in the flyout
2016-06-29 14:14:41 -07:00
Rachel Fenichel
c79f4929dd Add json property for adding a checkbox in the flyout 2016-06-29 13:38:07 -07:00
rachel-fenichel
ef283c8537 Merge pull request #452 from rachel-fenichel/feature/checkboxes_in_flyout
Checkboxes in the flyout
2016-06-29 13:18:12 -07:00
Rachel Fenichel
6e0c4ef80a Prevent default on checkbox click. 2016-06-29 13:17:45 -07:00
Rachel Fenichel
6539a634b6 Fix lots of small things in flyout.js 2016-06-24 14:32:58 -07:00
Rachel Fenichel
9fa9fd93c6 Merge branch 'develop' into feature/checkboxes_in_flyout 2016-06-23 16:14:41 -07:00
Tim Mickel
553c825d7a Separate output edge shapes from output types (#447)
* Separate output shape from type checking.

* Fix enum check in actual output shape rendering.

* Add output shapes for most relevant blocks.

* Bring back and update output shapes for unoccupied connections.

* Fix output shapes for boolean-type operators

* Update type-checking in blocks to match Scratch 2.0
2016-06-23 19:04:20 -04:00
Tim Mickel
d98844de34 Getters for getters for workspace's flyout and flyout's workspace; give blocks unique ID from flyout blocks (#450) 2016-06-23 18:17:36 -04:00
Tim Mickel
2fa746d408 Alternate version of #429 with min/max/precision (#434)
* Add textinput restrictor and FieldNumber use

* Update FieldNumber to remove validator and add appropriate restrictor

* Update blocks for new restrictors

* Remove restriction on FIELD_WIDTH_MAX_EDIT

* Remove extra console.log

* Version of FieldNumber that brings back min/max/precision

* opt_validator order to match Blockly

* Math.floor(precision) == precision

* Fixing JSDoc

* Invert decimalAllowed_

* Reverse opt_validator positioning per Neil

* Don't allow typing 'e', per design meeting

* Update for agreed-upon API

* Allow NaN constraints per agreement

* Remove optional parameters from math.js blocks

* Recompile 2, June 23

* Correct JSDoc for optionals
2016-06-23 12:44:01 -04:00
Tim Mickel
ca3275eaf0 Merge google/develop June 22 (#441)
* 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. (#386)

* 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 #307.

* 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 (#403)

* Fix typo in flyout.js (#402)

* Line wrap comments in generated code.

* Remove reference to undefined variable (#413)

REASON_MUST_DISCONNECT was removed by a refactor in 2a1ffa1.

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

Probably broken in 266e2ffa9a.

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

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

* 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 (#419)

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. (#422)

This fixes #420 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 #415.

* 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 #425. Attash the resize handler to the workspace so it can be removed (#429)

when workspace.dispose() is called.

* Change the TreeService to a singleton.

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

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

* Updating URLs to reflect new docs. (#418)

* 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 (#434)

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 (#433)

* 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). (#443)

* 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
991dba00fa Horizontal width calculation and notch flattening (#436)
* Horizontal width calculation and notch flattening

* Fix comment ("include width of notch in block width")
2016-06-21 16:22:02 -04:00
Tim Mickel
d106b41b50 Replacement marker glow similar to Scratch 2.0 (#437)
* Replacement marker glow similar to Scratch 2.0

* Update REPLACEMENT_GLOW_RADIUS=2
2016-06-21 16:20:37 -04:00
rachel-fenichel
789dc986b4 Merge pull request #417 from rachel-fenichel/bugfix/fix_connection_tests
Make tests pass
2016-06-21 12:58:49 -07:00
Tim Mickel
f1c7cae728 Remove maxBlocks (fix #309) (#435)
* Remove `maxBlocks` (fix #309)

* Also remove filterForCapacity_

* More references to remainingCapacity
2016-06-21 15:54:03 -04:00
Tim Mickel
5593307e75 Move actual position of output connection and remove rendering adjustment (#427) 2016-06-17 13:37:06 -04:00
Tim Mickel
fa992e9f86 Add CONNECTING_SNAP_RADIUS and potentially fix #290 (#422)
* Add CONNECTING_SNAP_RADIUS and potentially fix #290

* Put back Blockly.SNAP_RADIUS
2016-06-17 13:31:12 -04:00
Tim Mickel
2350e842dc Improve sprinkles by using domToBlock (#431)
* Improve sprinkles by using domToBlock

* Also improve horizontal sprinkles
2016-06-17 13:30:40 -04:00
Tim Mickel
f5dc882389 Always update previews for output connections. (#428)
* Always update previews for output connections.

* Move output updatePreviews check to if/else
2016-06-16 17:56:38 -04:00
Tim Mickel
60b125f406 Add handler for DOM input event to field_textinput (#420)
* Add handler for DOM input event to field_textinput

* Move resizeEditor_ commands inside onHtmlInputChange_ conditionals
2016-06-16 14:32:39 -04:00
Tim Mickel
96192ab1d8 Recompile June 15 (#419) 2016-06-15 18:21:30 -04:00
Tim Mickel
051921e1a0 Fix up vertical text field editor (#415)
* Move animated FONTSIZE properties to horizontal/vertical-specific rendering

* Set FIELD_WIDTH_MAX_EDIT in vertical until we fix truncation problem

* Conditional animation/truncation of field_textinputs

* Tinker with constants to get things in the right position

* Adjust FIELD_WIDTH_MAX_EDIT

* Prefix FONTSIZE_INITIAL and FONTSIZE_FINAL

* Fix no-op
2016-06-15 18:08:32 -04:00
Rachel Fenichel
fd67f358e8 Make tests pass 2016-06-15 14:34:02 -07:00
rachel-fenichel
4f28d1fb61 Merge pull request #414 from rachel-fenichel/feature/allow_terminal_replacement
Insertion markers and replacement markers for value inputs and termin…
2016-06-15 10:57:56 -07:00
Rachel Fenichel
1fcc7047ba Insertion markers and replacement markers for value inputs and terminal blocks 2016-06-15 10:56:38 -07:00
Tim Mickel
b9d931afd3 Recompile June 14 (#409) 2016-06-14 17:52:53 -04:00
Tim Mickel
bde38f4dbe Properly center text in fields based on calculated width (#405)
* 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
25e80c2d09 Straw-man implementation of text drop-downs (#407)
* Refactor drop-down positioning to encapsulate block positioning

Moves block-positioning logic to the DropDownDiv class. Since icon menus use a special offset for the secondary mode, add an option for that.

* Swap out field_dropdown's use of WidgetDiv with DropDownDiv

* Update CSS for goog-menus in DropDownDivs

* Fix hiding behavior when showEditor_ is called again
2016-06-14 17:08:14 -04:00
Tim Mickel
7c35d4e6f5 Remove all styles when hiding text-input (#408)
Fixes #406
2016-06-14 16:34:24 -04:00
Tim Mickel
85578d8c7c Color fixes for text drop-down menus (#403)
* Add class for drop-down text colour; remove arrow special case

* Use secondary colours in drop-down blocks

* Add comment about updateTextNode_ resetting the class
2016-06-13 19:06:12 -04:00
Tim Mickel
55f2178dfa Draw empty "input shapes" for non-connected value inputs (#402)
* Add inputShapes_ collection to block_svg

* Draw empty "input shapes" for non-connected value inputs

* Reshuffle for insertion marker logic

* Reshuffle renderInputShape_ and better return comment

* Improve most comments for input shapes
2016-06-13 19:02:24 -04:00
Tim Mickel
bf66362d1c More blocks (#401)
* Add "then" text and a dummy input to control_if

* Add "then" text to if-else; add image to repeat

* Reshuffle of control blocks to match Scratch 2.0

* Add "wait until" block

* Add "repeat until" block.

* Add menu for "stop" block.

* Add "clone" blocks

* Add broadcast menu examples
2016-06-13 12:12:33 -04:00
Tim Mickel
980a1fbbee Convert mathop menu to a shadow block (#398) 2016-06-12 19:37:47 -04:00
Rachel Fenichel
d2145a3afb Merge remote-tracking branch 'upstream/develop' into feature/checkboxes_in_flyout 2016-06-10 13:10:41 -07:00
Tim Mickel
c93f546275 Fix output type of "length" block (#395) 2016-06-10 15:56:13 -04:00
Tim Mickel
42262e2b27 Fix block heights; conditionally flatten inner statement notch. (#392)
* Include height of notches in block height (#388)

Special-case: for a statement input, if there is no notch at the bottom of the stack, we need to subtract NOTCH_HEIGHT.

* No inner bottom notch on statement with no next (#385)

* Use lastConnectionInStack_ helper

* Remove redundant getHeightWidth in block_svg

* Rename lastConnectionInStack_ to public
2016-06-10 15:54:02 -04:00