Editor

Editor

Provide a word-processor-like control.

This class is a wrapper around the public CKEditor 5 utility. It is intended that this class be used exclusively rather than any of the raw CKEditor API. It provides a higher-level and more convenient API.

Please refer to CKEditor documentation on https://ckeditor.com/docs for more information.

Constructor

new Editor()

Source:

Methods

(static) addEditor(editor)

Source:
Add an editor to the current context.
Parameters:
Name Type Description
editor

(async, static) create(parentId) → {Promise.<Editor>}

Source:
Creates a new instance of the Editor class and initializes it.
Parameters:
Name Type Description
parentId string The ID of the editor div.
Returns:
A promise that resolves to the initialized Editor instance.
Type
Promise.<Editor>

(static) newEditorContext()

Source:
Create a new editor context.

(static) popAllEditorContexts()

Source:
Destroys all popup and screen editors that have been created

(static) popEditorContext()

Source:
Destroy all editors in last context and remove the context

clear()

Source:
Clears the content of the editor.

dispose()

Source:
Dispose of the editor when it is no longer needed. Generally, Kiss handles this automatically.

getHtml() → {string}

Source:
Retrieves the HTML content from the editor.
Returns:
The HTML content of the editor.
Type
string

getText() → {string}

Source:
Retrieves the text (not HTML) content of the editor.
Returns:
Type
string

printEditorContent()

Source:
Print the contents of the editor

readOnly()

Source:
Sets the editor to read-only mode.

readWrite()

Source:
Sets the editor to read-write mode.

setHtml(html)

Source:
Sets the HTML content in the editor.
Parameters:
Name Type Description
html