Reference Source
import BasicEditorDriver from 'flarum/utils/BasicEditorDriver'
public class | source

BasicEditorDriver

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

el: *

Method Summary

Public Methods
public

build(dom: HTMLElement, params: EditorDriverParams)

public

Destroy the editor

public

disabled(disabled: boolean)

Set the disabled status of the editor.

public

focus()

Focus on the editor.

public

getCaretCoordinates(position: number): {"top": *, "left": *}

public
public
public

insertAt(pos: number, text: string)

public
public

insertBetween(start: number, end: number, text: string)

public

moveCursorTo(position: number)

public
public
public

setValue(value: string)

Public Constructors

public constructor() source

Public Members

public el: * source

Public Methods

public build(dom: HTMLElement, params: EditorDriverParams) source

Params:

NameTypeAttributeDescription
dom HTMLElement
params EditorDriverParams

public destroy() source

Destroy the editor

public disabled(disabled: boolean) source

Set the disabled status of the editor.

Params:

NameTypeAttributeDescription
disabled boolean

public focus() source

Focus on the editor.

public getCaretCoordinates(position: number): {"top": *, "left": *} source

Params:

NameTypeAttributeDescription
position number

Return:

{"top": *, "left": *}

public getLastNChars(n: number): string source

Params:

NameTypeAttributeDescription
n number

Return:

string

public getSelectionRange(): Array source

Return:

Array

public insertAt(pos: number, text: string) source

Params:

NameTypeAttributeDescription
pos number
text string

public insertAtCursor(text: string) source

Params:

NameTypeAttributeDescription
text string

public insertBetween(start: number, end: number, text: string) source

Params:

NameTypeAttributeDescription
start number
end number
text string

public moveCursorTo(position: number) source

Params:

NameTypeAttributeDescription
position number

public replaceBeforeCursor(start: number, text: string) source

Params:

NameTypeAttributeDescription
start number
text string

public setSelectionRange(start: number, end: number) source

Params:

NameTypeAttributeDescription
start number
end number

public setValue(value: string) source

Params:

NameTypeAttributeDescription
value string