Skip to content

Commit

Permalink
"annotations" plugin was renamed "highlights", see readium/SDKLaunche…
Browse files Browse the repository at this point in the history
  • Loading branch information
danielweck authored Nov 15, 2016
1 parent 7c2918e commit aabd318
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,16 @@ require(['readium_shared_js/views/reader_view'], function (ReaderView)
ReadiumSDK.on(ReadiumSDK.Events.PLUGINS_LOADED, function(reader)
{
// readium built-in (should have been require()'d outside this scope)
console.log(reader.plugins.annotations);
if (reader.plugins.annotations) {
reader.plugins.annotations.initialize({annotationCSSUrl: opts.annotationCSSUrl});
reader.plugins.annotations.on("annotationClicked", function(type, idref, cfi, id) {
console.log(reader.plugins.highlights);
if (reader.plugins.highlights) {
reader.plugins.highlights.initialize({annotationCSSUrl: opts.annotationCSSUrl});
reader.plugins.highlights.on("annotationClicked", function(type, idref, cfi, id) {
console.log("ANNOTATION CLICK: " + id);
reader.plugins.annotations.removeHighlight(id);
reader.plugins.highlights.removeHighlight(id);
});
reader.plugins.annotations.on("textSelectionEvent", function() {
reader.plugins.highlights.on("textSelectionEvent", function() {
console.log("ANNOTATION SELECT");
reader.plugins.annotations.addSelectionHighlight(Math.floor((Math.random()*1000000)), "highlight");
reader.plugins.highlights.addSelectionHighlight(Math.floor((Math.random()*1000000)), "highlight");
});
}

Expand Down

0 comments on commit aabd318

Please sign in to comment.