Annotations
[oweals/karmaworld.git] / karmaworld / assets / js / note-detail.js
index a178320debb557b19a42061335c48d4a8f75b4a8..bcb82c31a5c2102181d2c07194220011c1e6a269 100644 (file)
@@ -150,7 +150,18 @@ $(function() {
 
   // Embed the converted markdown if it is on the page, else default to the iframe
   if ($('#note-markdown').length > 0) {
-    $('#note-markdown').html(marked($('#note-markdown').data('markdown')));
+    var note_markdown = $('#note-markdown');
+    note_markdown.html(marked(note_markdown.data('markdown')));
+    note_markdown.annotator();
+    note_markdown.annotator('addPlugin', 'Store', {
+      prefix: '/ajax/annotations',
+      loadFromSearch: {
+        'uri': note_id
+      },
+      annotationData: {
+        'uri': note_id
+      }
+    });
   } else {
     $.ajax(note_contents_url, {
       type: 'GET',