get the lowest common ancestor instead of highest

Fix #166 as reported by @jujug42
Use empty string if prefix is unset or null

This fixes #175. Previously, the prefix defaulted to '/', which results in
`_urlFor` returning URLs of the form '//annotations', which the browser
interprets as a protocol-agnostic full URL.

The fallback prefix should be '', and the check for existence of
`@options.prefix` should not magically convert the empty string into a single
slash.
Add redo paths to gitignore
Bump version -> v1.2.6
Add tests for empty-string prefix
Remove unused option in Store plugin
Alphabetise options
Provide emulation of PUT/DELETE in Store plugin

As requested in #180 (see also #172), this adds an `emulateHTTP` option to the
Store plugin, which allows Annotator to emulate PUT/DELETE for old webservers
that don't understand these methods. If `emulateHTTP` is true, then Annotator
will sent PUT and DELETE requests as POSTs, setting a request header to denote
the desired method:

    X-HTTP-Method-Override: DELETE

See [Backbone's `emulateHTTP`][1] for reference:

[1]: http://backbonejs.org/#Sync-emulateHTTP
Provide emulation of JSON post in Store plugin

As requested in #180 (see also #172), this adds an `emulateJSON` option to the
Store plugin, which allows Annotator to communicate with legacy webservers
that don't much like POSTS with `application/json` type payloads. Instead, the
data to be sent is JSON encoded client-side and is sent as a standard form
request (with content-type `application/x-www-form-urlencoded`) with the JSON
stored in the `json` key.

In addition, if `emulateHTTP` is also set, the Store will add a `_method` key
to the form, containing the same value as the `X-HTTP-Method-Override` header.
Use closures to separate create vs update

Rather than using the presence of a `ranges` property on an annotation
to determine whether it is new or updated, track that information via
one-shot closures subscribed to the editor events. The proper
subscriber registers via the callbacks for adder and annotation edit
clicks where it is known for certain if the annotation is new or
updated.
Setup script correctly compare input against regex. Brew goes to valid URL.
Merge pull request #191 from fagbokforlaget/setup_script_fix

Setup script now correctly compare input against regex.
Fix bookmarklet config substitution

There were two unrelated problems preventing this from working:

1) Declaring a dependency on the config when it doesn't exist causes redo to
   get very unhappy. The build dependency will now only be added if the config
   file exists.

2) Newlines in sed substitutions are a bad idea...
Deal appropriately with query string Store URLs

Fixes #186, which pointed out that the Store plugin was only substituting
annotation IDs when the URLs contained the string '/:id', and wouldn't work
for just ':id'.
trap SIGINT also for shutting down the test server

Allows clean aborts in the middle of a test run, in case it's
taking a long time.
don't choke when an annotation has no highlights

With this change, 'annotationDeleted' events are fired for
cancelled annotations. This is a behavior change. Previously,
this event was only fired when saved annotations were deleted,
but not when new edits were cancelled.

It's my belief that this event is helpful information. A quick
audit of Annotator shows that nothing relies upon the previous
behavior. For example, the Store plugin registers annotations
after the 'annotationCreated' event is fired and ignores events
on unregistered annotations, thereby ignoring the 'annotationDeleted'
event that this change causes.
Store plugin should not assume once only loading

Related to #177
Upgrade to coffeescript 1.6 and enable source maps

This enables source map generation in development. To enable source map support
in the Chrome developer tools:

1. Open Developer Tools: View -> Developer -> Developer Tools
2. Click the "Settings" cog in the bottom-right corner
3. Choose "General," and select "Enable source maps"
fix for some adder positioning edge cases

Reported in hypothesis/h#371
Replace jasmine with mocha and mocha-phantomjs