Commit graph

292 commits

Author SHA1 Message Date
Rachel Fenichel
53d9c6b351 Merge branch 'develop' of https://github.com/google/blockly into feature/pull_upstream_6_01 2016-06-06 11:14:48 -07:00
Neil Fraser
57131165b0 Routine recompile 2016-06-03 16:12:59 -07:00
picklesrus
213469a479 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.
2016-06-03 16:11:55 -07:00
Rachel Fenichel
4841f136f1 More lint and eslint configuration. 2016-05-25 15:35:11 -07:00
Tim Mickel
94fa9bb5f5 Don't count shadows in workspace delete option ()
Fixes 
2016-05-24 17:38:10 -04:00
Tim Mickel
b2e7bd9ba5 Merge upstream may 24 ()
* 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 ()

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

* 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
2016-05-24 14:44:04 -04:00
Rachel Fenichel
59e065ae5b Merge branch 'develop' of https://github.com/google/blockly into feature/merge_upstream_horizontal_toolbox 2016-05-23 13:07:11 -07:00
Neil Fraser
0242238a44 Remove sound and animation on delete during undo/redo. 2016-05-21 06:14:33 -07:00
Neil Fraser
006bb36b89 Prevent sounds from playing on top of each other. 2016-05-21 05:55:24 -07:00
Rachel Fenichel
7896c56919 remove extra code in scrollCenter 2016-05-16 11:41:28 -07:00
Neil Fraser
29e10e0976 Routine recompile. 2016-05-14 03:50:35 -07:00
Tim Mickel
3fe1daa733 Fix glow to new getBlockById 2016-05-12 21:58:33 -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
77a8b92ac2 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-05-11 11:44:38 -07:00
Rachel Fenichel
32eed0d2f8 Merge branch 'develop' into cleanup/lint 2016-05-10 14:43:09 -07:00
Rachel Fenichel
3605dfb9c0 Undo decimation of variable redeclarations 2016-05-10 14:40:48 -07:00
Tim Mickel
2c91690580 .eslintrc no-redeclare update and a couple of lints ()
* Disable no-redeclare in .eslintrc

* Lint dragsurface_svg.js

* workspace_svg.js lint

* workspace_svg.js lint

* Horizontal rendering lint
2016-05-10 13:08:56 -04:00
Rachel Fenichel
640b38f38e lint 2016-05-05 13:13:48 -07:00
Katelyn Mann
ca16d1fefe An alternate (and less expensive) way to keep stuff outside of the blockly div
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.
2016-05-04 19:12:38 -07:00
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue . 2016-05-04 15:00:57 -07:00
Neil Fraser
554fe18ab9 Use direct call to comment's resize rather than event. 2016-05-04 14:49:00 -07:00
Tim Mickel
ab5a40550b Restore sounds in core Blockly ()
* Revert "Remove Blockly sound playing and replace with a callback"

This reverts commit fd9f6a6d00.

# Conflicts:
#	core/workspace_svg.js

* Refactor connectionUiEffect code; remove disconnectUiEffect

* Update sounds to ScratchJr defaults

* Remove now-unnecessary demos/audio

* Add event for playing sound externally
2016-04-26 13:09:11 -04:00
Tim Mickel
279db40f07 Implement stack glowing ()
* Update stack glow filter to spec

* Update rendering for glowBlock; add stubs for stack glow

* Add application of stack glow filter

* Add glow buttons to playground

* Partial final version of stack glow

* Set the drag shadow on the drag group instead of blocks

Prevents overriding of the stack glow filter

* Simplify generation of feFuncA table in stack glow
2016-04-26 13:04:37 -04:00
Rachel Fenichel
a27fe99be4 Merge branch 'develop' into feature/horizontal_toolbox_port 2016-04-25 14:25:36 -07: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
Neil Fraser
fd7d4a2bef Make scrollCenter public, remove zoomReset. 2016-04-21 04:52:43 -07:00
Neil Fraser
c785cabe40 Use more coordinates. 2016-04-19 23:24:42 -07:00
Katelyn Mann
b69ab459bd Fix bad merge. Commit 36e0764e57 and e39a0b7069 collided on their use/removal of the event param to one of the zoom functions. 2016-04-18 16:53:32 -07:00
Tim Mickel
1b560d7271 Allow WidgetDiv to hide immediately, no animation ()
* 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.

* Remove extra disposeAnimationTimer_ check
2016-04-15 14:09:15 -04:00
Neil Fraser
e08f0aa05b Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	core/workspace_svg.js
2016-04-14 00:25:25 -07:00
Neil Fraser
36e0764e57 Fix zoomToFit if there are no scrollbars. Issue . 2016-04-14 00:23:17 -07:00
Neil Fraser
701d828090 Merge pull request from picklesrus/doubleclick
Add event preventDefault() calls to the end of zoom button handlers s…
2016-04-11 17:47:56 -07:00
Katelyn Mann
e39a0b7069 Add event preventDefault() calls to the end of zoom button handlers so the
browser doesn't try to handle them itself.  This keeps it from selecting text
on double clicks.
2016-04-11 15:33:05 -07:00
Tim Mickel
c9515597e1 Move dragSurface.createDom up to inject.js 2016-04-07 23:00:33 -04:00
Neil Fraser
5e0c04dccd Merge branch 'master' into develop 2016-04-07 14:36:57 -07:00
rachel-fenichel
18a1550285 Horizontal toolbox layout with positioning at start or end. 2016-04-07 14:02:22 -07:00
rachel-fenichel
576830c309 Blockly.parseToolboxTree_ -> Blockly.Options.parseToolboxTree 2016-04-07 13:38:36 -07:00
Neil Fraser
61b3fbfe11 Move block database to workspace. 2016-04-05 18:43:39 -07:00
Neil Fraser
4e42a1b78e Swap order of arguments on domToWorkspace. 2016-04-04 18:31:41 -07:00
Tim Mickel
bc75b84aa8 Resize drag surface using only CSS 2016-04-02 16:24:47 -04:00
Tim Mickel
e8c0346378 Fix positioning of drag surface using relative container 2016-04-01 17:32:01 -04:00
Tim Mickel
5c0522638e Public dragSurface for BlockSvg 2016-04-01 17:05:43 -04:00
Tim Mickel
30d1c247cd Add drag surface sizing and translation 2016-04-01 16:40:59 -04:00
Tim Mickel
cbc38698d2 Add injection of the dragSurface 2016-04-01 16:32:56 -04: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
Tim Mickel
6a341a2193 Semicolon and note about startDragMetrics 2016-03-30 14:14:02 -04:00
rachel-fenichel
e2f1a6c843 Fix annotations 2016-03-29 14:26:56 -07:00
Tim Mickel
8bf0f97f63 Move scroll method to WorkspaceSvg 2016-03-29 14:23:34 -04:00
Tim Mickel
18960bcbf6 Refactor to remove duplicate scroll bounds logic 2016-03-29 13:12:20 -04:00