readium / readium-sdk

A C++ ePub renderer SDK
BSD 3-Clause "New" or "Revised" License
385 stars 164 forks source link

How to know when user click a hightlight? #255

Closed xieweizhi closed 7 years ago

xieweizhi commented 7 years ago

Is there a way to do this in iOS ?

danielweck commented 7 years ago

see https://github.com/readium/readium-js-viewer/blob/develop/src/js/EpubReader.js#L1105

readium.reader.plugins.highlights.on("annotationClicked", function(type, idref, cfi, id) { console.debug("ANNOTATION CLICK: " + id); });

danielweck commented 7 years ago

oh, and remember to enable the highlighter plugin in your build configuration: https://github.com/readium/readium-shared-js/blob/develop/plugins/plugins.cson#L3