Created
May 22, 2013 10:02
-
-
Save fnl/5626513 to your computer and use it in GitHub Desktop.
A quick-and-dirty hack to have the Annotator (https://github.com/okfn/annotator) popup show the actually annotated text (!called "annotation.quote") in addition to the comment (!called "annotation.text").
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = $(element).data('annotator'); | |
// expand the viewer to show the annotated text (quote) | |
data.viewer.fields[0].load = function (field, annotation) { | |
return annotation.text | |
? $(field).html(annotation.quote + "<br/><i>" + escape(annotation.text) + "</i>") | |
: $(field).html(annotation.quote), | |
data.publish("annotationViewerTextField", [field, annotation]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment