[annotator-dev] issues working against master

Randall Leeds tilgovi at hypothes.is
Fri Apr 11 17:48:26 UTC 2014


On Fri, Apr 11, 2014 at 10:38 AM, Steph Skardal <steph at endpoint.com> wrote:

>  Hi,
>
> I've been working on doing a bit of upgrade work to master / v2.0. I know
> it's not extremely stable, but I'd like to be working against it instead of
> a soon to be maintenance branch as I add additional customizations.
>
> Here are issues I'm currently experiencing:
>
> * I can't for the life of me get the Store plugin to work against the
> master branch. I've tried passing it in as an option to the annotator
> instantiation, and via the addPlugin method. Debugging shows that the
> Factory.setStore method is perhaps not behaving as I expect it to. Are
> there any updated docs / working examples of the Store plugin against the
> master branch?
>

The dev.html file should provide a working example.
Except right now it seems to be making the search request twice. I'm
looking into it.


>
> * The beforeAnnotationCreated event is a little confusing.
> beforeAnnotationCreated happens after text is highlighted and the pencil
> adder button is clicked, but before the user makes any changes to the
> annotation data. The documentation on the github project page says, "called
> immediately before an annotation is created. If you need to modify the
> annotation before it is saved to the server by the Store plugin, use this
> event." Am I incorrect in saying this is happening before the annotation is
> created in the DOM? annotationCreated is called after the annotation is
> saved, which is just fine. What I specifically am lacking here that
> wouldn't require me to hack on the core is a "beforeAnnotationStored"
> event, that happens in between those events, perhaps right as the "Save"
> button is clicked and before the annotation is created via whatever store
> is being used. I need a means to update the annotation object before it is
> sent to the store, but after a user has made whatever edits to the Editor
> content. This is a limitation in both 1.2.* and 2.0, AFAIK. I can probably
> come up with a kludge here, or hack on the core, but I'm trying to minimize
> core hacking going forward.
>
>
That's great feedback and we know this is not final and correct yet. Thanks
for the feedback.

I think there's value in the beforeAnnotationCreated event happening before
the editor pops up, because it allows code to fill in default permissions,
tags, etc, before the editor is displayed.

But I hear you about wanting to make modifications after that.

How should we proceed?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140411/6547de28/attachment-0004.html>


More information about the annotator-dev mailing list