[annotator-dev] issues working against master

Steph Skardal steph at endpoint.com
Fri Apr 11 17:38:39 UTC 2014


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 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.

Thanks!!

Steph


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140411/e4d5aec3/attachment-0003.html>


More information about the annotator-dev mailing list