[annotator-dev] Margin Viewer Plugin

Rick rmercer33 at gmail.com
Mon Mar 16 07:17:21 UTC 2015


I want to try out the Margin Viewer annotator plugin but can't find any
docs showing how to initialize it.​ I'm using annotator 1.2.9. I got the
coffeescript code from Github and have compiled it to js.

Not sure what name to use during initialization. Here's my init code. Would
sure appreciate any insight.

Thanks,

Rick

  this.$('#document').annotator()
    .annotator("addPlugin", 'Store', {
      prefix: '/api',
      urls: {
        create: '/a',
        update: '/a/:id',
        destroy: '/a/:id',
        search: '/a/get'
      },
      annotationData: {"docId":this.data._id, "userId":Meteor.userId()},
      loadFromSearch: {
        "user": Meteor.userId(),
        "doc":this.data._id
      }
    })
    .annotator("addPlugin", 'StoreLogger')
    .annotator("addPlugin", 'Permissions', {
      user: userInfo,
      userId: function(user) {
        if (user && user.id) {
          return user.id;
        }
        else
          return user
      },
      userString: function(user) {
        if (user && user.id) {
          return user.email;
        }
        else
          return user
      },
      permissions: {
        'read': [userInfo.id],
        'update': [userInfo.id],
        'delete': [userInfo.id],
        'admin': [userInfo.id]
      },
      showViewPermissionsCheckbox: false,
      showEditPermissionsCheckbox: false
    })
    .annotator('addPlugin', 'Tags')
    .annotator('addPlugin', 'Share', {
      shareIn:['email','facebook','twitter']
    })
    .annotator("addPlugin", 'MarginViewer')
    .annotator("addPlugin", 'Markdown');
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150316/480311c9/attachment-0003.html>


More information about the annotator-dev mailing list