Javascript Tree Control [was: Serialization Menu]

Dear All, There was a discussion a couple weeks ago about the javascript menu in Robert Ramey's serialization docs. I suggested making a menu component available Boost-wide and testing it on a large number of browsers to address portability issues. I've written a preliminary version, documented here: http://tinyurl.com/6a9ym and downloadable from here (its a bit large because it contains a bunch of screenshots): http://tinyurl.com/6w56v (tree_control.zip) You can see the control in action here: http://tinyurl.com/6tdvy I've verified that it works -- with varying levels of functionality -- on 26 browsersincluding some antiques such as IE3.02.

"Jonathan Turkanis" <technews@kangaroologic.com> wrote in message news:ce75ir$pts$1@sea.gmane.org...
Dear All,
I've verified that it works -- with varying levels of
functionality --
on 26 browsersincluding some antiques such as IE3.02.
Whoops! I accidentally sent this message while trying to insert a space after 'browsers' Hmmm. I think all I had left to say was: Best Regards, Jonathan

Jonathan Turkanis writes:
Dear All,
There was a discussion a couple weeks ago about the javascript menu in Robert Ramey's serialization docs. I suggested making a menu component available Boost-wide and testing it on a large number of browsers to address portability issues. I've written a preliminary version, documented here:
and downloadable from here (its a bit large because it contains a bunch of screenshots):
http://tinyurl.com/6w56v (tree_control.zip)
You can see the control in action here:
I've verified that it works -- with varying levels of functionality -- on 26 browsersincluding some antiques such as IE3.02.
Jonathan, This looks very thought-out and generally splendid! -- Aleksey Gurtovoy MetaCommunications Engineering

Aleksey Gurtovoy <agurtovoy@meta-comm.com> writes:
Jonathan,
This looks very thought-out and generally splendid!
Yes, very nice! But is there a way to do away with the need to click the "sync" link? Can we have each navigation "auto-sync"? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote in message news:uisc5o9c2.fsf@boost-consulting.com...
Aleksey Gurtovoy <agurtovoy@meta-comm.com> writes:
Jonathan,
This looks very thought-out and generally splendid!
Yes, very nice!
Thanks!
But is there a way to do away with the need to click the "sync" link? Can we have each navigation "auto-sync"?
I'll give a more detailed reply to your other post. Jonathan

Hi Jonathan,
Dear All,
There was a discussion a couple weeks ago about the javascript menu in Robert Ramey's serialization docs. I suggested making a menu component available Boost-wide and testing it on a large number of browsers to address portability issues. I've written a preliminary version,
I should say that this versions is really "Tasteful", as you put it. It's clean, minimal and does not take much space. I'm particularly impressed in the number of browsers you've tested! - Volodya

"Vladimir Prus" <ghost@cs.msu.su> wrote in message news:ce7ks5$ipr$1@sea.gmane.org...
Hi Jonathan,
I should say that this versions is really "Tasteful", as you put it.
Thanks.
It's clean, minimal and does not take much space. I'm particularly impressed in the number of browsers you've tested!
Yeah, that part was exhausting! Jonathan

Jonathan Turkanis wrote:
There was a discussion a couple weeks ago about the javascript menu in Robert Ramey's serialization docs. I suggested making a menu component available Boost-wide and testing it on a large number of browsers to address portability issues. I've written a preliminary version, documented here:
...
I've verified that it works -- with varying levels of functionality -- on 26 browsersincluding some antiques such as IE3.02.
Didn't we agree on a non-JavaScript policy not too long ago? FWIW, the Tree Control doesn't work with links2 (The tree isn't visible. Instead, there is a link labeled "sync"; clicking it doesn't produce any result) Regards, m

Jonathan Turkanis wrote:
There was a discussion a couple weeks ago about the javascript menu in Robert Ramey's serialization docs. I suggested making a
"Martin Wille" <mw8329@yahoo.com.au> wrote in message news:410764D9.6010105@yahoo.com.au... menu
component available Boost-wide and testing it on a large number of browsers to address portability issues. I've written a preliminary version, documented here: ... I've verified that it works -- with varying levels of functionality -- on 26 browsersincluding some antiques such as IE3.02.
Didn't we agree on a non-JavaScript policy not too long ago?
Yes.
FWIW, the Tree Control doesn't work with links2
I should have put this in the documentation: The control should (I hope) work on any browser if one of the three following conditions is satisfied: 1. It supports no javascript at all (and understands the 'noscript' element) 2. It is reasonably conformant with the W3C DOM (level of required conformance currently unspecified) 3. It is a old version of IE, Netscape or Opera. In cases (1) and (3), the control displays in a fully expanded state. My idea was to presume that untested browsers satisfy (2), thereby allowing the control to function optimally on as many browsers as possible, and to add browsers to (3) as needed.
(The tree isn't visible. Instead, there is a link labeled "sync"; clicking it doesn't produce any result)
Thanks. I'll check it out. [sync] won't do anything unless the tree is displayed. Jonathan

"Martin Wille" <mw8329@yahoo.com.au> wrote in message news:410764D9.6010105@yahoo.com.au...
Jonathan Turkanis wrote:
FWIW, the Tree Control doesn't work with links2 (The tree isn't visible. Instead, there is a link labeled "sync"; clicking it doesn't produce any result)
I'd like to know what user-agent string links2 displays, since I don't have access to it. You can see it by visiting here: http://tinyurl.com/63ne2. Thanks, Jonathan

On Thu, 29 Jul 2004 10:39:21 -0600, Jonathan Turkanis wrote:
I'd like to know what user-agent string links2 displays, since I don't have access to it. You can see it by visiting here: http://tinyurl.com/63ne2.
userAgent = Links (2.1pre15: Linux 2.4.24-1-686 i686) Daniel

"Daniel James" <daniel@calamity.org.uk> wrote in message news:pan.2004.07.29.18.07.26.982311@calamity.org.uk...
On Thu, 29 Jul 2004 10:39:21 -0600, Jonathan Turkanis wrote:
I'd like to know what user-agent string links2 displays, since I don't have access to it. You can see it by visiting here: http://tinyurl.com/63ne2.
userAgent = Links (2.1pre15: Linux 2.4.24-1-686 i686)
Thanks! Jonathan

On Tue, 27 Jul 2004 21:19:38 -0600, Jonathan Turkanis wrote
Dear All,
There was a discussion a couple weeks ago about the javascript menu in Robert Ramey's serialization docs. I suggested making a menu component available Boost-wide and testing it on a large number of browsers to address portability issues. I've written a preliminary version, documented here:
and downloadable from here (its a bit large because it contains a bunch of screenshots):
http://tinyurl.com/6w56v (tree_control.zip)
You can see the control in action here:
I've verified that it works -- with varying levels of functionality - - on 26 browsersincluding some antiques such as IE3.02.
Overall the tree looks good, but how do I capture the URL for the current page? (I was able to do it with right mouse on the right pane, open in new window/tab). However, is there a way to get the address bar to point to the right frame instead of the left pane so that the current URL is immediately accessible? My major objection to frames is that I can't see and grab the current URL... Jeff

"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message news:20040728115709.M55567@crystalclearsoftware.com...
On Tue, 27 Jul 2004 21:19:38 -0600, Jonathan Turkanis wrote
Overall the tree looks good,
Thanks.
but how do I capture the URL for the current page?
(I was able to do it with right mouse on the right pane, open in new window/tab). However, is there a way to get the address bar to
This is what the [sync] button is for. When you press it, it's supposed to reload the documentation with a link that points directly to the page you were viewing, something like this: libs/golf/index.html?path=1.7.2 It only works in browsers which are reasonably conformant with the W3C DOM, but this includes the vast majority of browsers these days. What browser are you using? point to the
right frame instead of the left pane so that the current URL is immediately accessible? My major objection to frames is that I can't see and grab the current URL...
I agree. See http://tinyurl.com/3sdu6. Jonathan

On Wed, 28 Jul 2004 09:41:22 -0600, Jonathan Turkanis wrote
On Tue, 27 Jul 2004 21:19:38 -0600, Jonathan Turkanis wrote (I was able to do it with right mouse on the right pane, open in new window/tab). However, is there a way to get the address bar to
"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message news:20040728115709.M55567@crystalclearsoftware.com... point to the
right frame instead of the left pane so that the current URL is immediately accessible? My major objection to frames is that I can't see and grab the current URL...
I agree. See http://tinyurl.com/3sdu6.
Thanks, for the pointer on sync. I didn't read all the rationale. I wish I could come up with a more intuitive name -- it didn't hit me at first what sync was for. Anyway, I was using Firefox 0.9.1 on Linux. I tested a couple more browsers: Galeon 1.3.12 and Epiphany 1.0.7 automatically sync -- very cool! Konqueror 3.2.0 does not :( Oh, and I'm of course in support of boost-book initiatives to generate these capabilties -- after all, transformation to various forms is the whole point of getting the docs into xml... Jeff

Jeff Garland wrote:
On Wed, 28 Jul 2004 09:41:22 -0600, Jonathan Turkanis wrote
On Tue, 27 Jul 2004 21:19:38 -0600, Jonathan Turkanis wrote (I was able to do it with right mouse on the right pane, open in new window/tab). However, is there a way to get the address bar to
"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message news:20040728115709.M55567@crystalclearsoftware.com... point to the
right frame instead of the left pane so that the current URL is immediately accessible? My major objection to frames is that I can't see and grab the current URL...
I agree. See http://tinyurl.com/3sdu6.
Thanks, for the pointer on sync. I didn't read all the rationale. I wish I could come up with a more intuitive name -- it didn't hit me at first what sync was for. Anyway, I was using Firefox 0.9.1 on Linux. I tested a couple more browsers: Galeon 1.3.12 and Epiphany 1.0.7 automatically sync -- very cool! Konqueror 3.2.0 does not :(
But 3.2.2 does the right thing when I click on "sync". - Volodya

On Thu, 29 Jul 2004 17:31:46 +0400, Vladimir Prus wrote
Jeff Garland wrote:
Thanks, for the pointer on sync. I didn't read all the rationale. I wish I could come up with a more intuitive name -- it didn't hit me at first what sync was for. Anyway, I was using Firefox 0.9.1 on Linux. I tested a couple more browsers: Galeon 1.3.12 and Epiphany 1.0.7 automatically sync -- very cool! Konqueror 3.2.0 does not :(
But 3.2.2 does the right thing when I click on "sync".
Sorry, I think I was perhaps unclear. Galeon 1.3.12 and Epiphany 1.0.7 put the actual URL into the address without using the sync 'button'. All 4 do the right thing when I manually hit sync. Jeff

"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message news:20040729143347.M44812@crystalclearsoftware.com...
more browsers: Galeon 1.3.12 and Epiphany 1.0.7 automatically sync -- very cool! Konqueror 3.2.0 does not :(
But 3.2.2 does the right thing when I click on "sync".
Sorry, I think I was perhaps unclear. Galeon 1.3.12 and Epiphany 1.0.7 put the actual URL into the address without using the sync 'button'. All 4 do the right thing when I manually hit sync.
<sigh of relief> Jonathan

Jeff Garland wrote:
On Thu, 29 Jul 2004 17:31:46 +0400, Vladimir Prus wrote
Jeff Garland wrote:
Thanks, for the pointer on sync. I didn't read all the rationale. I wish I could come up with a more intuitive name -- it didn't hit me at first what sync was for. Anyway, I was using Firefox 0.9.1 on Linux. I tested a couple more browsers: Galeon 1.3.12 and Epiphany 1.0.7 automatically sync -- very cool! Konqueror 3.2.0 does not :(
But 3.2.2 does the right thing when I click on "sync".
Sorry, I think I was perhaps unclear. Galeon 1.3.12 and Epiphany 1.0.7 put the actual URL into the address without using the sync 'button'. All 4 do the right thing when I manually hit sync.
Oh, I think that's probably more than we can expect. FWIW, Galeon 1.3.16 does not put the actual URL for me.... magic... - Volodya

"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message:
Thanks, for the pointer on sync. I didn't read all the rationale. I wish I could come up with a more intuitive name -- it didn't hit me at first what sync was for.
Yeah, I know. I can't think of one either. Maybe a 'tool tip' could clear things up -- but I'm afraid this would fall into the 'just annoying in general' category. Jonathan

"Jonathan Turkanis" <technews@kangaroologic.com> writes:
"Jeff Garland" <jeff@crystalclearsoftware.com> wrote in message:
Thanks, for the pointer on sync. I didn't read all the rationale. I wish I could come up with a more intuitive name -- it didn't hit me at first what sync was for.
Yeah, I know. I can't think of one either.
Maybe a 'tool tip' could clear things up -- but I'm afraid this would fall into the 'just annoying in general' category.
[link to this page] It should do two things: 1. Copy the link to the clipboard if possible 2. Display the link in the address field of the browser It should have a tooltip that tells you what it will do. Ideally of course there would be no need for this link and we'd always see a linkable address in the browser's address field. I take it this is only possible on some browsers? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"David Abrahams" <dave@boost-consulting.com> wrote in message news:ud62do956.fsf@boost-consulting.com...
"Jonathan Turkanis" <technews@kangaroologic.com> writes:
Maybe a 'tool tip' could clear things up -- but I'm afraid this would fall into the 'just annoying in general' category.
[link to this page]
Yes. This is good. I was hoping for a one word solution, but maybe this is the best we can do.
It should do two things:
1. Copy the link to the clipboard if possible
I believe copying to the clipboard is basically a microsoft feature. It can be done on Mozilla/Netscape only if the user grants 'enhanced privileges' to a site -- the browser displays a dialog with a cryptic message that says nothing about the clipboard. It's easy to enable this feature only microsoft browsers, but it seems a bit inappropriate for Boost to have a site which is 'best viewed with Internet Explorer'.
2. Display the link in the address field of the browser
It should have a tooltip that tells you what it will do.
How's this: "reloads current page with a url suitable for bookmarking" ?
Ideally of course there would be no need for this link and we'd always see a linkable address in the browser's address field.
Reece Dunne asked this question, and I was going to paste my reply here but I see it's not quite correct. The way to do this would be to replace each link of the form <a href='reference/copy.html'>copy</a> with one like: <a target='_top' href='reference/copy.html?path=1.7.2'>copy</a> Obviously, this makes it very difficult to write and maintain documentation unless it is automated. A problem that remains even if the docs are automatically generated is that links within a page cause the browser to reload instead of just scroll. I'd love synchronization to be automatic but I just don't see how to do it.
I take it this is only possible on some browsers?
When a new document is loaded into an internal frame, some browsers will display the url in the address bar. I'm not sure that this is a feature, though, since if you bookmark the page you loose the context. I think I'll make this question the first FAQ. Jonathan

Jonathan Turkanis wrote:
"David Abrahams" <dave@boost-consulting.com> wrote in message news:ud62do956.fsf@boost-consulting.com...
Ideally of course there would be no need for this link and we'd always see a linkable address in the browser's address field.
Reece Dunne asked this question, and I was going to paste my reply here but I see it's not quite correct. The way to do this would be to replace each link of the form
<a href='reference/copy.html'>copy</a>
with one like:
<a target='_top' href='reference/copy.html?path=1.7.2'>copy</a>
Obviously, this makes it very difficult to write and maintain documentation unless it is automated. A problem that remains even if the docs are automatically generated is that links within a page cause the browser to reload instead of just scroll.
I'd love synchronization to be automatic but I just don't see how to do it.
It's possible but only if you invert the relation between the frames and the documents. If instead of making a frameset with the tree and the document you could instead make the document inline the tree frame inside the document page and hence the URL would always be direct (using iframe tag). This might be contrary to one of the intrusion principles, but it would solve the problem. -- -- Grafik - Don't Assume Anything -- Redshift Software, Inc. - http://redshift-software.com -- rrivera/acm.org - grafik/redshift-software.com - 102708583/icq

"Rene Rivera" <grafik.list@redshift-software.com> wrote in message news:410B0839.1030106@redshift-software.com...
Jonathan Turkanis wrote:
I'd love synchronization to be automatic but I just don't see how
to
do it.
It's possible but only if you invert the relation between the frames and the documents. If instead of making a frameset with the tree and the document you could instead make the document inline the tree frame inside the document page and hence the URL would always be direct (using iframe tag). This might be contrary to one of the intrusion
principles,
but it would solve the problem.
Thanks. I actually think the docs would look better with the tree in the same frame as the content. Here are the problems I see: 1. Intrusive (as you say) 2. When viewing a long html document the tree may scroll out of view. It's possible to make it float back into view automatically, but I find this very annoying. 3. The whole tree has to reload each time you visit a new page. This could be a problem with big trees -- say if a library author wants to add tree nodes for each function, class and concept in a large library. 4. In browsers which understand a little javascript but not enough to display the tree dynamically, the html for the tree is output using document.write(). In old browsers this sometimes obliterates the rest of the content of the document, or puts the newly written stuff at the bottom or the top. These old browsers behave very differently -- it was a bit of a challenge to get them to all display the same thing. So if I go this route I'll have to reimplement the tree so that the HTML is statically generated, as in the serialization docs. 1 and 3 seem like the biggest problems to me. 1 would be solved if the docs were automatically generated. Any suggestions? Jonathan

"Rene Rivera" <grafik.list@redshift-software.com> wrote in message news:410B0839.1030106@redshift-software.com...
Jonathan Turkanis wrote:
I'd love synchronization to be automatic but I just don't see how to do it.
It's possible but only if you invert the relation between the frames and the documents. If instead of making a frameset with the tree and the document you could instead make the document inline the tree frame inside the document page and hence the URL would always be direct (using iframe tag). This might be contrary to one of the intrusion principles, but it would solve the problem.
I've thought a bit more about this, and it occured to me that if the tree is displayed in the same frame as the content, it's state will not be preserved when a link is followed unless this info is added to the url. So it appears this idea suffers from the same problems as Reece's suggestion. Jonathan
participants (8)
-
Aleksey Gurtovoy
-
Daniel James
-
David Abrahams
-
Jeff Garland
-
Jonathan Turkanis
-
Martin Wille
-
Rene Rivera
-
Vladimir Prus