Download file:
The attached JavaScript file offers several toolbar scripts to use in custom buttons (in WebHelp). Supported functions are:
- Bookmark topic (add to favorites).
- Email link to topic.
- Expand all dropdowns and expandspots.
- Hide all dropdowns and expandspots.
- Print topic (and expand dropdowns and expandspots).
- Print topic (do not expand dropdowns and expandspots).
Note:
- Many thanks to Adobe and Peter Grainge for creating the original print script and the topicPane method.
- RoboHelp 8 and 9 are supported.(Other versions may work, but are not supported.)
- Standard RoboHelp twisties are supported.
- Only Firefox, Internet Explorer and Opera support setting bookmarks through JavaScript. Users with other browsers receive an alert with the URL of the current topic so they can set the bookmark manually.
- The bookmark script will not work for local WebHelp.
Setting up the script
- Add the script file as a baggage file to your project.
- If you use any twisty method other than the standard RoboHelp twisties, you need to set the variable RHTwisty to
false. - Open your skin in the skin editor and add a new button.
- Go to the Action tab and choose JavaScript in the Action section.
- In the JavaScript section, select External JavaScript and choose the script file.
- In the OnClick field, add the JavaScript function you want to use. Choose one of the following1:
- BookmarkTopic() → Bookmark the current topic.
- Email() → Send an email with the link to the current topic.
- Hide() → Hide dropdowns and expandspots.
- PrintTopic() → Expand dropdowns and expandspots and print the topic.
- PrintTopicNotExpand() → Print the topic.
- Show() → Expand dropdowns and expandspots.
- Save your skin.
- In the SSL dialog, choose the buttons you want to include in your output.
You can change the default title and message of the email as follows:
- For the message: Go to line 58 and add your message between the parenthesis.
- For the title: Go to line 57 and add your custom title before, after or instead of the function GetTopicTitle(), example:
var title = 'My custom title '+GetTopicTitle();
Revision history
| Version | Note |
|---|---|
| 20111005 |
|
| 20110828 | Added email function. |
| 20110114 | Initial version. |
- 1. Include the parenthesis.
