hypothesis/h — pull request #909 by csillag (2013-11-13 18:22:11+00:00)
Title: Introducing typed anchors.

This is the other half of the work at https://github.com/hypothesis/annotator/pull/16.
(See explanation there.)

The H specific parts:

* Updated Annotator to 1c950a4fa
* Following API changes
* The heatmap got a lot trickier. Since it can no longer make any
assumption about the actual implementation of the highlights and
anchors, now it does not rely on any data inside them. That includes
the start and stop character offsets, too, which was previously used
to find the nearest anchor for the up/down arrows on.
We can't assume that all anchors have that data.
Unfortunately, the Y coordinate is not always available, because
the required part of the DOM might not be rendered yet.
So the only data we have is the page number. (All anchors have page
numbers). In the first phase, we only collect the anchors from the
nearest page. Then we go there, to assure that it's rendered.
When all the anchors have been realized, we select the nearest one,
and actually scroll to it. This way, we can make it work with
all kinds of anchors/highlights.

I have also fixed some small inconsistencies here and there.