code-dot-org/code-dot-org — pull request #84 by cpirich (2014-10-01 22:24:14+00:00)
Title: Pencilcode droplet

Replaced the plain ace editor in the editcode levels with the pencilcode droplet editor. If you want to see it, check this out: http://screencast.com/t/ZBwr4zwuao

Using droplet meant that I had to move to using requireJS for blockly levels. The require.js file is loaded for all blockly levels now (from the dashboard), but the ace/droplet files are only loaded for the MazeEC app (where all of the editcode levels currently live).

The addition of require.js created a strange conflict with our node.js use of lodash. lodash changes its behavior when it detected that require.js is around (assuming that it is being loaded by require.js). But in our case, we want to keep lodash working as it was. So we need to "hide" requireJS right before we require lodash. The new pattern for pulling in lodash looks like this:

utils.pre_lodash_require();
var _ = require('../lodash');
utils.post_lodash_require();

I added some additional ace files needed by droplet.