Class HistoryAddin

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:


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



Method Detail


void addToHistory(s)


Object handle_onkeydown(event)


void initWidget(atts)


void reset()

Documentation generated by JSDoc on Tue May 3 17:16:26 2005