SiteGLU: Site-Based Global Lookup - Custom Dictionaries

 

To add the Site-based Global Lookup to a page, we insert a reference to the siteglu.js file. You've probably read the Web-based Global Lookup method. This one takes a few more steps. Besides inserting the file reference, we build a dictionary, and call it to a popup. To demonstrate, double-click on any word on this page. Most likely, the definition won't be in the dictionary. Then, click on a term from the lexicon below:

 

authoring, complex, Copperfield, documentation, Help, HtmlHelp,

ideal, information, JavaHelp, language, platform, Publishing,

simple, system, technical, Winhelp, writing.

 

Note: this doesn't seem to work on NT's (it's a problem with anchors). We're still polishing it for NetScape, and it looks different with different IE versions as well... You may find it under construction as we speak. Suggestions are welcome!!

 

So, do we call it SiteGLU?

1.         Insert the .js file reference in the <HEAD> section of each Html file that uses SiteGLU. We use the same include script as before, but with a new filename.

 

 

 

<SCRIPT SRC="../siteglu.js" LANGUAGE="JavaScript">

</SCRIPT>

 

 

 

 

 

 

2.         If the .js include file interferes with other scripts on the page, you may have to move the reference to the bottom of the page.

3.         Download and copy the siteglu.js file to your parent directory. This particular configuration uses eHelp's RoboHtml popup for the definition window. Or, build your own popup window to suit your taste.

Download siteglu.js.

4.         Build the customdictionary.htm page. This page will hold all of your definitions, and will take a few extra steps:

ü    The first topic should say something like "Definition not Listed…".

ü    Each definition should have at least one anchor, including its plural form.

ü    Separate the definitions from each other and adjust the popup window size to ensure only one definition displays in the window at a time.

ü    Add SCROLL="NO" to the <BODY> tag; this will turn off the scroll bars in the popup windows.

ü    Save the customdictionary.htm file with the rest of the.html files. If you use a different location, change the address in the .js file.

 

Here's an example of a customdictionary.htm file: Customdictionary.htm

 

This script has a small function called "BSSCPopupDEF." This is a variation of eHelp's® BSSCPopup function, created to allow us some control over our definition windows, yet still work within the constraints of RoboHelp. Height and width arguments have been added to BSSCPopupDEF to allow sizing. It works best in an HtmlHelp file.

If you do use RoboHelp or RoboHtml, you may want to change the parameters of BSSCPopupDEF to a size you like:

 

 

 

function openDictWin(text) {

if (text > '') {

if (text != ' ') {

BSSCPopupDEF('customdictionary.htm#'+text, 310, 120);

setTimeout('newwin.focus()', 100);

 

 

 

 

 

 

To create popups of a different size, change the x and y values. In this example, they're 310 pixels wide by 120 pixels high.

 

If you don't use RoboHelp® or RoboHtml®, you will want to look inside of siteglu.js, and delete the first function "BSSCPopupDEF." Build and open a popup or small window of your own design in "openDictWin."

Use your own window.open command, like the one found in webglu.js.

 

And that's it.

Use it in good health.

If you have any suggestions or improvements, please let us know!

The folks at Copperfield Publishing.

 

 

  

images\copyright2001.jpg           images/seealso.jpg           images\quickclick.jpg