[annotator-dev] Add ids to annotators

Randall Leeds tilgovi at hypothes.is
Wed Jul 25 01:09:19 UTC 2012


On Jul 24, 2012 3:24 AM, "Nick Stenning" <nick at whiteink.com> wrote:
>
> Jamie and Randall wrote:
> > [stuff about attaching id attributes to annotation highlights]
>
> Is there any particular reason we wouldn't want this enabled by default?
>
> I mean sure, Jamie *could* do this with event hooks. But it seems to
> me to be an oversight on my part. I think we should, by default, add
> ids of the form "annotation-hl-#{id}" to highlights, if
> "annotation.id?".
>
> -N

My only hesitation revolves around the fact that a single annotation may
have several highlights due to the way text nodes are broken up (or,
eventual, to having multiple targets) and it's not (technically) valid to
use the id property on all of them. While it's great for easy scrolling via
document.location, the resulting URLs are not meaningful until after
Annotator loads. I wonder if some data- attribute is not a better choice.

I'm not opposed to putting the id on the (first) highlight. I'm just not
sure it's inarguably the best thing to do. I'd like to ponder it just a
little bit more.

In particular, something which unifies Annotator-added annotations with
inline annotations would interest me (such as Annotator augmenting any
[data-annotation] elements found in the markup).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20120724/faf39a5b/attachment-0002.html>


More information about the annotator-dev mailing list