commajs
Document
CallPluginStaticMethod(pluginName, functionName, params)
Calls 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 refer to your plugin configuration.
DeleteSelection()
Deletes selected text.
Focus()
Sets the focus on the editor and moves the cursor to the beginning of the document.
FocusAtTheEnd()
Sets the focus on the editor and moves the cursor to the end of the document.
GetCurrentStyle()
Returns styles applied at cursor position.
GetNodeAtCursor()
Returns the TextNode at cursor position.
GetPluginOptions(pluginName)
Returns the options object associated with pluginName used to configure commajs. pluginName string represents the name of the plugin. Every plugin should return its name using the static method GetName().
GetSelectionBoundingClientRect()
Returns a DOMRect object that bounds the contents of the selection. See Range.GetBoundingClientRect() for more information.
GetSelectedLines()
Returns all block nodes intersected by current selection.
InsertPluginAtSection(pluginName, params)
Inserts plugin at the cursor position. pluginName string represents the name of the plugin. Every plugin should return its name using the static method GetName(). params refers to your plugin configuration.
PushToHistory()
Pushes current document state to history. States can be restore using Undo() and Redo() functions. See commajs for more information.
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.
Functions:
CallPluginStaticMethod()
DeleteSelection()
Focus()
FocusAtTheEnd()
GetCurrentStyle()
GetNodeAtCursor()
GetPluginOptions()
GetSelectionBoundingClientRect()
GetSelectedLines()
InsertPluginAtSection()
PushToHistory()
ToggleStyleOnSelection()
ToggleStyleOnLine()
© 2020 Plugg, Inc. All rights reserved. Various trademarks held by their respective owners.
Plugg, Inc. - San Francisco, CA 94114, United States