View Single Post
Old 03-08-2016, 11:07 AM   #7
KevinH
Wizard
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 4,158
Karma: 2620702
Join Date: Nov 2009
Device: many
I have recently looked into this for Sigil. Here is what I found:

1. pop-up footnotes can be as easy as injecting a simple javascript as long as you have a recent version of jQuery (Sigil's is ancient, it has to be updated first and then any incompatibilities fixed) around to access.

2. endnotes are harder as the target of the link is not typically inside the current xhtml file and actually exists in some other place. This sometimes requires the reading software to preprocess the endnotes to build a list for the entire document or to actually load and parse a final endnotes document on the fly via javascript.

3. mouse-over and tooltip type pop-ups done by javascript do not work well with many mobile devices. So some approaches use a combination of javascript and css, and actually preprocess the DOM tree, rewriting it to intercept the link in javascript. Sigil can not use this approach in BV as nothing can rewrite the DOM otherwise we get bad xhtml back out of BookView (changed by the javascript - this is the same reason we can not see MathML in BV, only in PV).

4. In Sigil, intercepting the links in C++/Qt without changing the DOM should be easy in both BV (and PV?), so there may be a way to handle pop-up footnotes and possibly pop-up endnotes with a Qt dialog being popped up in place of a target link. I will look into this.

But the idea would be not to make all footnotes pop-up, but only implement the approach used by iBooks and only in epub3 where the proper semantic epub:type noteref and footnote are used in the link and the target aside.

Fallbacks -
So in epub3, for readers that allow javascript, if you use footnotes (not endnotes), you should be able to detect what reading system you are on, and if needed pop-up your own footnotes easily as a fallback for the reader. If no javascript is allowed on the epub3 reader, then you are pretty much out of luck and must rely on the reader's internal software to handle things.
KevinH is online now   Reply With Quote