![]() ![]() |
This approach tends to make the Help less contiguous; the Paint Shop Pro support information that the user is looking for could be in the Help file, could be at the Support Center, or could be on the Jasc Software web site. A different approach might be to present the Help file as the repository for all support information. Let's look at how we might accomplish this. External HTML Help TOC Nodes
|
||||||||||||||||||||||
| The latest Help version available is: | 15NOV02 | |
| Download the latest version now. | ||
This information might be useful, but it doesn't tell the user what Help version he or she has. Using a bit of JavaScript, we can solve this problem. Firstly, we must change the link to latesthelp.htm slightly. We need to add a query string (or parameter) to the URL used on the TOC, so that it reads: http://www.myapp.com/support/latesthelp.htm?ver=11APR02
The user won't notice this, of course, as the URL is "underneath" the Latest Help Updates node title. We will have to modify change this link every time we release a new version of our Help file. Now, we need to add some JavaScript to our latesthelp.htm file so that it displays all but the first five characters (?ver=). The JavaScript will be:
<script language="JavaScript1.2" type="text/javascript"> <!-- // document.write(location.search.substring(5)); //--> </script>
and we place it adjacent to a new line describing the user's Help version. So the text the user sees on latesthelp.htm will now be:
| Your current Help version available is: | 11APR02 | |
| The latest Help version available is: | 15NOV02 | |
| Download the latest version now. | ||
If you have plenty of time, you could embellish the JavaScript so that the Download the latest version now line did not display if the user had the most recent release.
We've just seen how some JavaScript provided a neat solution to being able to display the user's Help version. This will work if the user thinks to go to the Latest Help Updates node on the TOC. (How many users think? I hear you ask!) We can use some similar clever ideas to be a little more proactive.
The result we want to accomplish is this... when a user opens the CHM file, and there has been a new update released in the last four weeks, some sort of alert flashes on every page of the CHM file.
The first thing we have to do is add a little line to the top of every topic indicating that we wish to use an external JavaScript file. This will be easy to do in some HATs, but more difficult in others. Essentially, we need to add the following line in the <head> section of every topic:
<script language="JavaScript1.2" type="text/javascript" src="http://www.myapp.com/support/jscheck.js"></script>
If you are familiar with HTML and JavaScript, you will recognize this method as a common technique for storing JavaScript routines in a separate file, and "including" them when they're needed. Our CHM file is therefore going to try to include the JavaScript file. Fortunately for us, if the user is not connected, we won't get an error message. (That's lucky!)
![]()
That's the easy part. The difficult part is to write a JavaScript routine that will display some sort of alert. Being a proponent of the R&D philosophy (where R&D stands for Rip-off and Duplicate), I found a free script by Stefano Occhetti on a site called The JavaScript Source,
and modified it to make it suitable. The original script created the effect of a blowfly GIF following the mouse cursor around. Yes, a blowfly. Fearing user backlash, I changed this to an image of a butterfly, but you might want to replace the image with something that suits your purposes. I suggest an image of the words "Help Updates Available!":
I also added a link from the image to the latesthelp.htm page.
The JavaScript routine is quite lengthy, but fortunately you don't need to understand it. You just have to copy it and save it into a file called jscheck.js, and then replace any references to www.myapp.com in the code to your own Web server.
The last thing to do is to create your images, and upload them along with jscheck.js to your Web server. The original script uses eight different images to animate the effect, but if you don't need animation, just reference the same picture eight times. The images are expected to be named mosca_1.gif through to mosca_8.gif. Two additional images (mosca_OFF.gif and mosca_ON.gif) are used in a feature that will appear at the bottom of each page, allowing the user to turn the images on and off (usually off!).
This explanation will more easily be understood if you take a look at it in action.
Although it is difficult to click the butterfly, it is possible!
By removing, renaming, or changing the jscheck.js file on the Web server, we can effectively turn on and turn off the feature. When the jscheck.js file is in place, the effect will appear (when the user is connected). When the file is not in place, the effect will not appear.
The butterfly effect is amusing, but not professional enough for many purposes. You may also felt a chill when you noted that the above script involved 10 images and a scary JavaScript file, which you had to modify! If so, calm down and take a big breath. Any JavaScript that adds any sort of visible effect will work under the same concept. For example, you could more simply (do you like that word?) include an image on your page which has its display style setting set to none. (The display style setting is a Dynamic HTML feature. It is set as in the example <img src="a.gif" id="pic" style="display:none">.) Our JavaScript could simply change the display setting of the image to on. In other words, If the script file is available, the image will display. Let's simulate that idea now. There is an image immediately below this paragraph, with its display setting turned off.
For our simulation, we will embed some JavaScript in a link. When the link is executed (which simulates the script file being available), the display setting of the left image is set on. To try again, click reset.
The jscheck.js file in this case would simply comprise one line! Namely:
document.all['pic'].style.display='';
The above ideas work on the basis that a "flag" (be it butterflies, blowflies, or notices) will display when a new version becomes available, and displays for a period of time (say, two weeks). This may cause some annoyance for a user who downloads the updated version on the first day of the "flag," but continues to see the Updates Available flag for the next 13 days! A better system would be to set a cookie when the user chooses to download the update, and also make the display of the Updates Available flag conditional on that cookie not being found on the user's system. (We would have to be careful that we set the cookie from a web page, not a CHM topic, as cookie setting is unreliable from CHM files.)
You may also think of some other applications for the idea of using external files to enhance CHM files. As well as JavaScript files, external Cascading Style Sheet files and XML data files can also be referenced from within the HTML markup. Maybe a current price list, drawn from an external XML data file, could be included within the Help? Perhaps that will form the basis of another WinWriters article!
Let's summarize what we've covered.
If you think some of these features could be applicable to your projects, start experimenting with and expanding these ideas! Help technologies are proving to be extensible, and, as the famous philosopher Anon. once said, "you are only limited by your imagination."
Copyright © 2002, HyperWrite Pty Ltd.
Based in Australia, Tony Self is recognised as one of the pioneers of hypertext and online documents. For 15 years, Tony has worked in the areas of online help systems, computer-based training, and electronic documents. In 1993, Tony founded HyperWrite, a business and technical documentation company specialising in hypertext. In 1998, HyperWrite founded the Australasian Online Documentation Conference, an annual event attracting specialists from Australia and New Zealand. Tony served as Chief Technology Officer for Asia-Inc.com in 2000, where he was responsible for an innovative Asian business information Web and WAP service. Tony has now returned to HyperWrite, where he consults to organisations on online documentation and Internet strategy.
|
Copyright © WinWriters. All Rights Reserved. |