|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Defined in widgetJavascriptConsole.js
This is derived from squarefree.com and adapted to the XBLinJS framework.
Differences From Source:
Relevant Parameters:
Implementing your own shell commands:
The JavascriptConsole includes the idea of adding in "shell commands", basically just functions put into the scope of execution, which you can provide for the user to use.
The shell commands are collected in the following manner:
Shell commands are sorted by key name, then presented to the user at the top of the console.
Shell commands may be one of two things. They may simply be a function, in which case they will be shown by key name on the shell command line. They may also be Javascript objects, which can contain the entries shown below. Regardless, the shell commands will recieve as their first parameter a reference to their JavascriptConsole object, followed by whatever parameters the user may have given.
Only func is necessary, but if that is all you have, you might as well leave it just as a function.
Constructor Summary | |
JavascriptConsole
()
Nice Javascript console, embeddable into your page. |
Method Summary | |
void
|
go(_s_)
Execute the given string as input. |
void
|
printError(er)
Print an exception. |
Object
|
println(s, type)
Prints a line on the console. |
void
|
printWithRunin(h, s, type)
Prints a line on the console, with a "runin". |
void
|
refocus()
Focus on the input box; use this to ensure the screen has been scrolled to the box after user input. |
Constructor Detail |
JavascriptConsole()
Method Detail |
void go(_s_)
s
- The string to execute.
void printError(er)
er
- The exception to print.
Object println(s, type)
s
- The string to print.
type
- The CSS class to assign to the printed line. (See widgets.css for the .Console* lines.)
void printWithRunin(h, s, type)
A "runin", apparently, is a bolded text with a colon appended; so, for example, you could show help with: this.printWithRunin("Help", "Some help.", "ConsoleHelpDisplay").
h
- The header to display.
s
- The string to display.
type
- The CSS class to assign to the text. (See widgets.css for the .Console* lines.)
void refocus()
Copied from source, which comments the "blur" is needed for mozilla to scroll correctly.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |