- allows scrolling by dragging a block up and down
- dragging a block towards the workspace creates it
- dragging a block any direction in a non-scrollable flyout creates it
- dragging a shadow block works properly
- clicks on fields in non-closeable flyouts always open editors
- clicks in closeable flyouts create the block but don't open editors
Fixes#385 and fixes#405.
* 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
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.
* 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
* 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
* 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.
* 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
* Localisation updates from https://translatewiki.net.
* Initialize generated JS and Dart variables in one line.
* proxy option for build.py
* Localisation updates from https://translatewiki.net.
* Revert "proxy option for build.py"
* Prevent sounds from playing on top of each other.
* Routine recompile.
* Remove sound and animation on delete during undo/redo.
* Accessible demo (#373)
* adding a folder in demos for blind and setting up the package.json file for development. Adding package.json to .gitignore
* removing gitignore~ file
* copied blind blockly demo code over. set up a new dev environment. Up for review: the blind blockly demo code. Much of the drop downs don't actually do anything, but a general look at the way angular is used would be helpful in shaping future development.
* adding an index file that was being ignored by .gitignore
* adding required angular files and libraries previously ignored by git add --a for some unknown reason.
* starting work on toolbox
* got workspace and toolbox connected. Copy to workspace annd copy to clipboard working at 80%.
* cleaning up autogenerated files
* adding my own files. Not sure why the test files are being added.
* cleaning up comments
* removed empty html_formatter.html file from project and put on git ignore list. The file is used on my end to help with formatting the html in javascript files.
* getting rid of unnecessary html_formatter file
* removing merge conflicts
* cleaned up comments
* cleaned up comments, organized file structure, made ToolboxXML a file that can be changed by other developers porting this code, added copyright and file summaries to js files, linted files, moved third party libraries to lib folder
* removing lint files that shouldn't be tracked.
* Made the clipboard a service instead of multiple pieces embedded within the app. Not sold on the name ClipboardService. Open to suggestions.
* syncing up demo updates
* adding insert block menus above and below appropriate blocks.
* hacky version of getting code to run.
* changing toolbox to be a menu. making both the toolbox and workspace ordered lists
* adding new folder dev-old containing a version of blind blockly that uses nested lists for the toolbox
* getting rid of menubar experiment
* adding treeview shenanigans part 1
* adding treeview experiment page and finishing up treeview.
* getting a treeview implementation working in the toolbox
* creating a fishfood folder for fishfood development
* making first level of fishfood
* fixing something
* adding index file for fishfood
* beginning merging the treeview system.
* creating two treeviews
* fishfood level 1 without working music blocks
* fixes to treeview navigation
* final fishfood features done
* adding support for toolboxes without categories
* beginning integration of Sean's new music code
* adding Sean's music blocks and beginning music_player integration.
* merged Sean's music block code into fishfood
* merged Sean's music code and fixed treeview bug with toolbox when no categories
* adding blank_demo
* fixing tab navigation.
* fixing bug with shift-tab. New bug found in alt+tab not opening dropdown?
* fixing labels
* fixing bugs and finding more.
* removing dropdowns in favor of buttons part 1. Still need to change field options.
* index.html for blank_demo
* beginning cleanup
* adding blockly- prefix to label ids.
* integrating AccessibleBlockly with Blockly library.
* remove closure library
* removing testing files that aren't in develop
* removing all demo stuff for a later pull request
* removing gitignore file that doesn't exist in developer branch
* syncing with develop branch files
* removing music files from this pull request
* doing some lint cleanup
* rolling back accidental package.json change
* removing var blocklyApp = blocklyApp || {} from each extraneous file
* adding last debug statement
* changed name of inputType function
* renaming _service arguments
* fixing function names
* fixing all comments.
* fixing minor comments
* renaming variables, etc
* fixing bugs that break demo. Adding the run code and clear workspace buttons back to the workspaceview as their current position breaks tab navigation.
* fixing minor comments
* fixing function names, etc.
* adding comments to getInputTypeLabel function
* removing addClass() calls from the template
* small change to clipboardService
* splitting getCategoryDependantId into two functions: getCategoryId and setActiveDesc
* fixing minor bug with last commit
* using conditional attributes to remove setActiveAttributes function from treeService and do same work in template.
* deleting unnecessary comment created in previous commit.
* adding a utilsService to remove duplicated code.
* changing function names in utilsService
* changing delete to [delete] to allow HTMLText functions to return an empty string instead of undefined. Also renaming concatStringWithSpaces to generateAriaLabelledByAttr
* generating ids in ngOnInit instead of on the fly, allowing us to use [attr.aria-labelledBy] in the template instead of using setLabelledBy(element). Deleting function utilsService.setLabelledBy.
* fixing small bug with tree service left arrow: was throwing an error when you can't go any further left.
* reformatting html to make it easier to read.
* moving from importing the xml file to using an xml toolbox in the demo.
* fixing minor bugs and removing code relevant only to the music game.
* minor fixes
* adding alerts to copy, paste, and mark actions. renaming blocklyApp.TreeView to blocklyApp.WorkspaceTreeView
* Beginning to add Blockly.msg strings.
* making sure index file is being tracked
* adding all demo bits
* removing demo files from this pull request
* fixing providers, some linting, and removing getInfo() function.
* adding small todo comment for sll@
* adding minimal blockly accessible demo
* removing unnecessary files
* putting package file back
* fixing package file
* fixing msg file
* fixing boot.js file
* fixing boot.js file
* fixing indentation on boot
* fixing indentation on index file.
* AccessibleBlockly (#354)
* adding a folder in demos for blind and setting up the package.json file for development. Adding package.json to .gitignore
* removing gitignore~ file
* copied blind blockly demo code over. set up a new dev environment. Up for review: the blind blockly demo code. Much of the drop downs don't actually do anything, but a general look at the way angular is used would be helpful in shaping future development.
* adding an index file that was being ignored by .gitignore
* adding required angular files and libraries previously ignored by git add --a for some unknown reason.
* starting work on toolbox
* got workspace and toolbox connected. Copy to workspace annd copy to clipboard working at 80%.
* cleaning up autogenerated files
* adding my own files. Not sure why the test files are being added.
* cleaning up comments
* removed empty html_formatter.html file from project and put on git ignore list. The file is used on my end to help with formatting the html in javascript files.
* getting rid of unnecessary html_formatter file
* removing merge conflicts
* cleaned up comments
* cleaned up comments, organized file structure, made ToolboxXML a file that can be changed by other developers porting this code, added copyright and file summaries to js files, linted files, moved third party libraries to lib folder
* removing lint files that shouldn't be tracked.
* Made the clipboard a service instead of multiple pieces embedded within the app. Not sold on the name ClipboardService. Open to suggestions.
* syncing up demo updates
* adding insert block menus above and below appropriate blocks.
* hacky version of getting code to run.
* changing toolbox to be a menu. making both the toolbox and workspace ordered lists
* adding new folder dev-old containing a version of blind blockly that uses nested lists for the toolbox
* getting rid of menubar experiment
* adding treeview shenanigans part 1
* adding treeview experiment page and finishing up treeview.
* getting a treeview implementation working in the toolbox
* creating a fishfood folder for fishfood development
* making first level of fishfood
* fixing something
* adding index file for fishfood
* beginning merging the treeview system.
* creating two treeviews
* fishfood level 1 without working music blocks
* fixes to treeview navigation
* final fishfood features done
* adding support for toolboxes without categories
* beginning integration of Sean's new music code
* adding Sean's music blocks and beginning music_player integration.
* merged Sean's music block code into fishfood
* merged Sean's music code and fixed treeview bug with toolbox when no categories
* adding blank_demo
* fixing tab navigation.
* fixing bug with shift-tab. New bug found in alt+tab not opening dropdown?
* fixing labels
* fixing bugs and finding more.
* removing dropdowns in favor of buttons part 1. Still need to change field options.
* index.html for blank_demo
* beginning cleanup
* adding blockly- prefix to label ids.
* integrating AccessibleBlockly with Blockly library.
* remove closure library
* removing testing files that aren't in develop
* removing all demo stuff for a later pull request
* removing gitignore file that doesn't exist in developer branch
* syncing with develop branch files
* removing music files from this pull request
* doing some lint cleanup
* rolling back accidental package.json change
* removing var blocklyApp = blocklyApp || {} from each extraneous file
* adding last debug statement
* changed name of inputType function
* renaming _service arguments
* fixing function names
* fixing all comments.
* fixing minor comments
* renaming variables, etc
* fixing bugs that break demo. Adding the run code and clear workspace buttons back to the workspaceview as their current position breaks tab navigation.
* fixing minor comments
* fixing function names, etc.
* adding comments to getInputTypeLabel function
* removing addClass() calls from the template
* small change to clipboardService
* splitting getCategoryDependantId into two functions: getCategoryId and setActiveDesc
* fixing minor bug with last commit
* using conditional attributes to remove setActiveAttributes function from treeService and do same work in template.
* deleting unnecessary comment created in previous commit.
* adding a utilsService to remove duplicated code.
* changing function names in utilsService
* changing delete to [delete] to allow HTMLText functions to return an empty string instead of undefined. Also renaming concatStringWithSpaces to generateAriaLabelledByAttr
* generating ids in ngOnInit instead of on the fly, allowing us to use [attr.aria-labelledBy] in the template instead of using setLabelledBy(element). Deleting function utilsService.setLabelledBy.
* fixing small bug with tree service left arrow: was throwing an error when you can't go any further left.
* reformatting html to make it easier to read.
* moving from importing the xml file to using an xml toolbox in the demo.
* fixing minor bugs and removing code relevant only to the music game.
* minor fixes
* adding alerts to copy, paste, and mark actions. renaming blocklyApp.TreeView to blocklyApp.WorkspaceTreeView
* Beginning to add Blockly.msg strings.
* making sure index file is being tracked
* adding all demo bits
* removing demo files from this pull request
* fixing providers, some linting, and removing getInfo() function.
* adding small todo comment for sll@
* adding minimal Accessible Blockly demo
* removing demo: accidentally committed to wrong branch
* fixing Blockly.Msg string bugs
* fixing TODOs
* package file changed by an automerge. Changing back.
* addressing sll's comments. Creating shim for utilsService functions.
* fixing comments, changing fieldview to deal with this.field.
* fixing clipboard service bug
* fixing focus bug when editing a text input.
* fixed clipboard bug and added README
* fixing workspaceview not to implement on runCode() function and adding note to README
* Cleanup accessible Blockly.
* Recompile May 24
from getting selected. Use e.preventDefault instead of adding and removing
classes on mousedown and mouseup. This keeps the browser from having to
potentially recacluate style on mousedown and mouseup events.