[annotator-dev] Making the anchoring more flexible (2.0 redesign)

Kristof Csillag csillag at hypothes.is
Wed Jul 17 07:38:54 UTC 2013


During yesterday's call we were talking about how to make the anchoring
of loaded annotations to the DOM more flexible.
My proposal was that to change the annotation storage format first.
(So that we no longer store ranges in the body of the annotations, but
targets with selectors.)

There were some discussion about whether we should do this immediately,
or we should postpone it to some later time, and start to build up the
internals before that.

I want to clarify one thing.

Currently, the anchoring happens when the SerializedRanges (which are
loaded from the store, and are stored in the .ranges field) are applied
to the DOM, and are replaced by a NormalizedRanges.

In our (Hypothes.is's) implementation, in the place of this, we are
building the same NormalizedRanges from the .target field, which is
loaded from the store. (And we are then storing these ranges in the
.range field.)

In order to build _any_ kind of flexibility, I think we need this: we
must separate the field where we store the "dead", serialized data,
coming from the back-end, and the field where we store the "live" data,
referencing the actual DOM. (And then the anchoring process, which we
can sophisticate, is when we generate the latter from the former.)

We can do this without introducing the full target/selector thing, if we
want to, but we must change the fact that currently, the "range" field
is used for both goals.


More information about the annotator-dev mailing list