On Mon, Jun 23, 2014 at 7:35 AM, rodolfo tuble <
rtc...@gmail.com>
wrote:
All EFM does is extract the HTML files from the Epub and feed them to
Monocle in the correct order. Monocle doesn't know and doesn't care
where a given HTML file is coming from. So if something isn't working
after going through one of your code paths, that means your code is
broken.
Looking at your code:
> function onReaderLoad(rdr) {
> var sSel = document.getElementById('sizeSelect');
> sSel.addEventListener('change', function (evt) {
> reader.formatting.setFontScale(parseFloat(sSel.value),
> true);
> });
>
> var scrCtrl = new Monocle.Controls.Scrubber(rdr);
> rdr.addControl(scrCtrl, 'standard', { container: 'scrubber' });
> }
This shouldn't work at all, since the variable 'reader' isn't defined.
(The Monocle.Reader object is being passed in as 'rdr'.) The only way
it could work would be if 'reader' were defined globally. I suspect
you're defining it globally in the HTML branch of your code and not in
the Epub branch.
And two weeks ago, I told you,
> In the second code path above (html files), you assign the reader to
> window.reader, so all you have to do is call
> 'window.reader.moveTo()'. In the first code path (epub files),
> you'll also need to assign the reader to window.reader for this to
> work.
(Note that in the browser's JS environment, attributes of 'window' also
show up as global variables, so 'window.reader' is the same as
'reader'.)
Robert