#Bloccoli ###A Modular Blockly Programming Environment ###Very Much in Beta. No Saves are Sacred.
Building on my thoughts from this post.
Adding a rough interface to browse and discover projects.
Replace the "HTML" and "DOM" modules with a single "jQuery" one, basically wrap that whole library for the sake of DOM manipulation.
Refactor. I want to try out this RESTify, and it'll give me a good chance to break into a more structured MVC folder structure, so growing in the future will be less painful.
Scope the modules' namespace! Pass them a reference to the Blockly object, but keep them from having global scope, to avoid conflicts.
Implement User Accounts
Currently, "dom" and "html" are the only valid modules, and they are minimal and demo-ish.But the premise is simple! New blocks can be added surprisingly easily!
##Contributing Block Modules
If you'd like to add modules to Bloccoli, simply add them to the ./site/blocks folder, and send me a pull request. If there's lots of interest in contributing, I may automate this process in the future.
Follow the dom.js format for success. Note there are three steps:
###1. A representation of your menu tree.
blocklyToolbox as seen here.
If you need a more complex menu system, for example, categories within categories, you may append your required XML in the blockly format to the global
If your menu system is so complex that it contains multiple categories, you may wnat to use this module: https://github.com/flyswatter/Blockly-Module-Maker
Yes! You can make the blocks do almost anything Javscript can do! If you need a kick start, you can look at how some previous block modules were made in the
####Future Block Module Hopes: *More complete website interaction *A 2D drawing/animation/games engine, like Processing.js, Paper.js, or Rafael.js *A 3D modeling system like OpenJSCAD *A 3D Games engine like Voxel.js *More...
##Modifying the Core
###Current design: The current app flow is fairly straightforward:
Requesting a module adds an escaped JSON array of "bloccoliExtensions" to the URL query and reloads.
When the main page loads with a bloccoliExtensions query array, it creates a new iFrame, using the same query to the iframe's request url.
When the server finds this query array in an iframe request (always for ./site/frame.html), it injects script tags pointing to the requested modules before the Blockly.inject call.
For this reason, calls to Blockly made in modules are pure pre-injection Blockly interactions. Be careful with those calls to global variables! I will be adding some restrictions using Caja, and am open to suggestions for new restrictions to add.
Before including block definitions in your block set's .js file, you need to add an initialization object to the window.parent.blocklyToolbox list:
###Contributing to the Bloccoli Core:
####Client Bundled using Browserify. Bundle any updates from the root via:
$ browserify client/index.js -o site/js/bundle.js
####Server A node.js program. It exists in the root directory. From there, just run:
$ node index.js