ETC

Miscellaneous editor commands executed via editor.execCommand.

Commands


command - insertBookmark

Inserts a bookmark at the caret position.

NameTypeDescription
actionNamestringAction name
idstringBookmark id to insert
editor.execCommand('insertBookmark', 'id');

command - insertAbsolutePositionDiv

Inserts an absolute-position layer.

NameTypeDescription
actionNamestringAction name
rectobject{ 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.

NameTypeDescription
actionNamestringAction 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

NameTypeDescription
actionNamestringAction name
filesFile[]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.

NameTypeDescription
actionNamestringAction 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.

NameTypeDescription
actionNamestringAction name
editor.execCommand('insertPageBreak');

command - undo

Performs undo.

NameTypeDescription
actionNamestringAction name
editor.execCommand('undo');

command - redo

Performs redo.

NameTypeDescription
actionNamestringAction name
editor.execCommand('redo');