You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The json format should be as described on the annotatorjs documentation { "total": 43127, "rows": [ { "id": "d41d8cd98f00b204e9800998ecf8427e", "text": "Updated annotation text", ... }, ... ] }
You should setup the annotatorjs store plugin like this
var content = $('#content').annotator();
content.annotator('addPlugin', 'Store', {
// The endpoint of the store on your server.
prefix: '/store/endpoint',
// Attach the uri of the current page to all annotations to allow search.
annotationData: {
'uri': 'http://this/document/only'
},
// This will perform a "search" action when the plugin loads. Will
// request the last 20 annotations for the current url.
// eg. /store/endpoint/search?limit=20&uri=http://this/document/only
loadFromSearch: {
'limit': 20,
'uri': 'http://this/document/only'
},
urls: {
// These are the default URLs.
create: '/annotations',
update: '/annotations/:id',
destroy: '/annotations/:id',
search: '/search'
}
});
});
});
So when you open the page annotatorjs sends a post request to fetch the json from the search route and data should be in the format as given above this should apply annotations that have been stored in the database you also need id with each annotation to edit and update the annotation.
Hope this helps i know im answering this like after two years but this might help someone in future.
As loadAnnotations is deprecated in v2.0, how may I reload annotations from a json? Thank you very much.
The text was updated successfully, but these errors were encountered: