[annotator-dev] issues working against master

Randall Leeds tilgovi at hypothes.is
Fri Apr 11 18:15:16 UTC 2014

On Fri, Apr 11, 2014 at 11:12 AM, Randall Leeds <tilgovi at hypothes.is> wrote:

> On Fri, Apr 11, 2014 at 11:04 AM, Steph Skardal <steph at endpoint.com>wrote:
>> In my use case, I present the UI based on the annotation, but then I need
>> to retrieve / format data entered in the UI to formatted annotation data
>> after the user has modified the UI. My UI doesn't directly translate to the
>> annotation object, so I have to have hooks to convert data to the UI and
>> convert values in the UI to data before the annotation is stored. Sorry if
>> that's not clear, maybe a diagram would be better :)
>> Steph
> How many representations are needed?
> The way you've described it almost sounds like three:
> 1) Stored
> 2) In memory, for annotator
> 3) In memory, for your UI
> How often do you have to go back and forth between 2 and 3? Whenever the
> edit button is clicked, the editor is saved, etc? Before or after the
> annotation is shown in a viewer?
> Does annotator.editor.subscribe('save') help?

Actually, annotator.subscribe('annotationEditorSubmit', callback) is
better. The callback will receive the editor and the annotation as

I say this is better because subscribing to the save event doesn't
guarantee that your handler will be called before the other save handler
set up by annotator (which triggers annotationEditorSubmit and the storage
cycle). annotationEditorSubmit is probably the way to go.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140411/149fa5bd/attachment-0004.html>

More information about the annotator-dev mailing list