[annotator-dev] Loading Annotations Asynchronously

Jamie M Folsom jfolsom at MIT.EDU
Sun Jan 26 00:04:52 UTC 2014


Hey Randall,

Sure. I set up the annotator, then get a reference to it with:

var subscriber = $('#textcontent').annotator().data('annotator');

Then I define an on click function for a filter control, which sets up a loadOptions object, and calls:

subscriber.plugins.Store.loadAnnotationsFromSearch(loadOptions);

That works, in that the data are correctly loaded from the API. What’s not happening, is that the annotator doesn’t reload the new annotations in the DOM, and/or the highlights are not shown in the text. 

Is there another step the annotator takes after loading or loading from search, to display or update display of highlights?

Here’s the relevant line: https://github.com/hyperstudio/Annotation-Studio/blob/master/app/views/documents/_annotator-setup.html.erb#L181

Thanks!

Jamie


On Jan 25, 2014, at 6:56 PM, Randall Leeds <tilgovi at hypothes.is> wrote:

> Could you share the code you're using to create the annotator, what behavior you're seeing, and what you expect to see?
> 
> I don't recall the details of your problem or solution, though I vaguely remember discussing it.
> 
> On Jan 25, 2014 2:17 PM, "Jamie M Folsom" <jfolsom at mit.edu> wrote:
> Hi Folks,
> 
> I had a solution for loading annotations asynchronously, using LoadAnnotationsFromSearch, which worked fine while I was using annotator v. 1.2.5 or so, but appears to have stopped working now that I’m on 1.2.7.
> 
> As I recall, there was some work done on the store plugin in recent tagged releases, to accommodate this use case. Can anyone refresh my memory, and/or confirm whether there’s a better way to go about this?
> 
> Essentially, I want to be able to pass a hand crafted loadOptions object (for an in-page filter) to LoadAnnotationsFromSearch, and have the annotator refresh its data from the API, and display the updated set of highlights.
> 
> Thanks!
> 
> Jamie
> 
> 
> _______________________________________________
> annotator-dev mailing list
> annotator-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/annotator-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140126/1895335f/attachment-0004.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1579 bytes
Desc: not available
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20140126/1895335f/attachment-0004.bin>


More information about the annotator-dev mailing list