Selection module

A module for working with the cursor, text selections, processing selections, inserting html in place of the cursor.
most obvious use case

How to insert HTML into Jodit

There is a family of methods for this.[[Select.prototype.insertHTML]], [[Select.prototype.insertNode]], [[Select.prototype.insertImage]].

const jodit = Jodit.make('#editor');
jodit.selection.insertHTML('<span>some html</span>');
jodit.selection.insertNode(document.createElement('div')); // don't do that =) see [[core/create]]
jodit.selection.insertImage('https://somesite.com/image.png');

How to set focus in Jodit editor

const jodit = Jodit.make('#editor');
jodit.selection.focus();

Classes

Interfaces

CHANGE

Const CHANGE: "change"

Defined in

src/core/selection/style/commit-style.ts#24


INITIAL

Const INITIAL: "initial"

Defined in

src/core/selection/style/commit-style.ts#26


REPLACE

Const REPLACE: "replace"

Defined in

src/core/selection/style/commit-style.ts#27


UNSET

Const UNSET: "unset"

Defined in

src/core/selection/style/commit-style.ts#25


UNWRAP

Const UNWRAP: "unwrap"

Defined in

src/core/selection/style/commit-style.ts#23


WRAP

Const WRAP: "wrap"

Defined in

src/core/selection/style/commit-style.ts#22


_PREFIX

Const _PREFIX: "commitStyle"

Defined in

src/core/selection/style/commit-style.ts#28


states

Const states: Object

Type declaration

Name Type
CHANGE "CHANGE"
ELEMENT "ELEMENT"
END "END"
EXTRACT "EXTRACT"
LIST "LIST"
REPLACE_DEFAULT "REPLACE_DEFAULT"
START "START"
TOGGLE_LIST "TOGGLE_LIST"
UNWRAP "UNWRAP"
UNWRAP_CHILDREN "UNWRAP_CHILDREN"
WRAP "WRAP"

Defined in

src/core/selection/style/transactions.ts#34


transactions

Const transactions: IStyleTransactions

Defined in

src/core/selection/style/transactions.ts#62