This page is for the webservant. It documents simplybible.com’s annotation system. To escape from here, use Kanga Korna at top left or click this for the Hub.

When the user points to a question-mark symbol the annotations page opens with the annotation displayed in a box. This system enables the annotation or definition of a word without cluttering the main page.

1. Script in document head

In the document head, the following entry is required below the normal control entries...

<script language="JavaScript" src="cAnotA.js"></script> In this example, the annotations required for the page are all included in cAnotA.js —if annotations for the page are on cAnotB.js or cAnotC.js etc., then that is specified instead. If the annotations required are on more than one of these, you simply include more than one entry.

2. Where is the Javascript for Annotations?

The NoteClick() function in the Library and Annotate() function in simplybibleFinder provide the code and variables to drive the annotations system.

The annotations themselves are kept in cAnotA.js or cAnotB.js or similar. These files store the annotations in global variables in the form var A001="x"; where x is replaced with the annotation. In this way, all annotations in the file are accessible to, and loaded with, the page.

3. Creating an entry

Immediately after the word that is to be annotated, place this code without any intervening space...

<script>new NoteClick(FName,"word","heading","srchterm","note");</script>

Note that the word after which the question mark symbol appears is jammed up against the script tag without any intervening space. This prevents a line break from separating the word and symbol. A non-breaking space is included in the script so that the symbol does not actually appear jammed up against the word.

With the above code in place, all that is required is to replace...

If using a variable reference such as B091 (and you normally will) then you need to write your annotation in the appropriate file. In this case it would be cAnotB.js. You would enter a new variable var B091="x"; and write your annotation in place of the x. This annotation would be accessible on any page carrying the entry <script language="JavaScript" src="cAnotB.js"></script> in the document head under the other control entries.

4. Problems with special characters

When entering the note, the rules for strings apply. For example if an apostrophe is required, the single quote mark ' (that often doubles as an apostrophe) is unsuitable because it is used as a delimiter in the javascript. Thus it is necessary to use the special character , by employing the character entity code eg Our Saviour&#39;s love.

5. Using markup in the annotation

The annotation functions have the ability to process simple markup. For example you can insert images into the annotation or or apply style to it. Use single quotes to delimit attributes, not double quotes, since they delimit the entire annotation. More complex markup such as onclick cannot be used, nor any markup requiring nested quotes.

6. Old Popup Calls

Many browsers are configured to block popus, sometimes even without a clickable option to allow them. So the popup windows have now been discontinued on this site. But what about all the pages with old popup calls? Will they no longer work? No, a patch has been provided in the Library to convert old popup window calls to the new annotations system. This allows all the annotations that used to appear in popup windows to now appear on the annotations page. As a page comes up for editing, its old popup calls can easily be converted to the new annotations system. Meanwhile the patch makes them work quite well enough.

Home | Bible Topics | The Hub