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> _______________________________________________
annotator-dev mailing list
[email protected]
https://lists.okfn.org/mailman/listinfo/annotator-dev
Unsubscribe: https://lists.okfn.org/mailman/options/annotator-dev