Skip to content

Instantly share code, notes, and snippets.

@jamiefolsom
Created August 30, 2012 19:37
Show Gist options
  • Save jamiefolsom/3538844 to your computer and use it in GitHub Desktop.
Save jamiefolsom/3538844 to your computer and use it in GitHub Desktop.
jQuery(function ($) {
// Get a reference to the Annotator for event callback subscriptions //
var studio = $('#textcontent').annotator();
studio.annotator('addPlugin','Auth', {
token: '<%= @jwt %>'
});
studio.annotator('addPlugin','Store', {
prefix: 'http://localhost:5000/api',
annotationData: {
'uri': 'http://localhost:3000/documents/moby-dick'
},
loadFromSearch: {
'limit': 20,
'uri': 'http://localhost:3000/documents/moby-dick'
}
});
studio.annotator('addPlugin', 'Markdown');
studio.annotator('addPlugin', 'Permissions', {
user: '<%= current_user.email %>',
permissions: {
'read': [],
'update': ['<%= current_user.email %>'],
'delete': ['<%= current_user.email %>', 'group:Admin'],
'admin': ['<%= current_user.email %>', 'group:Admin']
},
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment