locus search is not working.

已查看 105 次
跳至第一个未读帖子

Jugesh Rai

未读,
2013年10月12日 14:15:142013/10/12
收件人 monoc...@googlegroups.com
Hi,
    I am working on an android epub reader application using monocle js. I have created TOC contents from ncx file through android code. and  clicking on toc icon i m generating this android dialog box to show list of contents(TOC). now i call locus search function (goToXpath) to skip to those pages, but it is rendering to first page only. Any kind of help will be appreciated. please guide me through it.

Robert Schroll

未读,
2013年10月12日 14:39:042013/10/12
收件人 monoc...@googlegroups.com
On Sat, Oct 12, 2013 at 3:15 PM, Jugesh Rai <itsj...@gmail.com> wrote:
> Hi,
> I am working on an android epub reader application using monocle
> js. I have created TOC contents from ncx file through android code.
> and clicking on toc icon i m generating this android dialog box to
> show list of contents(TOC). now i call locus search function
> (goToXpath) to skip to those pages, but it is rendering to first page
> only.
>

I don't know about that specific problem, but I had success with a
different approach in an epub reader I wrote for Ubuntu Touch (Beru, at
https://github.com/rschroll/beru). I use the reader.skipToChapter()
function to move to the beginning of chapters. This function takes a
single argument, the url of the chapter, which you can get from the src
attribute of the <content> tag in each <navPoint> tag in the ncx file.
(In a Epub2 file, at least. It's slightly different for Epub3.) Maybe
that'll work for you.

Robert



Jugesh Rai

未读,
2013年10月12日 15:28:582013/10/12
收件人 monoc...@googlegroups.com
Thanks for your reply... my confusion is that I am creating TOC list dynamically though android code. now on touch of chapter title's from list, it should go to respective page. For that I am using monocle function:
  function goToXPath(cmptId, xpath) {
        window.reader.moveTo(
          { componentId: cmptId, xpath: xpath },
          function () {
            highlight(function (doc) { return nodeForXPath(doc, xpath) });
          }
        );
      }
and passing the cmptId and xpath  dynamically for each title.. but it is not redirecting to the target page

Joseph Pearson

未读,
2013年10月12日 22:01:342013/10/12
收件人 monoc...@googlegroups.com
Depending on the Android version, you may find that the webview does not implement XPath. I believe that's true of Android < 4 — this page will tell you: http://test.monoclejs.com/test/compat/index.html

An alternative is to jump to the chapter and a specific anchor, then in the monocle:componentmodify, assign that id to the relevant element yourself.

— J
--
You received this message because you are subscribed to the Google Groups "Monocle" group.
To unsubscribe from this group and stop receiving emails from it, send an email to monocle-js+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Jugesh Rai

未读,
2013年10月13日 03:10:482013/10/13
收件人 monoc...@googlegroups.com
Thanks Joseph I tried with your suggestion but unable to figure out may be some issues from my end. Can you give me some sample code how to call jump and monocle:componentmodify.
To unsubscribe from this group and stop receiving emails from it, send an email to monocle-js+unsubscribe@googlegroups.com.

Jugesh Rai

未读,
2013年10月14日 09:45:402013/10/14
收件人 monoc...@googlegroups.com
Hi Joseph,
 I tried with android version > 4 also but  goToXPath() is not working...


On Sunday, October 13, 2013 7:31:34 AM UTC+5:30, Joseph Pearson wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to monocle-js+unsubscribe@googlegroups.com.

Santhakumar Nagalingam

未读,
2016年3月7日 09:05:492016/3/7
收件人 Monocle
Hi Joseph,
I am facing same issue in my android application.

Please share me fix if you find anything.

Thanks,
Santhakumar.N
回复全部
回复作者
转发
0 个新帖子