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.

Super cool.  Also nice use of clickable bird.


On Wed, Oct 1, 2014 at 3:28 PM, Bjvanminnen <notifications@github.com>
wrote:

> In blockly/src/utils.js:
>
> >  var xml = require('./xml');
> > +var savedAmd;
> > +/**
> > + * Special functions for pulling in lodash to avoid node/requirejs issue.
> > + */
> > +exports.pre_lodash_require = function() {
> > +  if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
>
> probably doesnt matter, but should these be === instead of ==?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/code-dot-org/code-dot-org/pull/84/files#r18312604>.
>