mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
updated grunt file to compress zip in correct order
This commit is contained in:
parent
f1eb2d8707
commit
ec377d9132
22 changed files with 2347 additions and 100 deletions
|
@ -1,5 +1,3 @@
|
|||
/*! FuturePress - v0.1.0 - 2013-07-08 */
|
||||
|
||||
EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chapter){
|
||||
|
||||
var notes = chapter.doc.querySelectorAll('a[href]'),
|
||||
|
@ -8,10 +6,9 @@ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chap
|
|||
type = "noteref",
|
||||
popups = {};
|
||||
|
||||
EPUBJS.core.addCss("../demo/css/popup.css", false, chapter.doc.head);
|
||||
|
||||
// EPUBJS.core.addCss("css/popup.css", false, chapter.doc.head);
|
||||
|
||||
//console.log("notes", items)
|
||||
items.forEach(function(item){
|
||||
var epubType = item.getAttribute(attr),
|
||||
href,
|
||||
|
@ -24,7 +21,7 @@ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chap
|
|||
txt;
|
||||
|
||||
if(epubType != type) return;
|
||||
|
||||
|
||||
href = item.getAttribute("href");
|
||||
id = href.replace("#", '');
|
||||
el = chapter.doc.getElementById(id);
|
||||
|
@ -63,11 +60,13 @@ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chap
|
|||
//-- TODO: will these leak memory? - Fred
|
||||
popups[id].addEventListener("mouseover", onPop, false);
|
||||
popups[id].addEventListener("mouseout", offPop, false);
|
||||
|
||||
|
||||
//-- Add hide on page change
|
||||
chapter.book.listenUntil("book:pageChanged", "book:chapterDestroy", hidePop);
|
||||
chapter.book.listenUntil("book:pageChanged", "book:chapterDestroy", offPop);
|
||||
|
||||
// chapter.book.listenUntil("book:pageChanged", "book:chapterDestroy", hidePop);
|
||||
// chapter.book.listenUntil("book:pageChanged", "book:chapterDestroy", offPop);
|
||||
chapter.book.on("book:pageChanged", hidePop, this);
|
||||
chapter.book.on("book:pageChanged", offPop, this);
|
||||
// chapter.book.on("book:chapterDestroy", hidePop, this);
|
||||
}
|
||||
|
||||
pop = popups[id];
|
||||
|
@ -77,7 +76,7 @@ EPUBJS.Hooks.register("beforeChapterDisplay").endnotes = function(callback, chap
|
|||
itemRect = item.getBoundingClientRect();
|
||||
left = itemRect.left;
|
||||
top = itemRect.top;
|
||||
|
||||
|
||||
//-- show the popup
|
||||
pop.classList.add("show");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue