joseph / Monocle

A silky, tactile browser-based ebook JavaScript library.
http://monocle.inventivelabs.com.au
MIT License
743 stars 200 forks source link

hyperlinks, magnifier #71

Closed fruscica closed 12 years ago

fruscica commented 12 years ago

hello all,

great app. am in the process of formatting an ebook using monocle. not always easy to identify the code needed to produce certain effects. in particular, i can't replicate the hyperlinks that are seen in the panels test. nor have i been able to add the magnifier control to the below script:

  // Initialize the reader element.
  Monocle.Events.listen(
    window,
    'load',
    function () { window.reader = Monocle.Reader('reader', null, {flipper: Monocle.Flippers.Instant, panel:Monocle.Panels.Marginal}, function (reader) {
      reader.moveTo({ page: 1 });
    }); }
  );

thx kindly for any insight.

best,

frank

fruscica commented 12 years ago

update:

am in the stretch run. specifically, trying to add controls to reader, starting with magnifier. below code fails at 'var magnifier' line. thx much for any insight.

// Initialize the reader element. Monocle.Events.listen( window, 'load', function () { var readerOptions = { flipper:Monocle.Flippers.Instant, panel:Monocle.Panels.Marginal };

    Monocle.Reader('thereader', bookData, readerOptions, function (rdr) {
                                            window.reader1 = rdr;
                                            var magnifier = new Monocle.Controls.Magnifier(rdr);
                                           rdr.addControl(magnifier);
                                           rdr.moveTo({ page: 2 }); 
                                                                     }
                   ); 
                  }
                       );
fruscica commented 12 years ago

fwiw, my implementation is online at http://novel.opportunitv.com/

fruscica commented 12 years ago

re: this code fragment:

Monocle.Reader('thereader', bookData, readerOptions, function (rdr) { window.reader1 = rdr; //var magnifier = new Monocle.Controls.Magnifier(rdr); //rdr.addControl(magnifier); rdr.moveTo({ page: 2 });

the above code works (i.e., page 2 shows on load). uncommenting the middle two lines yields no magnifier, and page 1 shows on load. thoughts? thx for any insight..

fruscica commented 12 years ago

ok, let me see what i can learn/copy from the dubliners example...

fruscica commented 12 years ago

Monocle.Controls.PlaceSaver is not a constructor? so says firebug (in firefox 8)...

fruscica commented 12 years ago

all right, let's regroup. i had the wrong paths for the control js files. fixed now.

this code loads the 2nd page of my book:

Monocle.Reader('thereader', bookData, readerOptions, function (rdr) { window.reader = rdr; var scrubber = new Monocle.Controls.Scrubber(rdr);
rdr.addControl(scrubber); rdr.moveTo({ page: 2 });

but no scrubber appears.

this is my only immediate-term need, as the scrubber is enough for returning readers to quickly find where they left off...

pls advise.

if you view the book (novel.opportunitv.com), you'll see that it is a great bet to get a lot of attention. by extension, then, monocle may get a lot of attention...

once my monocle-powered ebook is reader-friendly enough :-)

thx much for any insight...

fruscica commented 12 years ago

it turns out that i have to link to the css for the controls.

sigh...

issue closed! :-)

fedorinoGore commented 8 years ago

Years are passing by ^) But I have the same issue with scrubber. Could you please share - what do you mean by "it turns out that i have to link to the css for the controls."?