[annotator-dev] setting up with js to use annotate store

Nick Stenning nick at whiteink.com
Wed Jun 20 21:54:13 UTC 2012


On 2012-06-20 14:14, adam hyde wrote:
> ok, it seems to work but strangley
> http://www.booki.cc/fiddling-while-rome-burns/_draft/_v/1.0/why-this-book-was-written/
> 
> 
> i copied the demo code exactly i think. 

The problem here is that when you load the annotations from the API
you're getting the most recent public annotations, not just the
annotations for your document (using the `loadFromSearch` option).

Really, I think you're making this far more complicated than it needs to
be by including the demo code. If you want AnnotateIt users to be able
to annotate your document, it's two lines of code:

    $('.content').annotator()
                 .annotator('setupPlugins');

If you want to use your own users, then it's four lines of code:

    $('.content').annotator()
                 .annotator('setupPlugins', {
                   tokenUrl: 'http://example.com/getToken'
                 });

Just take the time to implement the token endpoint (something you'll
have to do anyway -- as including the consumer key in the front-end is a
big no-go) and all these problems will go away, I promise =).

Best wishes,
Nick

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20120620/bfa7c2d5/attachment-0002.sig>


More information about the annotator-dev mailing list