Quote:
Originally Posted by kovidgoyal
That's cool, I can integrate this into the viewer as an option (if the user selects the option, on the next restart the viewer will load the multicol javascript).
|
That would be truly cool!
Quote:
Couple of questions:
1) I see you have a comment saying document.ready does not always work. What happens when you use document.ready?
|
I do not know what is the exact order in wich the settings (custom css, ebook specific css, etc) are applied. The fact is that
the document.ready is triggered in some ebooks more than once. In those cases the value returned by $("body").height() is either
much too large or a bit too small.
Quote:
2) Do we need the alerts for next chapter?
|
Definitively not. It’s just a hack to let the user know the end or the beginning of the chapter was reached. I am using it just
because I do not know how to fetch the next / previous chapter. Ideally one should call here “goto next” or “goto prev” functions.
Quote:
3) Do we need to reload the document on resize, instead of just redoing the layout
|
Again a hack, related to the next of your questions. To properly redo the layout, one would need to know what page
is on the display. I could get it from a var on my “script”, however it would be much better to get it from the
calibre_current_page_bookmark. But that I could not get because I do not know how to manually update and read the
calibre_current_page_bookmark. Note, that the side scrolling has no effect on the automatic updating of the position.
I took me a while (and a lot of reading) to realize that for the rendering engine a multicolumn page not taller than the
viewportHeight, is just one page that is not scrollable in the vertical direction. So, even if you scroll to the side, for it
you are always at the beginning of the first page.
I hope I make sense, its late in here…
Quote:
4) What was the problem with bookmarks/last read location exactly?
|
See 3