clarkyblade / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Feature Request: Multiple workspaces on one page #94

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just did some work for a proof of concept to get Blockly working as an input 
type for the IPython web notebook: sorry, no demo up yet, but here's the code:
https://github.com/bollwyvl/ipython/tree/blockly

Once you create a second cell, the behavior becomes a bit erratic, as the 
various events fire in both instances.

I opted to go with the iframeless implementation (like demos/RTL), as it seemed 
a bit simpler, but could go that route if that would help: perhaps multiple 
iframes could install themselves as different Blocklys (instead of 
window.Blockly), and downstream code could keep that specific Blockly around in 
a callback scope.

Long term though, it would be nice to be able to embed multiple instances 
directly... right now, there are 67 places where mainWorkspace is mentioned, so 
I wouldn't even know where to start!

Original issue reported on code.google.com by nick.bollweg@gmail.com on 16 Dec 2012 at 3:28

GoogleCodeExporter commented 9 years ago
Multiple workspaces are trivial if you use multiple iframes.  See the block 
factory as an example:
http://blockly-demo.appspot.com/blockly/demos/blockfactory/index.html

The 'preview' is a second Blockly instance.

Original comment by neil.fra...@gmail.com on 16 Dec 2012 at 4:07