|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defined in widgetJavascriptConsole.js
The History Addition widget is a mix-in Widget that adds history capabilities to any Widget that uses the "value" property to indicate the value of the widget, though it is likely to only be useful to text nodes. (It only works on Widgets since it assumes XBLinJS event handling in order to safely tie into the target safely.)
This widget must be able to capture UP and DOWN keypresses with the XBLinJS event handling system, and something must call the .addToHistory methods when something occurs that needs to be added to the history.
This widget has no DOM nodes, but is a Widget because it taps into the Widget event handling.
Note that while I can't imagine a particular use, that it is not technically necessary for the "value" in question to be a string; this object should continue to work even if .getAttribute returns an object or something.
Relevant Parameters:
Example:
If text is a text input widget, the following will activate it for history processing (along with someone calling .addToHistory sometime):
history = new HistoryAddin({target: text});
Generally you will do this inside an .initDOM().
Constructor Summary | |
HistoryAddin
()
History addition widget - adds history to a widget, like "readline" |
Method Summary | |
void
|
addToHistory(s)
addToHistory - add the given value to the history |
Object
|
handle_onkeydown(event)
onkeydown handler for history |
void
|
initWidget(atts)
Initializes the handlers and such. |
void
|
reset()
reset - resets the position of the history to the end |
Constructor Detail |
HistoryAddin()
Method Detail |
void addToHistory(s)
This also resets the position of the history list.
s
- The string to add. If the string is false (or the empty string), the history feature will reset everything as normal, but will not add the string to the history. This will also decline to add an entry that is == to the previous one.
Object handle_onkeydown(event)
From source: Use onkeydown because IE doesn't support onkeypress for arrow keys.
void initWidget(atts)
void reset()
This resets the history position tracker. It does not change the value of the associated widget.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |