docbook-apps

  • 1.  webhelp local anchors in table of contents not working

    Posted 03-25-2014 03:23
      |   view attached
    I am having trouble navigating using the webhelp navigation panel when I
    click on a local anchor.

    I have the chunk.section.depth parameter set to 1.

    The following docbook sample demonstrates the problem:


    <book id="Test" xmlns="http://docbook.org/ns/docbook" version="5.0">

    <chapter>

    <para>Text of section 1.1</para>

    <para>Text of section 1.1.2</para>


    <para>Text of section 1.1.2</para>


    </chapter>
    <chapter></chapter>
    </book>

    Once I have browsed to the file which contains the Section 1.1 (see
    attached ch01s01.html), I cannot browse to Section 1.1.1 or Section 1.2.2,
    which are local to that file. The HTML looks fine, so I am guessing this is
    a javascript issue.

    Nat

    Attachment(s)

    html
    ch01s01.html   12 KB 1 version


  • 2.  Re: webhelp local anchors in table of contents not working

    Posted 03-25-2014 05:02
    I think I have the source of this problem, which is the following code in
    main.js (also the source of another problem I was having):

    // When you click on a link to an anchor, scroll down
    // 105 px to cope with the fact that the banner
    // hides the top 95px or so of the page.
    // This code deals with the problem when
    // you click on a link within a page.
    $('a[href*=#]').click(function() {
    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    && location.hostname == this.hostname) {
    var $target = $(this.hash);
    $target = $target.length && $target
    || $('[name=' + this.hash.slice(1) +']');
    if (!(this.hash == "#searchDiv" || this.hash == "#treeDiv" || this.hash ==
    "") && $target.length) {
    var targetOffset = $target.offset().top - 120;
    $('html,body')
    .animate({scrollTop: targetOffset}, 200);
    return false;
    }
    }
    });

    When I comment out this code, I can click on the anchors successfully.

    Any chance of this getting fixed sometime soon?

    Nat


    On Tue, Mar 25, 2014 at 2:22 PM, natk <nkershaw@gmail.com> wrote:

    > I am having trouble navigating using the webhelp navigation panel when I
    > click on a local anchor.
    >
    > I have the chunk.section.depth parameter set to 1.
    >
    > The following docbook sample demonstrates the problem:
    >
    >
    > <book id="Test" xmlns="http://docbook.org/ns/docbook" version="5.0">
    >
    > <chapter>
    >

    > <para>Text of section 1.1</para>
    >

    > <para>Text of section 1.1.2</para>
    >

    >

    > <para>Text of section 1.1.2</para>
    >

    >

    > </chapter>
    > <chapter></chapter>
    > </book>
    >
    > Once I have browsed to the file which contains the Section 1.1 (see
    > attached ch01s01.html), I cannot browse to Section 1.1.1 or Section 1.2.2,
    > which are local to that file. The HTML looks fine, so I am guessing this is
    > a javascript issue.
    >
    > Nat
    >



  • 3.  Re: [docbook-apps] Re: webhelp local anchors in table of contents not working

    Posted 03-25-2014 07:14
    The above code is kind of a hack to workaround an issue. The reason is
    explained in the source itself that you have pointed. We need to think what
    would be the proper approach to fix rather than having a workaround. The
    current alternative we have has some drawbacks. I guess I provided you the
    link to it previously.


    On Tue, Mar 25, 2014 at 10:31 AM, natk <nkershaw@gmail.com> wrote:

    > I think I have the source of this problem, which is the following code in
    > main.js (also the source of another problem I was having):
    >
    > // When you click on a link to an anchor, scroll down
    > // 105 px to cope with the fact that the banner
    > // hides the top 95px or so of the page.
    > // This code deals with the problem when
    > // you click on a link within a page.
    > $('a[href*=#]').click(function() {
    > if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    > && location.hostname == this.hostname) {
    > var $target = $(this.hash);
    > $target = $target.length && $target
    > || $('[name=' + this.hash.slice(1) +']');
    > if (!(this.hash == "#searchDiv" || this.hash == "#treeDiv" || this.hash
    > == "") && $target.length) {
    > var targetOffset = $target.offset().top - 120;
    > $('html,body')
    > .animate({scrollTop: targetOffset}, 200);
    > return false;
    > }
    > }
    > });
    >
    > When I comment out this code, I can click on the anchors successfully.
    >
    > Any chance of this getting fixed sometime soon?
    >
    > Nat
    >
    >
    > On Tue, Mar 25, 2014 at 2:22 PM, natk <nkershaw@gmail.com> wrote:
    >
    >> I am having trouble navigating using the webhelp navigation panel when I
    >> click on a local anchor.
    >>
    >> I have the chunk.section.depth parameter set to 1.
    >>
    >> The following docbook sample demonstrates the problem:
    >>
    >>
    >> <book id="Test" xmlns="http://docbook.org/ns/docbook" version="5.0">
    >>
    >> <chapter>
    >>

    >> <para>Text of section 1.1</para>
    >>

    >> <para>Text of section 1.1.2</para>
    >>

    >>

    >> <para>Text of section 1.1.2</para>
    >>

    >>

    >> </chapter>
    >> <chapter></chapter>
    >> </book>
    >>
    >> Once I have browsed to the file which contains the Section 1.1 (see
    >> attached ch01s01.html), I cannot browse to Section 1.1.1 or Section 1.2.2,
    >> which are local to that file. The HTML looks fine, so I am guessing this is
    >> a javascript issue.
    >>
    >> Nat
    >>
    >
    >


    --
    ~~~*******'''''''''''''*******~~~
    *Kasun Gajasinghe*
    Software Engineer; WSO2 Inc.; http://wso2.com,
    *linked-in: *http://lk.linkedin.com/in/gajasinghe
    *blog: **http://blog.kasunbg.org* <http://blog.kasunbg.org/>


    *twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg>



  • 4.  Re: [docbook-apps] Re: webhelp local anchors in table of contents not working

    Posted 03-25-2014 22:55
    Yes, I've looked at that issue. I have not encountered it in my own books
    yet.

    This current one though is a webhelp showstopper for anyone who is not
    chunking every section. Not having all of the anchors working from the
    table of contents defeats most of the purpose of this output format.

    Nat




    On Tue, Mar 25, 2014 at 6:14 PM, Kasun Gajasinghe <kasunbg@gmail.com> wrote:

    > The above code is kind of a hack to workaround an issue. The reason is
    > explained in the source itself that you have pointed. We need to think what
    > would be the proper approach to fix rather than having a workaround. The
    > current alternative we have has some drawbacks. I guess I provided you the
    > link to it previously.
    >
    >
    > On Tue, Mar 25, 2014 at 10:31 AM, natk <nkershaw@gmail.com> wrote:
    >
    >> I think I have the source of this problem, which is the following code in
    >> main.js (also the source of another problem I was having):
    >>
    >> // When you click on a link to an anchor, scroll down
    >> // 105 px to cope with the fact that the banner
    >> // hides the top 95px or so of the page.
    >> // This code deals with the problem when
    >> // you click on a link within a page.
    >> $('a[href*=#]').click(function() {
    >> if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
    >> && location.hostname == this.hostname) {
    >> var $target = $(this.hash);
    >> $target = $target.length && $target
    >> || $('[name=' + this.hash.slice(1) +']');
    >> if (!(this.hash == "#searchDiv" || this.hash == "#treeDiv" || this.hash
    >> == "") && $target.length) {
    >> var targetOffset = $target.offset().top - 120;
    >> $('html,body')
    >> .animate({scrollTop: targetOffset}, 200);
    >> return false;
    >> }
    >> }
    >> });
    >>
    >> When I comment out this code, I can click on the anchors successfully.
    >>
    >> Any chance of this getting fixed sometime soon?
    >>
    >> Nat
    >>
    >>
    >> On Tue, Mar 25, 2014 at 2:22 PM, natk <nkershaw@gmail.com> wrote:
    >>
    >>> I am having trouble navigating using the webhelp navigation panel when I
    >>> click on a local anchor.
    >>>
    >>> I have the chunk.section.depth parameter set to 1.
    >>>
    >>> The following docbook sample demonstrates the problem:
    >>>
    >>>
    >>> <book id="Test" xmlns="http://docbook.org/ns/docbook" version="5.0">
    >>>
    >>> <chapter>
    >>>

    >>> <para>Text of section 1.1</para>
    >>>

    >>> <para>Text of section 1.1.2</para>
    >>>

    >>>

    >>> <para>Text of section 1.1.2</para>
    >>>

    >>>

    >>> </chapter>
    >>> <chapter></chapter>
    >>> </book>
    >>>
    >>> Once I have browsed to the file which contains the Section 1.1 (see
    >>> attached ch01s01.html), I cannot browse to Section 1.1.1 or Section 1.2.2,
    >>> which are local to that file. The HTML looks fine, so I am guessing this is
    >>> a javascript issue.
    >>>
    >>> Nat
    >>>
    >>
    >>
    >
    >
    > --
    > ~~~*******'''''''''''''*******~~~
    > *Kasun Gajasinghe*
    > Software Engineer; WSO2 Inc.; http://wso2.com,
    > *linked-in: *http://lk.linkedin.com/in/gajasinghe
    > *blog: **http://blog.kasunbg.org* <http://blog.kasunbg.org/>
    >
    >
    > *twitter: **http://twitter.com/kasunbg* <http://twitter.com/kasunbg>
    >



  • 5.  Re: [docbook-apps] Re: webhelp local anchors in table of contents not working

    Posted 04-04-2014 13:56
    On 25.3.2014 8:14, Kasun Gajasinghe wrote:
    > The above code is kind of a hack to workaround an issue. The reason is
    > explained in the source itself that you have pointed. We need to think what
    > would be the proper approach to fix rather than having a workaround. The
    > current alternative we have has some drawbacks. I guess I provided you the
    > link to it previously.

    I think that main problem is that JS code in main.js is not working with
    DOM generated by stylesheets. I have commited change September 2013 for
    this issue. I would suggest to OP trying the latest version of main.js
    from SVN repo.

    http://sourceforge.net/p/docbook/code/9798/tree//trunk/xsl/webhelp/template/common/main.js?diff=9592

    Jirka



    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
    ------------------------------------------------------------------
    Bringing you XML Prague conference http://xmlprague.cz
    ------------------------------------------------------------------




  • 6.  Re: [docbook-apps] Re: webhelp local anchors in table of contents not working

    Posted 04-08-2014 00:19
    Thanks. I will give that a try.


    On Sat, Apr 5, 2014 at 12:55 AM, Jirka Kosek <jirka@kosek.cz> wrote:

    > On 25.3.2014 8:14, Kasun Gajasinghe wrote:
    > > The above code is kind of a hack to workaround an issue. The reason is
    > > explained in the source itself that you have pointed. We need to think
    > what
    > > would be the proper approach to fix rather than having a workaround. The
    > > current alternative we have has some drawbacks. I guess I provided you
    > the
    > > link to it previously.
    >
    > I think that main problem is that JS code in main.js is not working with
    > DOM generated by stylesheets. I have commited change September 2013 for
    > this issue. I would suggest to OP trying the latest version of main.js
    > from SVN repo.
    >
    >
    > http://sourceforge.net/p/docbook/code/9798/tree//trunk/xsl/webhelp/template/common/main.js?diff=9592
    >
    > Jirka
    >
    >
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML consulting and training services
    > DocBook customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep.
    > ------------------------------------------------------------------
    > Bringing you XML Prague conference http://xmlprague.cz
    > ------------------------------------------------------------------
    >
    >