Editor Instances Library

This library provides a common API for editor widget instances manipulation.

Source:

Methods

(static) create($textarea, type) → {CKEditor|CodeMirror}

Create new editor instance.

Parameters:
Name Type Description
$textarea jQuery

Textarea selector to be modified.

type String

Provide a type that is supported by the widget.

Source:
Returns:

Returns the create editor instance.

Type
CKEditor | CodeMirror

(static) destroy($textarea, customInitEventType)

Destroy an existing editor instance.

Parameters:
Name Type Description
$textarea jQuery

Textarea selector to be destroyed.

customInitEventType String

Optional (''), if the editor was initialized with a custom init-event-type, then this must be unbound by editor destroy.

Source:

(static) getInstance($textarea) → {CKEditor|CodeMirror}

Get an editor instance.

Parameters:
Name Type Description
$textarea jQuery

Textarea selector from which the instance will be retrieved.

Source:
Returns:

Returns the corresponding editor instance.

Type
CKEditor | CodeMirror

(static) switch($textarea, currentType, newType) → {CKEditor|CodeMirror}

Switch to a new editor type.

Parameters:
Name Type Description
$textarea jQuery

Textarea selector to be modified.

currentType String

Provide the current editor type.

newType String

Provide the new editor type.

Source:
Returns:

Returns the new editor instance.

Type
CKEditor | CodeMirror