202 Commits

Author SHA1 Message Date
Rachel Fenichel b342fb2121 Fix problem with clearing flyout after a variable was deleted. 2018-01-02 16:42:28 -08:00
Rachel Fenichel 9b091a8f9e Update procedure generators 2018-01-02 16:27:17 -08:00
Rachel Fenichel d69519bdab Fix headless 2017-12-19 16:10:07 -08:00
Rachel Fenichel 4cd0b36944 Fix event ordering for variables created from XML implicitly 2017-12-19 14:25:52 -08:00
Rachel Fenichel 6218750207 Fix events for variable fields on new blocks; fix tests 2017-12-19 11:28:23 -08:00
Rachel Fenichel cc6eeb8c68 Clean up TODOs and move potential variable map to the flyout workspace 2017-12-07 10:43:12 -08:00
Rachel Fenichel 0909af76e5 Fix missing events for variable creation 2017-12-06 16:41:17 -08:00
Rachel Fenichel 1506a36b58 Fix events for variable renaming 2017-12-06 14:41:56 -08:00
Rachel Fenichel e4844cd120 Move getOrCreateVariable to variables.js 2017-12-05 13:08:01 -08:00
Rachel Fenichel 6bb048d1bb All tests pass 2017-12-04 14:29:16 -08:00
Rachel Fenichel 494c4882be Fix variable_map_test and variable_model_test 2017-12-01 14:05:37 -08:00
Rachel Fenichel 86e88aae92 Can now create a variable with the button in the flyout; drag a block with a variable out of the flyout; handle default variable names; and import and export variables 2017-11-30 16:30:58 -08:00
Rachel Fenichel b870c3ccb9 Allow variables of different types to share the same name. 2017-11-30 13:16:16 -08:00
Rachel Fenichel 222407c6ce Extract code for domToField_ 2017-11-30 12:08:01 -08:00
Rachel Fenichel d73337ad73 Extract fieldToDom into its own function 2017-11-30 11:24:57 -08:00
Rachel Fenichel 30716fbd78 switch to variabletype everywhere 2017-11-03 16:03:32 -07:00
Neil Fraser 2445a752b7 Resolve another 20 warnings. 2017-10-24 14:06:29 -07:00
Neil Fraser 4262b09002 Resolve 106 warnings. 2017-10-24 14:06:29 -07:00
Rachel Fenichel bd1d199058 Don't check typeof == undefined in variable deserialization (#1379) 2017-10-23 11:28:00 -07:00
picklesrus 5518873389 Revert "Remove all all instances calling setValue on variable fields with the name instead of the id" (#1296)
* Revert "Create WorkspaceViewport class (#1291)"

This reverts commit 6c00d77c9e.

* Revert "Remove all all instances calling setValue with name. (#1254)"

This reverts commit 8e8b6b27af.
2017-08-28 16:55:44 -07:00
marisaleung 8e8b6b27af Remove all all instances calling setValue with name. (#1254) 2017-08-24 14:34:01 -07:00
Neil Fraser fc8d4c90b4 Compatibility for Closure Compiler. (#1240) 2017-07-31 09:07:41 -07:00
marisaleung 733d869f8e Add VariableType checks. 2017-07-20 16:47:37 -07:00
marisaleung aff9c4867c Correctly named block events called. 2017-06-08 15:44:43 -07:00
marisaleung 7f873b12c4 Wrap Error in Try Finally Block. 2017-06-07 10:00:04 -07:00
marisaleung f7f664063b Deserialization variables at top. 2017-05-25 14:03:37 -07:00
marisaleung dc06872a37 Deserialization variables at top. 2017-05-24 15:29:46 -07:00
marisaleung ce4a84b3cf Include variables at top of serialization. 2017-05-24 10:53:44 -07:00
marisaleung 1cd8e1fcc1 Add type, id, and info to the generated xml.
Add xml tests for fieldToDom.
Update workspace tests to pass with new changes.
2017-05-19 15:47:39 -07:00
marisaleung d903b5e86b VariableMap and functions added. 2017-05-03 10:51:24 -07:00
Rachel Fenichel 85b4f5f1a8 Fix #969 2017-03-17 16:25:45 -07:00
Andrew n marshall 6e1ffe09c2 Adding Blockly.Xml.appendDomToWorkspace() (#962)
This is a copy (with additional comments) of PR #822 (and also #961) by @qnoirhomme with unrelated files removed. See #822 for full review.
2017-03-03 08:40:00 -08:00
Andrew n marshall e95991cba8 Adding @namespace annotations for JSDoc. (#900) 2017-02-01 09:10:35 -08:00
Tim Dawborn d55d9cbd9f Attempt to work around the IE/Edge bug where getComputedTextLength() throws an exception when the SVG node is not visible. This workaround forces a re-render, which in turn, forces a re-calculation of the node width once a block is inserted into the workspace SVG. This workaround is only executed on IE and Edge. See https://groups.google.com/forum/#!topic/blockly/T8IR4t4xAIY for the initial discussion of this issue. 2017-01-27 15:15:09 +11:00
Neil Fraser 4cda20dbbf Fix speling. 2016-11-19 02:40:11 -08:00
Rachel Fenichel 08efd1381c Merge pull request #640 from rachel-fenichel/feature/disallow_shadow_variables
disallow variables on shadow blocks
2016-11-03 16:59:07 -07:00
Rachel Fenichel e2e2a3e298 Disable resizing the workspace during clearing and loading from xml, as an optimization 2016-10-21 14:30:30 -07:00
Rachel Fenichel 3f9b40ff61 add option to skip exporting block ids in XML, and use it in the workspace factory 2016-10-05 16:49:19 -07:00
Rachel Fenichel 6a882ca2e8 disallow variables on shadow blocks 2016-09-23 18:19:16 -07:00
Rachel Fenichel cc9396d739 Prefer functions in workspaceSvg to functions in blockly.js 2016-08-19 14:13:20 -07:00
Rachel Fenichel f040929bd8 Merge remote-tracking branch 'upstream/develop' into feature/merge_develop 2016-07-15 13:07:07 -07:00
Rachel Fenichel dfe61087f0 Correctly update variable list when pasting code 2016-07-14 15:39:41 -07:00
Neil Fraser e849c93db9 Merge branch 'master' into develop 2016-07-08 16:52:18 -07:00
Neil Fraser 2dab19c015 Ensure that if a procedure call exists, so does its definition.
Specifically, if a call is copied, then the def is deleted, then the
call is pasted, the def should be created.
2016-07-08 15:50:09 -07:00
Rachel Fenichel 4a81ecb601 Create variable list, and use it for add and rename 2016-07-07 14:38:56 -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
Neil Fraser 8c94a16bc6 Fix error when undoing a shadow block replacement. Issue #415. 2016-06-10 18:19:25 -07:00
Neil Fraser 57131165b0 Routine recompile 2016-06-03 16:12:59 -07:00
picklesrus 213469a479 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.
2016-06-03 16:11:55 -07:00
Neil Fraser 1db8092f15 Do not allow shadow blocks to have non-shadow children. 2016-05-29 14:53:29 -07:00