caktus/django-scribbler — pull request #68 by mlavin (2013-01-26 20:44:31+00:00)
Title: Reorganize JS Files

This change relates to #54, #58, #57 and #30. It breaks up the editor and menu code from the single large scribbler.js. It also removes the static library dependencies from the repo and adds a command to install them. #30 explored the possibility of using bower but CodeMirror doesn't use the "proper" semantic tags to use with bower and it was more trouble than it was worth. It updates RequireJS to the latest stable and CodeMirror to the last 2.X release (#57 is to update to 3.X but this change was already getting out of hand).

This also uses the `r.js` optimizer to build a single CSS (CodeMirror CSS + scribbler styles) and JS file for production usage. This fixes #58.

This does introduce a few regressions:
- Since the complied JS/CSS is not included in the repo it is no longer feasible to install directly from git
- Projects currently using scribbler need to update their CSS/JS references (remove link to codemirror.css
- The top menu no longer closes when the editor is opened

The last one would be fairly easy to fix by making the editor require the menu but I was going to go another route and add events to the plugins. My plan will be to rewrite these plugins entirely as Backbone views (which would also make them easier to extend). That would be a pretty drastic change on top of all of these "infrastructure" changes so I wanted to get this merged first.

**TL;DR** I'm going to rewrite all of the JS to use Backbone and this is all prep to manage the static library dependencies before I do that.

CC @kmtracey @calebsmith @juliaelman