Commit Graph

80 Commits

Author SHA1 Message Date
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
Neil Fraser
d6f84bff56 Do not allow importing of top-level shadow blocks. 2016-05-29 13:43:45 -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
Neil Fraser
217c681b86 Use direct call to svg resize rather than event. Also fix issue #296. 2016-05-04 15:00:57 -07:00
Neil Fraser
4e42a1b78e Swap order of arguments on domToWorkspace. 2016-04-04 18:31:41 -07:00
rachel-fenichel
ae1a0aab8a add isConnected() to connections. 2016-03-30 15:10:59 -07:00
Neil Fraser
6ae436a153 Add undo/redo context menu options on workspace. 2016-03-17 14:44:26 -07:00
Neil Fraser
b567d6b0d7 Allow shadow blocks to be edited. 2016-02-26 00:22:31 -08:00
Neil Fraser
6e6a04b879 Add X/Y coordinates and block ID to create event. 2016-02-16 21:57:22 -08:00
Neil Fraser
5297344a8b Fix RTL XML. 2016-02-16 13:04:47 -08:00
Neil Fraser
1d44036cf9 Add missing move when unshadowing and missing XY when deleting. 2016-02-12 19:34:51 -08:00
Neil Fraser
c429949a4e Add Create, Delete, and Change events.
Not counting change for mutators.
2016-01-20 19:11:03 -08:00
Neil Fraser
36fe3994c9 Misc cleanup. 2016-01-15 15:36:06 -08:00
Neil Fraser
4253de041a Remove old realtime. 2016-01-08 13:03:22 -08:00
Neil Fraser
a5ea93a1db Allow comments in flyouts. 2015-12-17 14:16:04 -08:00
Neil Fraser
3b3ef79fbd Create block id database. 2015-12-09 10:02:42 +01:00
Neil Fraser
6acaf35967 Add workspace.newBlock, deprecate Blockly.Block.obtain. 2015-12-07 16:40:45 +01:00
Troy McKinnon
11906b7535 improve type annotations 2015-11-10 17:28:46 -06:00
Neil Fraser
d07d103f1d Allow top-level shadow blocks via XML.
This is a terrible idea, but I generally allow developers wide latitude
in foot-shooting.
2015-10-24 23:53:07 -04:00
Neil Fraser
54ffdc5926 Don't allow shadow blocks to be deleted. 2015-10-21 12:58:52 -07:00
Neil Fraser
4468959909 Fix extra whitespace in shadow XML. Issue #196. 2015-10-12 22:25:00 -07:00
Neil Fraser
799835943a Shadow Blocks 2015-10-06 18:09:27 -07:00