[annotator-dev] Anottations from one page loading on others

Stefan Lazic oxhey at msn.com
Sat Mar 28 20:02:03 UTC 2015


I'm adding annotations to reveal.js presentations .I have added the offline plugin and used some suggested code that would make the plugin only load annotations from the reveal presentation that they came from.The problem is that an annotation from one presentation still loads on another.jQuery('Lecture 1').text(); is changed to jQuery('Lecture 2').text(); in the other reveal presentation.
    <script>
    var content = jQuery(".reveal").annotator();
    content.annotator('addPlugin', 'Offline', {
      setAnnotationData: function (ann) {
    if (!ann.pageName) {
      ann.pageName = jQuery('Lecture 1').text(); // Use the page title
    }
  },
  shouldLoadAnnotation: function (ann) {
    return ann.pageName === jQuery('Lecture 1').text();
  },
      online:  function () {
        jQuery("#status").text("Online");
      },
      offline: function () {
        jQuery("#status").text("Offline");
      }
    });
    var annotator = content.data('annotator');

    jQuery("#clear-storage").click(function () {
      if (annotator) {
        annotator.plugins.Offline.store.clear()
      }
    });
    </script> 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20150328/4f5ef779/attachment-0003.html>


More information about the annotator-dev mailing list