new RetroMenu(title, display_element, hook_element)
retroMenu.js, line 27
Creates a new RetroMenu instance.
This:
| Name | Type | Default | Description |
|---|---|---|---|
title |
string | optional Title to use for all dialogs. | |
display_element |
jQuery | $("<div>") | optional jQuery element to use for display. May be changed. |
hook_element |
jQuery | document.body | optional jQuery element to apply all keyboard based hooks to. |
Members
-
staticRetroMenu.confirm_falsestring
-
String used as False for confirm dialogs.
- Default Value:
- "Cancel"
-
staticRetroMenu.confirm_truestring
-
String used as True for confirm dialogs.
- Default Value:
- "OK"
-
staticRetroMenu.dblclick_timeoutnumber
-
Timeout after which a click is considered a double click in ms.
- Default Value:
- 250
-
staticRetroMenu.keyActionsstring
-
Actions that can occur.
Properties:
Name Type Default Description UPstring RetroMenu.up Move up in the menu. DOWNstring RetroMenu.down Move down in the menu. TABstring RetroMenu.tab Tab forward SHIFT_TABstring RetroMenu.tab_shift Tab backward. -
staticRetroMenu.keyCodesnumber
-
KeyCodes used by RetroMenu.
Properties:
Name Type Default Description UPnumber 38 "Arrow up" key DOWNnumber 40 "Arrow down" key Wnumber 87 The W key Snumber 83 The D key TABnumber 9 The TAB key -
private_display_elementjQuery
-
Element used for display.
-
private_hook_elementjQuery
-
Element all key-based hooks are applied to.
-
private_titlestring
-
Title of this RetroMenu.
Methods
-
staticRetroMenu.alert_dialog(title, text, msg_div, next){RetroMenu}
retroMenu.js, line 318 -
Shows an alert dialog using a new RetroMenu Instance.
Name Type Description titlestring Title to use for this dialog box. textstring Text to alert the user to. msg_divjQuery optional Message element to also add. nextRetroMenu~alertCallback optional Callback when the user confirms the message. If omitted, alert does not close until manually closed. Returns:
newly created RetroMenu
-
staticRetroMenu.confirm_dialog(title, text, options, msg_div, startIndex, next){RetroMenu}
retroMenu.js, line 725 -
Shows a confirm dialog using a new RetroMenu Instance.
Name Type Default Description titlestring Title to use for this dialog box. textstring Text to alert the user to. optionsArray.<string> Options to make the user select from. msg_divjQuery optional Message element to also add. startIndexstring True optional Default to start with nextRetroMenu~confirmCallback optional Callback when the user confirms the message. If omitted, select does not close until manually closed. Returns:
newly created RetroMenu
-
staticRetroMenu.example()
example.js, line 5 -
When called, registers all the example code on the demo page.
-
staticRetroMenu.prompt_dialog(title, text, def, hide_input, msg_div, next){RetroMenu}
retroMenu.js, line 456 -
Shows a prompt box using a new RetroMenu instance.
Name Type Default Description titlestring Title of this RetroMenu instance. textstring Text to prompt the user for. defstring "" optional The default response to start with. hide_inputboolean False optional Should input be hidden (password prompt) msg_divjQuery optional Message element to also add. nextRetroMenu~promptCallback optional Callback when the user confirms the message. If omitted, alert does not close until manually closed. Returns:
newly created RetroMenu
-
staticRetroMenu.select_dialog(title, text, options, msg_div, startIndex, next){RetroMenu}
retroMenu.js, line 647 -
Shows a select dialog using a new RetroMenu Instance.
Name Type Default Description titlestring Title to use for this dialog box. textstring Text to alert the user to. optionsArray.<string> Options to make the user select from. msg_divjQuery optional Message element to also add. startIndexnumber 0 optional Index to start with. nextRetroMenu~selectCallback optional Callback when the user confirms the message. If omitted, select does not close until manually closed. Returns:
newly created RetroMenu
-
alert(text, msg_div, next){RetroMenu}
retroMenu.js, line 241 -
Shows an alert box.
Name Type Description textstring Text to alert the user to. msg_divjQuery optional Message element to also add. nextRetroMenu~alertCallback optional Callback when the user confirms the message. If omitted, alert does not close until manually closed. Returns:
this for chaining
-
confirm(text, options, msg_div, startIndex, next){RetroMenu}
retroMenu.js, line 679 -
Shows a confirm box.
Name Type Default Description textstring Text to alert the user to. optionsArray.<string> Options to make the user select from. msg_divjQuery optional Message element to also add. startIndexstring True optional Default to start with nextRetroMenu~confirmCallback optional Callback when the user confirms the message. If omitted, select does not close until manually closed. Returns:
this for chaining
-
destroy(){RetroMenu}
retroMenu.js, line 133 -
Returns the JSON-style source of this Vote.
Returns:
this for chaining
-
init(){RetroMenu}
retroMenu.js, line 96 -
Returns the JSON-style source of this Vote.
Returns:
this for chaining
-
prompt(text, def, hide_input, msg_div, next){RetroMenu}
retroMenu.js, line 345 -
Shows an prompt box.
Name Type Default Description textstring Text to prompt the user for. defstring "" optional The default response to start with. hide_inputboolean False optional Should input be hidden (password prompt) msg_divjQuery optional Message element to also add. nextRetroMenu~promptCallback optional Callback when the user confirms the message. If omitted, alert does not close until manually closed. Returns:
this for chaining
-
select(text, options, msg_div, startIndex, next){RetroMenu}
retroMenu.js, line 487 -
Shows a select box.
Name Type Default Description textstring Text to alert the user to. optionsArray.<string> Options to make the user select from. msg_divjQuery optional Message element to also add. startIndexnumber 0 optional Index to start with. nextRetroMenu~selectCallback optional Callback when the user confirms the message. If omitted, select does not close until manually closed. Returns:
this for chaining
-
start_hooks(){RetroMenu}
retroMenu.js, line 159 -
Enables key hooking for this menu.
Returns:
this for chaining
-
stop_hooks(){RetroMenu}
retroMenu.js, line 215 -
Stops key hooking for this menu.
Returns:
this for chaining
-
tab(reverse){RetroMenu}
retroMenu.js, line 754 -
Performs a tab key press.
Name Type Description reverseBoolean Should it be a shift_tab? Returns:
this for chaining
Type Definitions
-
alertCallback()
retroMenu.js, line 339 -
Callback for results form alert dialogs.
This:
-
confirmCallback(confirm)
retroMenu.js, line 746 -
Callback for results form select dialogs.
This:
Name Type Description confirmboolean Did the user confirm? -
promptCallback(result)
retroMenu.js, line 480 -
Callback for results for prompt dialogs.
This:
Name Type Description resultstring The result the user enters in the prompt. -
selectCallback(index, value)
retroMenu.js, line 670 -
Callback for results form select dialogs.
This:
Name Type Description indexnumber Index selected by the user. valuestring Value selected by the user.