ETC
Miscellaneous editor commands executed via editor.execCommand.
Commands
command - insertBookmarkcommand - insertAbsolutePositionDivcommand - insertDivcommand - insertFilecommand - insertHorizontalLinecommand - insertPageBreakcommand - undocommand - redo
command - insertBookmark
Inserts a bookmark at the caret position.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
id | string | Bookmark id to insert |
editor.execCommand('insertBookmark', 'id');
command - insertAbsolutePositionDiv
Inserts an absolute-position layer.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
rect | object | { x: Number, y: Number, width: Number, height: Number } — placement and size of the layer |
editor.execCommand('insertAbsolutePositionDiv', { x: 100, y: 100, width: 200, height: 200 });
command - insertDiv
Inserts a block layer at the caret position. If a selection exists, the selected range is removed first, then the block layer is inserted.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('insertDiv');
command - insertFile
Inserts a file as a link at the caret position. The inserted file is uploaded to the server.
See: Import & Upload API
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
files | File[] | Files to upload |
editor.execCommand('insertFile', [file]);
command - insertHorizontalLine
Inserts a horizontal line at the caret position. If the caret is between paragraphs, the paragraph is split and the horizontal line is inserted between them. If a paragraph is selected, the selection is removed before the line is inserted.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('insertHorizontalLine');
command - insertPageBreak
Inserts a page break (used as a page separator when printing) at the caret position. If the caret is between paragraphs, the paragraph is split and the page break is inserted between them. If a selection exists, the selection is removed before the page break is inserted.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('insertPageBreak');
command - undo
Performs undo.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('undo');
command - redo
Performs redo.
| Name | Type | Description |
|---|---|---|
actionName | string | Action name |
editor.execCommand('redo');