Fork me on GitHub

API

Classes

AceIntellisense

function - getTooltip

Gets the tooltip user interface

function - getDecls

Gets the declarations user interface

function - getMeths

Gets the methods user interface

function - addDeclarationTrigger

Adds a trigger to the list of triggers that can cause the declarations user interface to popup.

Members
Name Type Description
trigger KeyTrigger The trigger to add

function - onDeclaration

Sets a callback to invoke when a key is pressed that causes the declarations list to popup.

Members
Name Type Description
callback function The callback to set

function - onMethod

Sets a callback to invoke when a key is pressed that causes the methods list to popup.

Members
Name Type Description
callback function The callback to set

function - onTooltip

Sets a callback to invoke when the user hovers for a short period of time

Members
Name Type Description
callback function The callback to set

function - setTooltipData

Sets the data necessary to display a tooltip

Members
Name Type Description
text string The text to display for the tooltip
lineIndex int The line index where the tooltip is on
startColumnIndex int The starting column where the tooltip should be displayed if the mouse leaves
endColumnIndex int The ending column where the tooltip will no longer be displayed if the mouse leaves

function - setMethods

Delegate for setting the methods to display to the user

Members
Name Type Description
data string[] The methods to display

function - setDeclarations

Delegate for setting the declarations to display to the user

Members
Name Type Description
data DeclarationItem[] The declarations to display

function - setStartColumnIndex

Sets the starting location where filtering can occur. This is set when a trigger happens that would cause the declarations list to show

Members
Name Type Description
i int The index to set

function - getFilterText

Gets the text after startColumnIndex but before caret offset.

CodeMirrorIntellisense

function - getDecls

Gets the declarations user interface

function - getMeths

Gets the methods user interface

function - addDeclarationTrigger

Adds a trigger to the list of triggers that can cause the declarations user interface to popup.

Members
Name Type Description
trigger KeyTrigger The trigger to add

function - addMethodsTrigger

Adds a trigger to the list of triggers that can cause the methods user interface to popup.

Members
Name Type Description
trigger KeyTrigger The trigger to add

function - onDeclaration

Sets a callback to invoke when a key is pressed that causes the declarations list to popup.

Members
Name Type Description
callback function The callback to set

function - onMethod

Sets a callback to invoke when a key is pressed that causes the methods list to popup.

Members
Name Type Description
callback function The callback to set

function - setMethods

Delegate for setting the methods to display to the user

Members
Name Type Description
data string[] The methods to display

function - setDeclarations

Delegate for setting the declarations to display to the user

Members
Name Type Description
data DeclarationItem[] The declarations to display

function - setStartColumnIndex

Sets the starting location where filtering can occur. This is set when a trigger happens that would cause the declarations list to show

Members
Name Type Description
i int The index to set

function - getFilterText

Gets the text after startColumnIndex but before caret offset.

DeclarationItem

Members
Name Type Description
name The name displayed in the user interface
value The value that is replaced when a declaration is selected by the user
glyph A number that represents what image to display for this item. The css class for the user interface item is `icon-glyph-{glyph}`. For example: `icon-glyph-1`. An example CSS selector: .icon-glyph-1 { background-image: url('css/folder.png'); }
documentation A piece of documentation to display when this item is selected by the user.

DeclarationsIntellisense

function - setFilter

Setter for the filter text. When set, the items displayed are automatically filtered

Members
Name Type Description
f string The filter to set

function - setFilterMode

Setter for how the filter behaves. There are two default implementations startsWith and contains. The `startsWith` mode checks that the `name` property of the item starts with the filter text The `contains` mode checks for any substring of the filter text in the `name` property of the item.

Members
Name Type Description
{string|function(item, string)} mode - The mode to set

function - getSelectedItem

Gets the selected item

function - getSelectedIndex

Gets the currently selected index

function - setSelectedIndex

Sets the currently selected index

Members
Name Type Description
idx int

function - onItemChosen

Adds an event listener for the `onItemChosen` event

Members
Name Type Description
callback function

function - onItemSelected

Adds an event listener for the `onItemSelected` event

Members
Name Type Description
callback function

function - onVisibleChanged

Adds an event listener for the `onVisibleChanged` event

Members
Name Type Description
callback function

function - moveSelected

Sets the currently selected index by delta.

Members
Name Type Description
delta int

function - setDeclarations

Sets the declarations to display. If not empty, the user interface is shown and the first item is selected.

Members
Name Type Description
data DeclartionItem[] The array of declaration items to show

function - setPosition

Sets the position of the UI element.

Members
Name Type Description
left int
top int

function - setVisible

Checks to see if the UI is visible

function - isVisible

Check to see if the declarations div is visible

function - handleKeyDown

Provides common keyboard event handling for a keydown event. escape, left, right -> hide the UI up -> select previous item down -> select next item pageup -> select previous 5th pagedown -> select next 5th enter, tab -> chooses the currently selected item

Members
Name Type Description
evt HTMLEvent The event

KeyTrigger

Members
Name Type Description
keyCode The key code from the keyboard that should trigger a callback
shiftKey Should the shift key be depressed in order to trigger a callback
ctrlKey Should the ctrl key be depressed in order to trigger a callback
preventDefault Should the event be prevented from propagating

MethodsIntellisense

function - setVisible

Shows or hides the UI

Members
Name Type Description
b boolean

function - isVisible

Checks to see if the UI is visible

function - setSelectedIndex

Sets the selected item by index. Wrapping is performed if the index specified is out of bounds of the methods that are set.

Members
Name Type Description
idx int The index of the item to set selected

function - setMethods

Sets the methods to display. If not empty, the user interface is shown and the first methods is selected.

Members
Name Type Description
methods string[] The methods to populate the interface with

function - moveSelected

Sets the currently selected index by delta.

Members
Name Type Description
delta int

function - setPosition

Sets the position of the UI element.

Members
Name Type Description
left int
top int

function - handleKeyDown

Provides common keyboard event handling for a keydown event. escape, left, right -> hide the UI up -> select previous item down -> select next item pageup -> select previous 5th pagedown -> select next 5th

Members
Name Type Description
evt HTMLEvent The event

function - onVisibleChanged

Adds an event listener for the `onVisibleChanged` event

Members
Name Type Description
callback function

TextBoxIntellisense

Tooltip

function - isVisible

Check to see if the user interface is visible or not

function - setVisible

Sets the visibility of the tooltip element

Members
Name Type Description
b bool True to set visible, false to hide

function - setText

Sets the text of the tooltip element

Members
Name Type Description
text string The text to set

function - setHtml

Sets the HTML of the tooltip element

Members
Name Type Description
html string The html to set

function - getText

Gets the inner text of the tooltip element

function - getHtml The inner html of the element

Gets the inner html of the tooltip elemnt

function - setPosition

Sets the position on screen of the tooltip element

Members
Name Type Description
left int The left pixel position
top int The top pixel position

Utils

function - lastIndexOfAny

Looks for the last index of a number of strings inside of another string

Members
Name Type Description
str string The string to search within
arr string[] An array of strings to search for
[start] number Optional starting position

function - removeCssClass

Removes a CSS class from an element

Members
Name Type Description
element HTMLElement The element to remove the class
name string The name of the class to remove

function - addCssClass

Adds a CSS class from an element

Members
Name Type Description
element HTMLElement The element to add the class
name string The name of the class to add

function - hasCssClass

Checks to see if an element has a CSS class

Members
Name Type Description
element HTMLElement The element to add the class

function - showElement

Shows or hides an element by setting the display style to 'block' for true or 'none' for false.

Members
Name Type Description
element HTMLElement The element to show or hide
b boolean