Involving the users, offering them user interaction - instead of just letting them read - is a significant part of Online Communication: provide demos, leaving it to the users how to control them. But how do you get their interaction, without spending more effort on it than on writing the actual contents? Well, you need some tools for it, taking up not more than 1 code line. Such tools like the Custom Inputs.
Idea behind Custom Inputs
- Tell me, and I will forget.
- Show me, and I might remember.
- Let me do it, and I understand.
Confucius
That "Golden Rule" in pedagogy is well-known, but hard to apply. Until recently at least. With the upcoming of computer and
Then the question is, what's more effective:
Obviously, this will depend very much on how efficient it is to provide samples making the users feel they would like to get involved. If the tools are good enough to build such a sample with only a few lines of code, this will probably boost teaching by samples.
That's the idea behind the Custom Inputs.
Handling
Here is summarized what the users should do when they want to achieve a particular effect in their interaction.
Handling - Button
Button inputs are good for
Each of these variants can be implemented by one line of HTML-code, optionally adding a keyword ("bistable", "multistable", )
To set any of the given alternatives, click the corresponding button.Handling - ColorSelect
Sometimes it should be open to the users in which color a graphic element should be painted. There are three ways to determine a color:
To select a color, you can take it from the standard colors by clicking on the left button. A table with all the standard colors will pop up. When you click on any of them, the table is closed and the name of the selected color appears in the text box, with the corresponding background color. At the same time the border color is set.
If you want to fine-tune a color, click the right button. A "color wheel", a wild combination of the three colors red, green and blue will pop up. You can select an approximation of the desired color by moving the cursor on it and clicking finally. The color wheel is removed, the corresponding color code appears in the text box, with the corresponding background color.
There you can type in another 6-digit hexadecimal number, if you want to modify the color. When you press the ENTER-key then, you are asked whether to update the final color.
(Note: Don't be surprised if you don't see the new color right away. The application might be designed such that the color selection works as a pre-setting only; the new color will become visible not before you click the application's "Apply"-button.)
Handling - Slider
In many applications you will want to leave it to the users to choose any value out of a given range, between minimum and maximum value. It's very intuitive to the users if they just have to move a graphic element (called "thumb") along a linear axis (represented by the "shaft"). This input is called a "Slider".
You can set any value between the given minimum and maximum by clicking on the slider thumb and moving the cursor left/right (horizontal slider), or up/down (vertical slider). If you move the cursor sideward from the thumb, the slider remains active: when the thumb is caught again later, it will follow the cursor. When you want to finish moving the thumb, click on it once more.
(If the application is a pre-setting, the same holds true as was mentioned for the ColorSelect.)
Handling - Tabs
Coding
Coding - Button
The syntax of calling a custom Button is as follows:
| dest | Any string representing a Javascript-code of what to do with the result. Within the Javascript-code, the result is symbolized by a question mark (?). A '?'-symbol can appear at any place, any number of times. A '?' at the last place of the string may be omitted. The result depends on the type of the Button:
|
||||||||||||
| label1[|label2 ] | Button face(s) that is/are visibly at a time, depending on the button type (bistable, multistable, etc.) Each label can be plain text or any HTML-code (except <INPUT>, <BUTTON> or any other Custom Input) |
||||||||||||
| options | String with any number of options, separated by at least one whitespace. All options are of the form keyword=value . If the value is to hold a whitespace, it needs to be enclosed in quotes: keyword='value' or keyword="value" If the opening quote is a single quote ('), the following single quote is taken to be the closing quote. The same holds for double quotes ("). Currently the following keywords are defined for Button options:
Additionally, the user has control over the following details. They are modified by assigning a value to them, just like in Javascript:
|
Coding - ColorSelect
The syntax of calling a ColorSelect is as follows:
| dest | Any string representing a Javascript-code of what to do with the result. Within the Javascript-code, the result is symbolized by a question mark (?). A '?'-symbol can appear at any place, any number of times. A '?' at the last place of the string may be omitted. |
||
| options | String with any number of options, separated by at least one whitespace. All options are of the form keyword=value . If the value is to hold a whitespace, it needs to be enclosed in quotes: keyword='value' or keyword="value" If the opening quote is a single quote ('), the following single quote is taken to be the closing quote. The same holds for double quotes ("). Currently the following keyword is defined for ColorSelect options:
|
Coding - Slider
The syntax of calling a Slider is as follows:
| dest | Any string representing a Javascript-code of what to do with the result. Within the Javascript-code, the result is symbolized by a question mark (?). A '?'-symbol can appear at any place, any number of times. A '?' at the last place of the string may be omitted. | ||
| min | Minimum of slider range (= min. result possible). Default: 0 | ||
| max | Maximum of slider range (= max. result possible). Default: 100. Note that preceding parameters must be coded, even if they are at their default value, if this parameter is used explicitly; only terminating parameters may be omitted. | ||
| ini | Initial value of result. Default: 0. Note that preceding parameters must be coded, even if they are at their default value, if this parameter is used explicitly; only terminating parameters may be omitted. |
||
| options | String with any number of options, separated by at least one whitespace. All options are of the form keyword=value . If the value is to hold a whitespace, it needs to be enclosed in quotes: keyword='value' or keyword="value" If the opening quote is a single quote ('), the following single quote is taken to be the closing quote. The same holds for double quotes (").
Currently the following keyword is defined for Slider options:
|
Coding - Tabs
Requirements for Use
To use Custom Inputs in an application, the following requirements have to be met:<SCRIPT SRC="..\JS\Input.js"></SCRIPT>
<SCRIPT SRC="..\JS\gen.js"></SCRIPT>
<SCRIPT>Button( )</SCRIPT>If you want to have several related calls, they may be combined within a common bracket and must be separated by a semicolon - e.g.
<SCRIPT>ColorSelect( )</SCRIPT>
<SCRIPT>Slider( )</SCRIPT>
<SCRIPT>Button( );If you have more than one application in your HTML-file, they all share a common namespace. I.e. all identifiers must be unique over all the applications.
Slider( )</SCRIPT>