Expand all

CodeMirrorSearch

Custom search panel for CodeMirror using CSS-only Codex components.

Extends

Constructor

new CodeMirrorSearch() #

Properties

extension :Extension #

Get the panel and any associated keymaps as a CodeMirror Extension.

Type:

Overrides:
Source:
Get the panel and any associated keymaps as a CodeMirror Extension.

panel :Panel #

Get the Panel object.

Type:

Overrides:
Source:
Get the Panel object.

searchInputWrapper :HTMLDivElement #

searchQuery :SearchQuery #

Methods

commit() #

Create a new SearchQuery and dispatch it to the EditorView.

Source:
Create a new SearchQuery and dispatch it to the EditorView.

findNext() → {boolean} #

Find the next match.

Source:

Returns:

Whether a match was found.

Type
boolean
Find the next match.

findPrevious() → {boolean} #

Find the previous match.

Source:

Returns:

Whether a match was found.

Type
boolean
Find the previous match.

getButton(label, [icon], [iconOnly]) → {HTMLButtonElement} #

Get a CSS-only Codex Button.

Parameters:

Name Type Attributes Default Description
label string
icon string | null optional
null
iconOnly boolean optional
false
Overrides:
Source:

Returns:

Type
HTMLButtonElement
Get a CSS-only Codex Button.

getCheckbox(name, label, [checked]) → {Array.<HTMLElement>} #

Get a CSS-only Codex Checkbox.

Parameters:

Name Type Attributes Default Description
name string
label string
checked boolean optional
false
Overrides:
Source:

Returns:

[HTMLSpanElement, HTMLInputElement]

Type
Array.<HTMLElement>
Get a CSS-only Codex Checkbox.

getFieldset(legendText, …fields) → {Element} #

Get a CSS-only Codex Fieldset.

Parameters:

Name Type Attributes Description
legendText string
fields Array.<HTMLElement> repeatable
Overrides:
Source:

Returns:

Type
Element
Get a CSS-only Codex Fieldset.

getTextInput(name, [value], placeholder) → {Array.<HTMLElement>} #

Get a CSS-only Codex TextInput.

Parameters:

Name Type Attributes Default Description
name string
value string optional
''
placeholder string
Overrides:
Source:

Returns:

[HTMLDivElement, HTMLInputElement]

Type
Array.<HTMLElement>
Get a CSS-only Codex TextInput.

getToggleButton(name, label, icon, [checked]) → {HTMLButtonElement} #

Get a CSS-only Codex ToggleButton.

Parameters:

Name Type Attributes Default Description
name string
label string
icon string
checked boolean optional
false
Overrides:
Source:

Returns:

Type
HTMLButtonElement
Get a CSS-only Codex ToggleButton.

onKeydown(event) #

Respond to keydown events.

Parameters:

Name Type Description
event KeyboardEvent
Source:
Respond to keydown events.

updateNumMatchesText([query]) #

Show the number of matches for the given SearchQuery and the index of the current match in the find input.

Parameters:

Name Type Attributes Description
query SearchQuery optional
Source:

Show the number of matches for the given SearchQuery and the index of the current match in the find input.