1
0
Fork 0
mirror of https://github.com/futurepress/epub.js.git synced 2025-10-03 14:59:18 +02:00
epub.js/hooks/extensions/hypothesis.js
2014-04-03 22:40:50 -07:00

22 lines
No EOL
684 B
JavaScript

// EPUBJS.Hooks.register("beforeChapterDisplay").hypothesis = function(callback, chapter){
//
//
// EPUBJS.core.addScript("https://hypothes.is/app/embed.js", null, chapter.doc.head);
//
// if(callback) callback();
//
// }
//
//
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("https://hypothes.is/app/embed.js?role=guest&light=true", null, renderer.doc.head);
EPUBJS.core.addCss( cssPath + "annotations.css", null, renderer.doc.head);
if(callback) callback();
};