commajs
CommaJS
These are the APIs exposed by the editor itself:
var commajs = new CommaJS('rich-text-editor');
Undo()
Reverts user's last action.
Redo()
Restores user's last action.
Focus()
Sets the focus on the editor moving the cursor at the beginning of the document.
FocusAtTheEnd()
Sets the focus on the editor moving the cursor at the end of the document.
GetContent()
Returns a string containing the underlying HTML of the current document.
ToggleStyleOnSelection(styleName, value)
Toggles style on selected text. styleName must match one of the configured styles. For more information see Styling.
ToggleStyleOnLine(styleName, value)
Toggles style on the block node containing cursor. styleName must match one of the configured styles. For more information see Styling.
StoreCursorPosition()
Forces commajs to store current cursor position. Position can be restored by calling RestoreCursorPosition(). Position will be lost if the document is reloaded.
RestoreCursorPosition()
Restores cursor position. Position was stored calling StoreCursorPosition().
InsertPluginAtSection(pluginName, params)
Inserts plugin at cursor position. pluginName string representing the name of the plugin. Every plugin should return its name using the static method GetName(). params refers to your plugin configuration.
CallPluginStaticMethod(pluginName, functionName, params)
Calla a plugin static method. pluginName string represents the name of the plugin. Every plugin should return its name using the static method GetName(). functionName string represents the static method name. params refers to your plugin configuration.
IsolateSelectedText()
Returns an array of TextNodes representing the text currently selected by the user.
Functions:
Undo()
Redo()
Focus()
FocusAtTheEnd()
GetContent()
ToggleStyleOnSelection()
ToggleStyleOnLine()
StoreCursorPosition()
RestoreCursorPosition()
InsertPluginAtSection()
CallPluginStaticMethod()
IsolateSelectedText()
© 2020 Plugg, Inc. All rights reserved. Various trademarks held by their respective owners.
Plugg, Inc. - San Francisco, CA 94114, United States