Appendix
Manual


A.1 Introduction

This appendix is a comprehensive guide to the standard capabilities provided by the Worksheets code base. Section 2 describes how the Worksheets code manages the display of different types of nodes. Section 3 describes how the Worksheets code handles input gestures associated with different types of nodes.

Note that the Worksheets website provides software for various extensions to these basic capabilities, e.g. the rendering of charts and graphs and movement gestures such as drag and drop. See the text files associated with those extensions for documentation on the associated capabilities.

A.2 Display

This section describes how the Worksheets code changes the display of different types of nodes. Note that a given node of a document may fall into more than one category, in which case it receives the treatment described in every one of those categories.


<input id='id' type='hidden'/>

On each cycle, Worksheets computes value(id,val) for each input node with the form shown above. If it succeeds, it sets the value attribute of the node to the string version of val. If it fails, it sets the value to the empty string. Note that, although hidden nodes are not visible to the user, their values can be accessed for a variety of purposes, most notably in form submission.


<input id='id' type='text'/>

On each cycle, Worksheets computes value(id,val) for each input node with the form shown above. If it succeeds, it sets the value attribute of the node to the string version of val. If it fails, it sets the value to the empty string. This applies only to nodes that do not have an autoquote attribute.


<input id='id' type='text' autoquote/>

On each cycle, Worksheets computes value(id,val) for each input node with the form shown above. If it succeeds, it removes the quotes from val and sets the value attribute of the node to the result. If it fails to find a value, it sets the value to the empty string. This applies only to nodes that do have an autoquote attribute.


<textarea id='id'>...</textarea>

On each cycle, Worksheets computes value(id,val) for each input node with the form shown above. If it succeeds, it removes the quotes from val and sets the value attribute of the node to the result. If it fails to find a value, it sets the value to the empty string.


<input id='id' type='range'>...</range>

On each cycle, Worksheets computes value(id,val) for each range node with the form shown above. If it succeeds, it sets the value attribute of the node to that value. If it fails, it sets the value to the midpoint of the range.


<select id='id'>...</select>

On each cycle, Worksheets computes value(id,val) for each input node with the form shown above. If it succeeds, it sets the selected attribute of the option with the string version of val as value. If it fails to find a value or if the value does not match any of the options, all options are deselected.


<select id='id' multiple>...</select>

On each cycle, Worksheets computes holds(id,val) for each input node with the form shown above. For each value it finds, it sets the selected attribute of the option with the string version of val as value; and it deselects all other options.


<input id='id' name='name' type='radio'>...</input>

On each cycle, Worksheets computes value(name,id) for each input node with the form shown above. If it succeeds, it sets the checked attribute of the radio button. If it fails to find the factoid, the radio button is unchecked.


<input id='id' name='name' type='checkbox'>...</input>

On each cycle, Worksheets computes holds(name,id) for each input node with the form shown above. If it succeeds, it sets the checked attribute of the check box. If it fails to find the factoid, the radio button is unchecked.


<table id='id' type='table'>...</table>

On each cycle, Worksheets computes id(X1,...,Xn) for each table with the form shown above. It empties the table and, for each factoid that it finds, it adds a row with string versions of the arguments of that factoid in the cells of that row.


<element id='id'>...</element>

On each cycle, Worksheets computes attribute(id,attr,val) for each node with the form shown above. For each value it finds, it removes any quotes from attr and val and sets the resulting attribute of the node to the resulting value.


<element id='id'>...</element>

On each cycle, Worksheets computes style(id,attr,val) for each node with the form shown above. For each value it finds, it removes any quotes from attr and val and sets the resulting style component of the node to the resulting value.


<element id='id'>oldhtml</element>

On each cycle, Worksheets computes innerhtml(id,newhtml) for each node with the form shown above. For each value it finds, it removes any quotes from val replaces oldhtml with newhtml.

A.3 Gestures

This section describes how the Worksheets code handles input gestures associated with different types of nodes. Note that the event handlers associated with each type of node must correspond to that type of node, as indicated in the descriptions. For example, an input node of type text with no autoquote attribute should have modtext(this) as its onchange attribute, whereas an input node of type button should have modclick(this) as its onclick attribute.


<input id='id' type='text' onchange='modtext(this)'/>

If the user changes the value of an input node with the form shown above to newval, Worksheets assumes select(id,newval), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly. This applies only to nodes that do not have an autoquote attribute.


<input id='id' type='text' autoquote onchange='modstring(this)'/>

If the user changes the value of an input node with the form shown above to newval, Worksheets assumes select(id,"newval"), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly. This applies only to nodes that do have an autoquote attribute.


<textarea id='id' onchange='modstring(this)'>...</textarea>

If the user changes the value of a textarea node with the form shown above to newval, Worksheets assumes select(id,"newval"), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<input id='id' type='range' onchange='modtext(this)'/>

If the user changes the value of an input node with the form shown above to newval, Worksheets assumes select(id,newval), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<select id='id' onchange='modselect(this)'>...</select>

If the user changes the value of a selector with the form shown above to newval, Worksheets assumes select(id,newval), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<select id='id' multiple >...</select>

If the user selects a value in a multi-valued selector with the form shown above and the item is not already selected, Worksheets assumes select(id,val), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly. If the item is already checked, Worksheets assumes deselect(id,val), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<input id='id' type='radio' name='name' value='val' >...</input>

If the user clicks a radio button with the form shown above, Worksheets assumes select(name,val), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<input id='id' type='checkbox' name='name'>...</input>

If the user clicks a check box with the form shown above and the box is not already checked, Worksheets assumes select(name,val), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly. If the box is already checked, Worksheets assumes deselect(name,val), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<input id='id' type='button' onclick='modclick(this)'/>

If the user clicks a button with the form shown above, Worksheets assumes click(id), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<input id='id' type='button' onclick='modsubmit(this)'/>

If the user clicks a button with the form shown above, Worksheets assumes click(id), uses its transition rules to compute all consequences, updates the state of the worksheet, and then sends the form as an AJAX request. Worksheets errs if there is no enclosing form. Useful to allow the Worksheet to set things up correctly before the form is submitted and the worksheet is exited.


<input id='id' type='button' onclick='modremote(this)'/>

f the user clicks a button with the form shown above, Worksheets assumes click(id), uses its transition rules to compute all consequences, updates the state of the worksheet, and then submits the form containing the button. Worksheets errs if there is no enclosing form. Useful to allow the Worksheet to set things up correctly before the AJAX request is sent.


<element id='id' onclick='modclick(this)'>...</element>

If the user clicks a node with the form shown above, Worksheets assumes click(id), uses its transition rules to compute all consequences, and updates the state of the worksheet accordingly.


<element onclick='doloaddata()'>...</element>

If the user clicks a node with the form shown above, Worksheets loads datasets from the server. Differs from reception in that this happens just once per click.


<element onclick='dosavedata()'>...</element>

If the user clicks a node with the form shown above, Worksheets saves datasets to the server. Differs from broadcast in that this happens just once per click.


<element onclick='dosaveback()'>...</element>

If the user clicks a node with the form shown above, Worksheets saves the current worksheet back to its original location on the server.


<element onclick='dosavesheet()'>...</element>

If the user clicks a node with the form shown above, Worksheets saves the current worksheet to the user's own folder on the server.


<element onclick='dobroadcast()'>...</element>

If the user clicks a node with the form shown above, Worksheets enables automatic saving of any dataset to the server whenever that dataset is changed.


<element onclick='dounbroadcast()'>...</element>

If the user clicks a node with the form shown above, Worksheets disables automatic saving of datasets to the server.


<element onclick='doreceive()'>...</element>

If the user clicks a node with the form shown above, Worksheets enables automatic loading of datasets from the server on every tick (default every second).


<element onclick='dounreceive()'>...</element>

If the user clicks a node with the form shown above, Worksheets disables automatic loading of datasets from the server.


<element onclick='doconnect()'>...</element>

If the user clicks a node with the form shown above, Worksheets enables automatic loading and saving of datasets.


<element onclick='dodisconnect()'>...</element>

If the user clicks a node with the form shown above, Worksheets disables automatic loading and saving of datasets.