firebase/firepad — pull request #127 by vincentwoo (2014-05-18 06:46:36+00:00)
Title: Headless Firepad mode for use with Node (or the browser)

Resolves https://github.com/firebase/firepad/issues/126

This PR:
* Moves a lot of text parsing logic out of `lib/firepad.js` and into
* `lib/text-pieces-to-inserts.js`: for turning the results of `ParseHtml` into text-attribute pairs.
* `lib/serialize-html.js`: for turning a `TextOperation` doc into HTML.
* `lib/entity-manager.js`: registration of default entities is now just baked into the entity manager.
* Adds `lib/headless.js`, which can get/set text/html. Getters take a callback, setters take a value and an optional callback.
* HTML handling works by using `jsdom` to set `firepad.document` which `EntityManager` and `ParseHtml` both will use instead of the default `document` object.
* `FirebaseAdapater` will attempt to do `Firebase = require('firebase')` if Firebase is not present and require is available.
* `FirebaseAdapater` can now be instantiated without a userId - in which case it will make up an author name but not connect to the users ref.
* `FirebaseAdapter#sendOperation` now takes a completion callback.
* Adds coarse integration tests that validate that the CodeMirror and headless versions of Firepad behave the same way around the public API.