1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-05 15:32:55 +02:00
epub.js/hooks/extensions/hypothesis.js
RawKStar77 038c81e496 Got Hypothes.is integration working again.
Still need to work on stylings. Currently the sidebar is not visible due to a low z-index, but I would like to do a better looking integration when I find time.

~
2014-11-12 15:15:55 -08:00

14 lines
No EOL
498 B
JavaScript

EPUBJS.Hooks.register("beforeChapterDisplay").hypothesis = function(callback, renderer){
var folder = EPUBJS.core.folder(location.pathname);
var cssPath = (folder + EPUBJS.cssPath) || folder;
if(!renderer) return;
EPUBJS.core.addScript("/hooks/extensions/embedh.js", null, renderer.doc.head);
EPUBJS.core.addScript("https://hypothes.is/embed.js", null, renderer.doc.head);
EPUBJS.core.addCss( cssPath + "annotations.css", null, renderer.doc.head);
if(callback) callback();
};