Commit graph

196 commits

Author SHA1 Message Date
Tim Mickel
f1aac859e3 Stripping old blocks code; moving blocks -> blocks_common, project-wide lint ()
* Remove unused Blockly blocks

* Remove unused text Blockly blocks; convert to JSON

* Move blocks/ -> blocks_common/

* Recompile for moved/removed blocks

* Remove spectools

* Project-wide lint

* Recompile August 30

* Pin package.json
2016-08-30 15:50:59 -04:00
Rodrigo Queiro
5c80a82a5f Fix flip_rtl regression ()
See 
2016-08-30 11:09:43 -04:00
Rodrigo Queiro
468d899e04 Make jsonInit able to create dropdowns again
and add a test to detect future regressions.
2016-08-29 15:38:20 +02: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
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
c6ff049c92 Merge branch 'develop' into feature/variable_management 2016-08-12 14:39:32 -07:00
Rachel Fenichel
65d785a86d New message for deletion; block dispose is a noop if it's already been deleted 2016-08-09 17:17:08 -07:00
Sean Lip
d362c73a04 Allow a placeholder for empty fields to be specified when generating block descriptions. ()
* Allow a placeholder for empty fields to be specified when generating block descriptions.

* Correctly handle recursive block stringification.
2016-08-03 17:47:34 -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
joaoh1
b9b8284c5d Make Red the Color Placeholder () 2016-07-14 11:16:23 -04:00
Rachel Fenichel
3202fcbd0c Fix connection disposal and get rid of startFlyout_ 2016-07-12 15:15:35 -07:00
Neil Fraser
823bf3c5da Allow substituted strings in interpolation. 2016-07-12 11:24:39 -07:00
rachel-fenichel
52244856c6 Merge pull request from rachel-fenichel/feature/pull_google/7_11
Merge from upstream
2016-07-11 16:13:49 -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
Tim Mickel
d80b588a4a Fix angle picker: use drop-down div, Scratch-style direction ()
* Scratch-style FieldAngle, use DropDownDiv

* Use FieldAngle for pointindirection

* Fix FieldNumber JSON args

* Convert all math blocks to JSON

* Line length in field_angle

* Remove automatic injection of angleValidator
2016-07-11 16:57:04 -04:00
Tim Mickel
5c557bdfd3 Fix check for flyoutWorkspace in block () 2016-07-01 12:50:13 -04:00
Rachel Fenichel
c79f4929dd Add json property for adding a checkbox in the flyout 2016-06-29 13:38:07 -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
Tim Mickel
553c825d7a Separate output edge shapes from output types ()
* 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 () 2016-06-23 18:17:36 -04:00
Neil Fraser
0be0cc89c7 Second version of FieldNumber API. 2016-06-22 15:07:07 -07: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
Neil Fraser
98617d8ddc Move tokenizeIntepolation into Blockly.utils namespace. 2016-06-22 13:01:37 -07:00
Neil Fraser
732e9b0659 Start using field_number. 2016-06-21 04:10:32 -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
42262e2b27 Fix block heights; conditionally flatten inner statement notch. ()
* Include height of notches in block height ()

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

* Use lastConnectionInStack_ helper

* Remove redundant getHeightWidth in block_svg

* Rename lastConnectionInStack_ to public
2016-06-10 15:54:02 -04:00
Rachel Fenichel
2f4bc8a0b1 lint fixes 2016-05-24 14:17:43 -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
e28db7bc4e JS Doc and private 2016-05-10 15:46:51 -07:00
Rachel Fenichel
ae745dac80 block db doesn't belong in block.js 2016-05-10 15:45:19 -07:00
rachel-fenichel
7b1fdcb7c6 make tests work; make connext_ a member function. 2016-05-10 15:45:19 -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
Rachel Fenichel
d89d8a2113 Add lightweight field_number 2016-05-04 13:30:18 -07:00
Andrew Sliwinski
c42f554438 Remove deprecated code. Re GH-304 2016-05-03 15:01:48 -04:00
Tim Mickel
50ff6e4654 Implement field_number stub and num-pad on mobile ()
* Implement basic field_number type

* Add whole number and positive number

* Remove bad arguments for showEditor_

* Basic implementation and styling of num-pad

* Remove virtual keyboards; add selection and read-only

* Add editing for the number pad

* Add backspace button to number pad

* Fix text padding for font-weight and extra magic

* Don't show decimal point for integers

* Re-update default WeDo numbers

* Refactor and improve documentation of field_number
2016-04-26 21:32:29 -04:00
Tim Mickel
cf6725ba4c Implement drop-down menus and icon picker field ()
* Icon menu and drop-down stubs

* Recompile 4/15

* Fix stubs to draw shadow block for drop-down

* Fix rendering of shadow for icon menu

* Add arrow to dropdown button

* Add drop-down buttons to rest of examples

* Implementation of drop-down div including positioning

* Drop-downs take colours from the blocks

* Fix scaled secondary position of drop-downs

* Fix arrow positioning for RTL

* Use SVG parentNode for sizing dropdown

* Use transform for drop-down positioning

* Add basic DropDownDiv hide

* Add animation-in to dropdown

* More subtle drop-down animation and shadow

* Add icon menu example

* Use options style of Blockly FieldImage for drop-down

* Add default value for iconmenu

* Add example hover, active states for iconmenu buttons

* Update dropdown_icon example

* Implement icon-menu value handling and default value

* Add updating the parent block image field to dropdown

* Drop-down animates out; add hooks to hide for various Blockly happenings

* Add pointer cursor for drop-down icons

* Improve documentation for drop-downs and minor refactor

* Factor out getSrcForValue in iconmenu

* Blocks take on the icon of their icon-menu

* Add basic accessibility properties, similar to closure

* Remove extra drop-down example; update playgrounds

* Remove unnecessary colour overrides

* Add onHide, colour changing, fix references in dropdowndiv

* Flip arrow when the drop-down is rendered above

* Hide the icon menu drop-down on second tap of button

* Add preventDefault to button ontouchstart

* Updates to drop-down from Carl

* Add icon-menu placeholders and a crazy demo

* Fix naming to normalize (drop-down, DropDown)

* Add license header
2016-04-21 15:33:28 -04:00
Tim Mickel
f23100c52a Ignore shadow blocks in the context menu () 2016-04-20 13:18:10 -04:00
Tim Mickel
62509d41ad Slight refactor of colour handling; add additional properties ()
* Add and render opacity of blocks

* Add insertion marker colour and opacity

* Add goog.require for Colours in block.js

* Add color of text field during editing

* Add colour overriding upon injection

* Add colours to CSS at run-time injection

* Expand colour variables to include toolbox, flyout, scrollbars

* Example of dark mode in horizontal_playground

* Fix loop style for colours
2016-04-14 18:04:17 -04:00
Neil Fraser
194341f2e5 Allow use of setOutput (and friends) to change checks. Issue . 2016-04-06 16:27:25 -07:00
rachel-fenichel
3a07be9b5c Store a single global insertion marker instead on one per block 2016-04-06 14:57:16 -07:00
rachel-fenichel
002e470ccd ghost -> insertion marker 2016-04-06 14:42:12 -07:00
Neil Fraser
61b3fbfe11 Move block database to workspace. 2016-04-05 18:43:39 -07:00
Tim Mickel
3cbe49e37a Merge branch 'develop' of https://github.com/google/blockly into google-master-april-1
# Conflicts:
#	blockly_compressed_horizontal.js
#	core/block.js
#	core/block_render_svg_vertical.js
#	core/connection.js
#	core/inject.js
2016-04-01 15:00:44 -04: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
rachel-fenichel
1487a9e1d0 Merge pull request from rachel-fenichel/cleanup/block_remove_rendered
Move Blockly.Block rendered into Blockly.BlockSvg
2016-03-31 14:17:32 -04:00
rachel-fenichel
ae1a0aab8a add isConnected() to connections. 2016-03-30 15:10:59 -07:00
rachel-fenichel
7665066565 Move Blockly.Block rendered into Blockly.BlockSvg 2016-03-29 17:30:39 -07: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