expand browser based toc chapter with 1 click

This is the place to discuss Help & Manual 4 issues. Please don't post questions on any other versions here!

Moderators: Alexander Halser, Tim Green

Post Reply
job
Posts: 2
Joined: Sat Sep 30, 2006 3:03 pm

expand browser based toc chapter with 1 click

Unread post by job »

I want a TOC chapter in a browser based help to expand with single click. It now only expands with a double click.

Because someone normally doesn't click on a hyperlink 2 times I'm sure a lot of users will never see the sub-chapters.

I look at the generated html file with the TOC. A snippet looks like:

Code: Select all

<a id="a2.1" href="workspace.htm" target="hmcontent" onclick="return parent.hilight('s2.1')" ondblclick="javascript:parent.toggle('div2.1')">
  <span id="s2.1" class="heading2">Chapter2
  </span>
</a>
I think what I need is to happen on the the 'onclick' event what now only happens on the 'ondblclick' event. Anyone knows how to do this?

Because the TOC html file gets generated every time I cannot simply edit the file. The only thing I can come up with is to edit the TOC file myself every time and copy it over the generated one. But that defeats the use of HM a little, which in itself is a great piece of software.
User avatar
Tim Green
Site Admin
Posts: 23186
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

Job,

This is already possible, you just need to know how the icons in Browser Help work. Basically, they emulate the HTML Help viewer as closely as possible:
  • Single-clicking on the node icon expands and collapses the node without selecting.
  • Single-clicking on the topic caption (i.e. the text) selects the topic without expanding or collapsing.
  • Double-clicking on the topic caption (text) selects and expands or collapses.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
John Waller
Posts: 827
Joined: Thu Apr 20, 2006 9:34 pm
Location: Adelaide, South Australia

Unread post by John Waller »

- Single-clicking on the topic caption (i.e. the text) selects the topic without expanding or collapsing.
- Double-clicking on the topic caption (text) selects and expands or collapses.
Hi Tim,

Is it possible to merge the two behaviours so that single-clicking on the topic caption (text) selects and expands or collapses?
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Unread post by Martin Wynne »

Tim Green wrote:you just need to know how the icons in Browser Help work. Basically, they emulate the HTML Help viewer as closely as possible
Hi Tim,

I know that's the intention, but is it actually a sound idea?

If users find themselves in their web browser, they are more likely to expect what they see to work like a web page -- where double-clicking is almost unknown, and the expectation is to single-click on a named link, not a tiny node icon. If the link did nothing when single-clicked, users might try double-clicking it. But seeing it highlight when clicked, the assumption is that that is all it does.

Also, in my case I have set my computers for single-clicking on everything. This behaviour of the CHM Help and H&M's Browser Help is just about the only place left where I have to remember to double-click. I can't be the only one who does this -- I believe double-clicking is regarded as the main cause of RSI.

I agree that many users will never find this functionality. Frequently I have to explain to my users the most elementary things -- only today I had a user who hadn't realised he could search a web page with Find On This Page (Ctrl-F).

Also I fail to see the logic -- once the chapter link is highlighted and the parent topic showing, users are obviously going to want the child topics. Why make them double-click again to see them? And if the parent is a "chapter without text", single-clicking it serves no purpose at all.

Even Microsoft seem to have realised that double-clicking is daft -- try the Help for IE. There are no + nodes -- the chapters expand on a single click.

Martin.
User avatar
Tim Green
Site Admin
Posts: 23186
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Unread post by Tim Green »

John, Martin,

At the moment the code for the TOC in BB Help is hard wired and cannot be changed. I agree that one could argue as to whether the "click logic" of the BBH's TOC might be made more n00b-friendly. Perhaps it would be better to start a thread in Wish List section for this... 8)
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Unread post by Martin Wynne »

Hi John, Tim,
Tim Green wrote:At the moment the code for the TOC in BB Help is hard wired and cannot be changed.
It can be kludged. Before uploading projectname_content_dyn.html, open it in a text editor and make the following global changes:

1. replace all strings onclick with zzz (or anything invalid)

2. replace all strings ondblclick with onclick

The chapters then expand when clicked, but you lose the highlighting.

You can make a script or macro in your text editor to do this before each upload.

Your mileage may vary. May contain nuts. :)

Martin.
User avatar
John Waller
Posts: 827
Joined: Thu Apr 20, 2006 9:34 pm
Location: Adelaide, South Australia

Unread post by John Waller »

Hi Martin,

Taking that interesting kludge a step further, the code structure is identical (at least in my compiled BBH H&M4 projects) for each TOC entry in projectname_content_dyn.html.

Thus amending the following code:

Code: Select all

onclick="return parent.hilight('s2')" ondblclick="javascript:parent.toggle('div2')">
for each TOC entry (where s2 and div2 are variables identifying each TOC entry)

to end up with

Code: Select all

onclick="return parent.hilight('s2') && parent.toggle('div2')">
in each case should combine the two Javascript events to be simultaneously triggered by the same single click behaviour and produce the desired result i.e. expand/collapse the child entries on a single click of the TOC text and maintain the highlighting of the parent entry.

Thus Find

Code: Select all

" ondblclick="javascript:
in the original compiled code,

and Replace All with

Code: Select all

  &&  
(that's space+&+&+space)

should produce the desired end result in projectname_content_dyn.html.

Just a thought. Use at your own risk etc.
Last edited by John Waller on Mon Oct 02, 2006 2:18 pm, edited 1 time in total.
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Unread post by Martin Wynne »

johnw wrote:Thus Find

Code: Select all

" ondblclick="
in the original compiled code,

and Replace All with

Code: Select all

; 
should produce the desired end result in projectname_content_dyn.html.
Hi John,

Yes, I tried that first. But it doesn't work. Have I missed something -- have you got it working? :?

Martin.
User avatar
John Waller
Posts: 827
Joined: Thu Apr 20, 2006 9:34 pm
Location: Adelaide, South Australia

Unread post by John Waller »

Have I missed something -- have you got it working?
I've got it partially working (50% of cases) using " && " to combine the events.

I'll have to delve deeper into my JS repositories...
Regards

John Waller
v.6.2.2 Build 2636
User avatar
Martin Wynne
Posts: 2656
Joined: Mon May 12, 2003 3:21 pm
Location: West of the Severn, UK

Unread post by Martin Wynne »

johnw wrote:I've got it partially working (50% of cases) using " && " to combine the events.
Hi John,

Isn't && a logical operator?

Another option is to replace the onclick with onmouseover. Not quite the same as fixed highlighting, but the "feel" is similar.

Can cause some lack of sync -- mouseover a topic highlights it instead of the topic content currently showing.

Martin.
xtreze
Posts: 1
Joined: Mon Dec 04, 2006 6:07 pm

Unread post by xtreze »

Guys, I have this working - requires to search & replace operations on the toc page:

FIRST search:
onclick="return parent.hilight

replace with:
onclick="parent.hilight


THEN search:
)" ondblclick="javascript:parent.toggle(

replace with:
); parent.toggle(

I wish there was some way of specifying this level of attribute the app...but can't have it all I guess.

Hope this helps....
Post Reply