Skip to content

Instantly share code, notes, and snippets.

@fnl
Created May 22, 2013 10:02
Show Gist options
  • Save fnl/5626513 to your computer and use it in GitHub Desktop.
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").
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