2020-04-22 15:23:53 +08:00
|
|
|
# Commands
|
|
|
|
|
2020-08-11 22:31:03 +08:00
|
|
|
- menus
|
|
|
|
- buttons
|
|
|
|
- commands
|
|
|
|
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .clearContent()
|
|
|
|
|
|
|
|
Clear the whole document.
|
|
|
|
|
2020-04-22 20:59:34 +08:00
|
|
|
## .deleteSelection()
|
|
|
|
|
|
|
|
Delete the selection, if there is one.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .focus()
|
|
|
|
|
|
|
|
Focus the editor at the given position.
|
|
|
|
|
|
|
|
## .insertHTML()
|
|
|
|
|
|
|
|
Insert a string of HTML at the currently selected position.
|
|
|
|
|
|
|
|
## .insertText()
|
|
|
|
|
|
|
|
Insert a string of text at the currently selected position.
|
|
|
|
|
2020-04-22 20:22:31 +08:00
|
|
|
## .removeMark()
|
|
|
|
|
|
|
|
Remove a mark in the current selection.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .removeMarks()
|
|
|
|
|
|
|
|
Remove all marks in the current selection.
|
|
|
|
|
2020-04-22 20:38:15 +08:00
|
|
|
## .replaceWithNode()
|
|
|
|
|
|
|
|
Replace a given range with a node.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .selectAll()
|
|
|
|
|
|
|
|
Select the whole document.
|
|
|
|
|
2020-04-22 20:08:25 +08:00
|
|
|
## .selectParentNode()
|
|
|
|
|
|
|
|
Select the parent node.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .setContent()
|
|
|
|
|
|
|
|
Replace the whole document with new content.
|
|
|
|
|
2020-04-22 20:08:25 +08:00
|
|
|
## .toggleMark()
|
|
|
|
|
|
|
|
Toggle a mark on and off.
|
|
|
|
|
2020-04-22 15:23:53 +08:00
|
|
|
## .toggleNode()
|
|
|
|
|
2020-04-22 20:50:02 +08:00
|
|
|
Toggle a node with another node.
|
|
|
|
|
|
|
|
## .updateMark()
|
|
|
|
|
|
|
|
Update a mark with new attributes.
|