BSCOutline and Scripting

 
Scripting Overview
BSCOutline can be modified from outside the applet using JavaScript or another HTML scripting language embedded within an HTML page.
This page describes the functions within BSCOutline which can be called from the HTML page.

For scripting, BSCOutline must be given a unique name within the Applet Tag, in the examples shown the name has been specified as "BSCOutline" using the following Applet Tag...
<APPLET CODE = BSCOutline.class NAME = BSCOutline WIDTH = 200> HEIGHT = 300> <PARAM NAME= ...> ... ... </APPLET>
 
GetState
This function is used to retrieve the current state string of the applet.

The function returns a string in the same form as used in the SetState function and the InitialState parameter.

For Details of the syntax of the string returned see SetState
 
GetCurrentNodeID
This function is used to retrieve the NodeID of the currently selected node.

The function returns the string specified in the .out file.

 
SetState
This function is used to set the current state of the applet.
The takes the required state in the form of a string specifying the state required.

The string takes the following form...
Xoffset|Yoffset|Selected|Open1|Open2|......|OpenX| Xoffset - The Offset in pixels of the horizontal scrollbar.

Yoffset - The Offset in pixels of the vertical scrollbar.

Selected - The node number of the selected node.

Open1|Open2|......|OpenX| - Zero or more node numbers of nodes to open, separated by "|" and terminated by a "|" (Pipe Character). The node numbers are the line number in the outline data file (not counting comments and blank lines) e.g. SetState('0|0|0|3|33|') Zero Offsets, no selected node, open nodes 3 and 33. Note - You must ensure you specify each nodes parent, to make the node visible if you want to open the sub-node.
e.g. If you want to make a level 3 node open you must also specify it's level 2 parent. If the selected node is hidden by it's parent being closed then the parent will be highlighted as though it is the currently selected node.
 
ActivateNode
This function is used to activate one or more nodes, specified by their NodeID's.

This function uses NodeID's NOT consecutive node numbers. This parameter takes the following form...
Open1|Open2|......|OpenX| Open1|Open2|......|OpenX| - Zero or more nodes to activate in sequence, separated by "|" and terminated by a "|" (Pipe Character).

e.g. ActivateNode("A|F|G|); Activate nodes with NodeID's A,F & G respectively. Note - You must ensure you specify each nodes parent, to make the node visible if you want to open the sub-node.
 
isActive
This function is used to determine when BSCOutline is ready to take scripting commands.

The function returns TRUE when BSCOutline is ready to accept commands.

The function takes no parameters

e.g. isActive();