Class: Jodit

jodit.Jodit

The base class of all Jodit UI components. Provides work with a life cycle.

Hierarchy

Implements

ES

Static Readonly ES: "es5" | "es2015" | "es2018" | "es2021" = ES

Inherited from

ViewWithToolbar.ES

Defined in

src/core/view/view.ts#88


OPTIONS

OPTIONS: IViewOptions = View.defaultOptions

Implementation of

IJodit.OPTIONS

Inherited from

ViewWithToolbar.OPTIONS

Defined in

src/core/view/view.ts#158


STATUSES

Static STATUSES: Object = STATUSES

Type declaration

Name Type
beforeDestruct "beforeDestruct"
beforeInit "beforeInit"
destructed "destructed"
ready "ready"

Inherited from

ViewWithToolbar.STATUSES

Defined in

src/core/component/component.ts#41


TOOLBAR

TOOLBAR: IToolbarCollection

Inherited from

ViewWithToolbar.TOOLBAR

Defined in

src/core/view/view-with-toolbar.ts#33


async

async: IAsync

Implementation of

IJodit.async

Inherited from

ViewWithToolbar.async

Defined in

src/core/component/component.ts#45


components

Readonly components: Set<IComponent<IViewBased<IViewOptions>>>

All created ViewComponent inside this view

Implementation of

IJodit.components

Inherited from

ViewWithToolbar.components

Defined in

src/core/view/view.ts#74


constants

Static Readonly constants: constants = constants

Defined in

src/jodit.ts#201


core

Static Readonly core: Object

Type declaration

Name Type
Plugin typeof Plugin

Defined in

src/jodit.ts#206


create

Readonly create: ICreate

Implementation of

IJodit.create

Inherited from

ViewWithToolbar.create

Defined in

src/core/view/view.ts#127


currentPlace

currentPlace: IWorkPlace

Implementation of

IJodit.currentPlace

Defined in

src/jodit.ts#1250


decorators

Static Readonly decorators: IDictionary<Function> = {}

Defined in

src/jodit.ts#200


editorIsActive

editorIsActive: boolean = false

Editor has focus in this time

Implementation of

IJodit.editorIsActive

Defined in

src/jodit.ts#225


esModern

Static Readonly esModern: boolean = IS_ES_MODERN

Inherited from

ViewWithToolbar.esModern

Defined in

src/core/view/view.ts#91


esNext

Static Readonly esNext: boolean = IS_ES_NEXT

Inherited from

ViewWithToolbar.esNext

Defined in

src/core/view/view.ts#90


events

events: IEventEmitter

Implementation of

IJodit.events

Inherited from

ViewWithToolbar.events

Defined in

src/core/view/view.ts#143


fatMode

Static fatMode: boolean = FAT_MODE

Defined in

src/jodit.ts#193


id

id: string

ID attribute for source element, id add {id}_editor it's editor's id

Implementation of

IJodit.id

Inherited from

ViewWithToolbar.id

Defined in

src/core/view/view.ts#69


instances

Static Readonly instances: IDictionary<IJodit> = instances

Defined in

src/jodit.ts#202


isJodit

Readonly isJodit: true

Define if object is Jodit

Implementation of

IJodit.isJodit

Inherited from

ViewWithToolbar.isJodit

Defined in

src/jodit.ts#133


isView

Readonly isView: true

Implementation of

IJodit.isView

Inherited from

ViewWithToolbar.isView

Defined in

src/core/view/view.ts#61


lang

Static Readonly lang: any = lang

Defined in

src/jodit.ts#204


mods

Readonly mods: IDictionary<null | string | boolean> = {}

Implementation of

IJodit.mods

Inherited from

ViewWithToolbar.mods

Defined in

src/core/view/view.ts#64


modules

Static modules: modules

Defined in

src/jodit.ts#197


ns

Static ns: modules

Defined in

src/jodit.ts#198


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IJodit.ownerWindow

Inherited from

ViewWithToolbar.ownerWindow

Defined in

src/core/component/component.ts#110


parent

parent: Nullable<IViewBased<IViewOptions>> = null

Implementation of

IJodit.parent

Inherited from

ViewWithToolbar.parent

Defined in

src/core/view/view.ts#62


places

places: IWorkPlace[]

Implementation of

IJodit.places

Defined in

src/jodit.ts#1251


plugins

Static Readonly plugins: IPluginSystem = pluginSystem

Defined in

src/jodit.ts#195


registeredButtons

registeredButtons: Set<IPluginButton>

Implementation of

IJodit.registeredButtons

Inherited from

ViewWithToolbar.registeredButtons

Defined in

src/core/view/view-with-toolbar.ts#82


selection

Readonly selection: Selection

Implementation of

IJodit.selection

Defined in

src/jodit.ts#342


toolbar

toolbar: IToolbarCollection

Implementation of

IJodit.toolbar

Inherited from

ViewWithToolbar.toolbar

Defined in

src/core/view/view-with-toolbar.ts#34


uid

Readonly uid: string

Implementation of

IJodit.uid

Inherited from

ViewWithToolbar.uid

Defined in

src/core/component/component.ts#60


version

Static Readonly version: string = APP_VERSION

Inherited from

ViewWithToolbar.version

Defined in

src/core/view/view.ts#89

basePath

get basePath(): string

Get path for loading extra staff

Returns

string

Implementation of

IJodit.basePath

Defined in

src/core/view/view.ts#79


buffer

get buffer(): IStorage<StorageValueType>

Some extra data inside editor

Returns

IStorage<StorageValueType>

See

copyformat plugin

Implementation of

IJodit.buffer

Defined in

src/core/view/view.ts#106


c

get c(): this["create"]

Returns

this["create"]

Implementation of

IJodit.c

Defined in

src/core/view/view.ts#130


componentName

get componentName(): string

Returns

string

Implementation of

IJodit.componentName

Defined in

src/core/component/component.ts#47


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

IJodit.componentStatus

Defined in

src/core/component/component.ts#211

set componentStatus(componentStatus): void

Setter for current component status

Parameters

Name Type
componentStatus ComponentStatus

Returns

void

Implementation of

IJodit.componentStatus

Defined in

src/core/component/component.ts#218


container

get container(): HTMLDivElement

Container for all staff

Returns

HTMLDivElement

Implementation of

IJodit.container

Defined in

src/jodit.ts#257

set container(container): void

Parameters

Name Type
container HTMLDivElement

Returns

void

Implementation of

IJodit.container

Defined in

src/jodit.ts#261


createInside

get createInside(): ICreate

Returns

ICreate

Implementation of

IJodit.createInside

Defined in

src/jodit.ts#218


defaultOptions

get defaultOptions(): Config

Default settings

Returns

Config

Defined in

src/jodit.ts#189


defaultTimeout

get defaultTimeout(): number

Return default timeout period in milliseconds for some debounce or throttle functions.
By default, {history.timeout} options

Returns

number

Implementation of

IJodit.defaultTimeout

Defined in

src/jodit.ts#153


e

get e(): this["events"]

Returns

this["events"]

Implementation of

IJodit.e

Defined in

src/core/view/view.ts#146


ed

get ed(): this["editorDocument"]

Alias for this.ew

Returns

this["editorDocument"]

Implementation of

IJodit.ed

Defined in

src/jodit.ts#327


editor

get editor(): HTMLDivElement | HTMLBodyElement

editor It contains the root element editor

Returns

HTMLDivElement | HTMLBodyElement

Implementation of

IJodit.editor

Defined in

src/jodit.ts#246

set editor(editor): void

Parameters

Name Type
editor HTMLDivElement | HTMLBodyElement

Returns

void

Implementation of

IJodit.editor

Defined in

src/jodit.ts#250


editorDocument

get editorDocument(): Document

In iframe mode editor's window can be different by owner

Returns

Document

Implementation of

IJodit.editorDocument

Defined in

src/jodit.ts#320


editorWindow

get editorWindow(): Window

In iframe mode editor's window can be different by owner

Returns

Window

Implementation of

IJodit.editorWindow

Defined in

src/jodit.ts#302

set editorWindow(win): void

Parameters

Name Type
win Window

Returns

void

Implementation of

IJodit.editorWindow

Defined in

src/jodit.ts#306


element

get element(): HTMLElement

element It contains source element

Returns

HTMLElement

Implementation of

IJodit.element

Defined in

src/jodit.ts#239


ew

get ew(): this["editorWindow"]

Alias for this.ew

Returns

this["editorWindow"]

Implementation of

IJodit.ew

Defined in

src/jodit.ts#313


filebrowser

get filebrowser(): IFileBrowser<IFileBrowserOptions>

Returns

IFileBrowser<IFileBrowserOptions>

Implementation of

IJodit.filebrowser

Defined in

src/jodit.ts#358


history

get history(): IHistory

Returns

IHistory

Implementation of

IJodit.history

Defined in

src/jodit.ts#295


iframe

get iframe(): void | HTMLIFrameElement

iframe Iframe for iframe mode

Returns

void | HTMLIFrameElement

Implementation of

IJodit.iframe

Defined in

src/jodit.ts#287

set iframe(iframe): void

Parameters

Name Type
iframe void | HTMLIFrameElement

Returns

void

Implementation of

IJodit.iframe

Defined in

src/jodit.ts#291


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

IJodit.isDestructed

Defined in

src/core/component/component.ts#153


isFocused

get isFocused(): boolean

Returns

boolean

Implementation of

IJodit.isFocused

Defined in

src/jodit.ts#1140


isFullSize

get isFullSize(): boolean

View is in fullSize

Returns

boolean

Implementation of

IJodit.isFullSize

Defined in

src/core/view/view.ts#236


isInDestruct

get isInDestruct(): boolean

The component is currently undergoing destructuring or has already been destroyed.
Those. you should not hang new events on him now or do anything else with him.

Returns

boolean

Implementation of

IJodit.isInDestruct

Defined in

src/core/component/component.ts#161


isLocked

get isLocked(): boolean

View is locked

Returns

boolean

Implementation of

IJodit.isLocked

Defined in

src/core/view/view.ts#202


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IJodit.isReady

Defined in

src/core/component/component.ts#146


message

get message(): IMessages

Returns

IMessages

Implementation of

IJodit.message

Defined in

src/jodit.ts#273


mode

get mode(): Modes

Editor's mode

Returns

Modes

Implementation of

IJodit.mode

Defined in

src/jodit.ts#405

set mode(mode): void

Parameters

Name Type
mode Modes

Returns

void

Implementation of

IJodit.mode

Defined in

src/jodit.ts#409


o

get o(): this["options"]

Short alias for options

Returns

this["options"]

Implementation of

IJodit.o

Defined in

src/core/view/view.ts#171


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IJodit.od

Defined in

src/core/component/component.ts#103


options

get options(): Config

options All Jodit settings default + second arguments of constructor

Returns

Config

Implementation of

IJodit.options

Defined in

src/jodit.ts#334

set options(opt): void

Parameters

Name Type
opt Config

Returns

void

Implementation of

IJodit.options

Defined in

src/jodit.ts#338


ow

get ow(): Window

Returns

Window

Implementation of

IJodit.ow

Defined in

src/core/component/component.ts#111


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IJodit.ownerDocument

Defined in

src/core/component/component.ts#96


progressbar

get progressbar(): IProgressBar

progress_bar Progress bar

Returns

IProgressBar

Implementation of

IJodit.progressbar

Defined in

src/core/view/view.ts#154


ready

get ready(): Promise<IJodit>

Returns

Promise<IJodit>

Defined in

src/jodit.ts#124


s

get s(): this["selection"]

Alias for this.selection

Returns

this["selection"]

Implementation of

IJodit.s

Defined in

src/jodit.ts#348


statusbar

get statusbar(): IStatusBar

Statusbar module

Returns

IStatusBar

Implementation of

IJodit.statusbar

Defined in

src/jodit.ts#280


storage

get storage(): IStorage<StorageValueType>

Container for persistent set/get value

Returns

IStorage<StorageValueType>

Implementation of

IJodit.storage

Defined in

src/core/view/view.ts#123


text

get text(): string

Plain text editor's value

Returns

string

Implementation of

IJodit.text

Defined in

src/jodit.ts#138


toolbarContainer

get toolbarContainer(): HTMLElement

Container for toolbar

Returns

HTMLElement

Implementation of

IJodit.toolbarContainer

Defined in

src/core/view/view-with-toolbar.ts#42


uploader

get uploader(): IUploader

Returns

IUploader

Implementation of

IJodit.uploader

Defined in

src/jodit.ts#353


value

get value(): string

HTML value

Returns

string

Implementation of

IJodit.value

Defined in

src/jodit.ts#451

set value(html): void

Parameters

Name Type
html string

Returns

void

Implementation of

IJodit.value

Defined in

src/jodit.ts#455


workplace

get workplace(): HTMLDivElement

workplace It contains source and wysiwyg editors

Returns

HTMLDivElement

Implementation of

IJodit.workplace

Defined in

src/jodit.ts#268

addPlace

addPlace(source, options?): void | Promise<any>

Create and init current editable place

Parameters

Name Type
source string | HTMLElement
options? object

Returns

void | Promise<any>

Defined in

src/jodit.ts#1258


afterSetMod

afterSetMod(name, value): void

Parameters

Name Type
name string
value ModType

Returns

void

Inherited from

ViewWithToolbar.afterSetMod

Defined in

src/core/traits/mods.ts#23


alert

alert(this, msg, title?, callback?, className?): IDialog

Parameters

Name Type
this IViewBased<IViewOptions> & IDlgs
msg string | HTMLElement
title? string | () => false | void
callback? string | (dialog: IDialog) => false | void
className? string

Returns

IDialog

Inherited from

Dlgs.alert

Defined in

src/core/traits/dlgs.ts#70


atom

atom<T>(object): T

Method wrap usual Has Object in Object helper for prevent deep object merging in options*

Type parameters

Name
T

Parameters

Name Type
object T

Returns

T

Defined in

src/jodit.ts#162


bindDestruct

bindDestruct(component): Jodit

Bind destructor to some View

Parameters

Name Type
component IComponent<IViewBased<IViewOptions>>

Returns

Jodit

Inherited from

ViewWithToolbar.bindDestruct

Defined in

src/core/component/component.ts#171


className

className(): string

Returns

string

Inherited from

ViewWithToolbar.className

Defined in

src/jodit.ts#99


confirm

confirm(this, msg, title, callback?): IDialog

Parameters

Name Type
this IViewBased<IViewOptions> & IDlgs
msg string
title undefined | string | (yes: boolean) => void
callback? (yes: boolean) => false | void

Returns

IDialog

Inherited from

Dlgs.confirm

Defined in

src/core/traits/dlgs.ts#32


destruct

destruct(): void

Jodit's Destructor. Remove editor, and return source input

Returns

void

Inherited from

ViewWithToolbar.destruct

Defined in

src/jodit.ts#1630


dlg

dlg(this, options?): IDialog

Parameters

Name Type
this IViewBased<IViewOptions> & IDlgs
options? IDialogOptions

Returns

IDialog

Inherited from

Dlgs.dlg

Defined in

src/core/traits/dlgs.ts#17


execCommand

execCommand(command, showUI?, value?, ...args): void

Execute command editor

Parameters

Name Type Description
command string command. It supports all the
showUI? boolean -
value? any -
...args unknown[] -

Returns

void

See

https://developer.mozilla.org/ru/docs/Web/API/Document/execCommand#commands and a number of its own
for example applyStyleProperty. Comand fontSize receives the second parameter px,
formatBlock and can take several options

Example

this.execCommand('fontSize', 12); // sets the size of 12 px
this.execCommand('underline');
this.execCommand('formatBlock', 'p'); // will be inserted paragraph

Defined in

src/jodit.ts#762


fetch

fetch<Response>(url, options?): Promise<IResponse<Response>>

Type parameters

Name Type
Response extends object = any

Parameters

Name Type
url string
options? Partial<AjaxOptions>

Returns

Promise<IResponse<Response>>

Defined in

src/jodit.ts#1600


focus

focus(): void

Returns

void

Defined in

src/jodit.ts#1134


get

get<T>(chain, obj?): Nullable<T>

Safe get any field

Type parameters

Name
T

Parameters

Name Type Description
chain string the path to be traversed in the obj object
obj? IDictionary the object in which the value is searched

Returns

Nullable<T>

Example

private a = {
	b: {
		c: {
			e: {
				g: {
					color: 'red'
				}
			}
		}
	}
}

this.get('a.b.c.e.g.color'); // Safe access to color
// instead using optionsl chaining
this?.a?.b?.c?.e?.g?.color

Inherited from

ViewWithToolbar.get

Defined in

src/core/component/component.ts#139


getDisabled

getDisabled(): boolean

Return true if editor in disabled mode

Returns

boolean

Defined in

src/jodit.ts#1100


getEditorValue

getEditorValue(removeSelectionMarkers?, consumer?): string

Return editor value

Parameters

Name Type Default value
removeSelectionMarkers boolean true
consumer? string undefined

Returns

string

Defined in

src/jodit.ts#478


getElementValue

getElementValue(): string

Return source element value

Returns

string

Defined in

src/jodit.ts#628


getElm

getElm<T>(this, elementName): Nullable<HTMLElement>

Return element with BEM class name

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IElms

Parameters

Name Type
this T
elementName string

Returns

Nullable<HTMLElement>

Inherited from

ViewWithToolbar.getElm

Defined in

src/core/traits/elms.ts#18


getElms

getElms<T>(this, elementName): HTMLElement[]

Return elements with BEM class name

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IElms

Parameters

Name Type
this T
elementName string

Returns

HTMLElement[]

Inherited from

ViewWithToolbar.getElms

Defined in

src/core/traits/elms.ts#30


getFullElName

getFullElName(elementName): string

Calc BEM element class name

Parameters

Name Type Description
elementName string element name in the bem classification

Returns

string

Inherited from

ViewWithToolbar.getFullElName

Defined in

src/core/component/component.ts#66

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Inherited from

ViewWithToolbar.getFullElName

Defined in

src/core/component/component.ts#67

getFullElName(elementName, mod, modValue): string

Parameters

Name Type
elementName string
mod string
modValue string | boolean

Returns

string

Inherited from

ViewWithToolbar.getFullElName

Defined in

src/core/component/component.ts#68


getInstance

getInstance<T>(moduleName, options?): T

Make one instance of one module

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>>

Parameters

Name Type
moduleName string
options? object

Returns

T

Inherited from

ViewWithToolbar.getInstance

Defined in

src/core/view/view.ts#300


getMod

getMod(this, name): ModType

Get BEM class modification value

Parameters

Name Type
this IMods
name string

Returns

ModType

Inherited from

ViewWithToolbar.getMod

Defined in

src/core/traits/mods.ts#64


getMode

getMode(): Modes

Return current editor mode: Jodit.MODE_WYSIWYG, Jodit.MODE_SOURCE or Jodit.MODE_SPLIT

Returns

Modes

Defined in

src/jodit.ts#949


getReadOnly

getReadOnly(): boolean

Return true if editor in read-only mode

Returns

boolean

Defined in

src/jodit.ts#1130


getRealMode

getRealMode(): Modes

Return current real work mode. When editor in MODE_SOURCE or MODE_WYSIWYG it will
return them, but then editor in MODE_SPLIT it will return MODE_SOURCE if
Textarea(CodeMirror) focused or MODE_WYSIWYG otherwise

Returns

Modes

Example

var editor = Jodit.make('#editor');
console.log(editor.getRealMode());

Defined in

src/jodit.ts#968


getRegisteredButtonGroups

getRegisteredButtonGroups(): IDictionary<string[]>

Returns

IDictionary<string[]>

Inherited from

ViewWithToolbar.getRegisteredButtonGroups

Defined in

src/core/view/view-with-toolbar.ts#85


getVersion

getVersion(): string

Returns

string

Inherited from

ViewWithToolbar.getVersion

Defined in

src/core/view/view.ts#247


getVersion

getVersion(): string

Return current version

Returns

string

Inherited from

ViewWithToolbar.getVersion

Defined in

src/core/view/view.ts#243


hookStatus

hookStatus(status, callback): void

Adds a handler for changing the component's status

Parameters

Name Type Description
status ComponentStatus the status at which the callback is triggered
callback (component: Jodit) => void a function that will be called when the status is status

Returns

void

Inherited from

ViewWithToolbar.hookStatus

Defined in

src/core/component/component.ts#266


i18n

i18n(text, ...params): string

Internationalization method. Uses Jodit.lang object

Parameters

Name Type
text string
...params (string | number)[]

Returns

string

Inherited from

ViewWithToolbar.i18n

Defined in

src/core/view/view.ts#178


isEditorMode

isEditorMode(): boolean

Returns

boolean

Defined in

src/jodit.ts#953


isInstanceOf

isInstanceOf<T>(c, constructorFunc): c is T

Type parameters

Name Type
T extends Component

Parameters

Name Type
c unknown
constructorFunc Function

Returns

c is T

Inherited from

ViewWithToolbar.isInstanceOf

Defined in

src/core/component/component.ts#284


isJoditAssigned

isJoditAssigned(element): element is HTMLElement & Object

Checks if the element has already been initialized when for Jodit

Parameters

Name Type
element HTMLElement

Returns

element is HTMLElement & Object

Defined in

src/jodit.ts#176


isLockedNotBy

isLockedNotBy(name): boolean

Parameters

Name Type
name string

Returns

boolean

Inherited from

ViewWithToolbar.isLockedNotBy

Defined in

src/core/view/view.ts#206


lock

lock(name?): boolean

Disable selecting

Parameters

Name Type Default value
name string 'any'

Returns

boolean

Inherited from

ViewWithToolbar.lock

Defined in

src/jodit.ts#916


make

make(element, options?): Jodit

Factory for creating Jodit instance

Parameters

Name Type
element string | HTMLElement
options? object

Returns

Jodit

Defined in

src/jodit.ts#169


nativeExecCommand

nativeExecCommand(command, showUI?, value?): boolean

Exec native command

Parameters

Name Type
command string
showUI? boolean
value? any

Returns

boolean

Defined in

src/jodit.ts#860


prompt

prompt(this, msg, title, callback, placeholder?, defaultValue?): IDialog

Parameters

Name Type
this IViewBased<IViewOptions> & IDlgs
msg string
title undefined | string | () => false | void
callback (value: string) => false | void
placeholder? string
defaultValue? string

Returns

IDialog

Inherited from

Dlgs.prompt

Defined in

src/core/traits/dlgs.ts#48


registerButton

registerButton(btn): Jodit

Register button for group

Parameters

Name Type
btn IPluginButton

Returns

Jodit

Inherited from

ViewWithToolbar.registerButton

Defined in

src/core/view/view-with-toolbar.ts#92


registerCommand

registerCommand<C>(commandNameOriginal, command, options?): IJodit

Register custom handler for command

Type parameters

Name Type
C extends string

Parameters

Name Type
commandNameOriginal C
command CustomCommand<IJodit, C>
options? Object
options.stopPropagation boolean

Returns

IJodit

Example

var jodit = Jodit.make('#editor);

jodit.setEditorValue('test test test');

jodit.registerCommand('replaceString', function (command, needle, replace) {
     var value = this.getEditorValue();
     this.setEditorValue(value.replace(needle, replace));
     return false; // stop execute native command
});

jodit.execCommand('replaceString', 'test', 'stop');

console.log(jodit.value); // stop test test

// and you can add hotkeys for command
jodit.registerCommand('replaceString', {
   hotkeys: 'ctrl+r',
   exec: function (command, needle, replace) {
    var value = this.getEditorValue();
    this.setEditorValue(value.replace(needle, replace));
   }
});

Defined in

src/jodit.ts#689


registerHotkeyToCommand

registerHotkeyToCommand(hotkeys, commandName, shouldStop?): void

Register hotkey for command

Parameters

Name Type Default value
hotkeys string | string[] undefined
commandName string undefined
shouldStop boolean true

Returns

void

Defined in

src/jodit.ts#727


setCurrentPlace

setCurrentPlace(place): void

Set current place object

Parameters

Name Type
place IWorkPlace

Returns

void

Defined in

src/jodit.ts#1418


setDisabled

setDisabled(isDisabled): void

Switch on/off the editor into the disabled state.
When in disabled, the user is not able to change the editor content
This function firing the disabled event.

Parameters

Name Type
isDisabled boolean

Returns

void

Defined in

src/jodit.ts#1082


setEditorValue

setEditorValue(value?): void

Set editor html value and if set sync fill source element value
When method was called without arguments - it is simple way to synchronize editor to element

Parameters

Name Type
value? string

Returns

void

Defined in

src/jodit.ts#542


setMod

setMod<T>(this, name, value, container?): T

Set/remove BEM class modification

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>> & IContainer & IMods

Parameters

Name Type Description
this T -
name string -
value ModType if null, mod will be removed
container? HTMLElement -

Returns

T

Inherited from

ViewWithToolbar.setMod

Defined in

src/core/traits/mods.ts#30


setMode

setMode(mode): void

Set current mode

Parameters

Name Type
mode string | number

Returns

void

Defined in

src/jodit.ts#990


setNativeEditorValue

setNativeEditorValue(value): void

Set value to native editor

Parameters

Name Type
value string

Returns

void

Defined in

src/jodit.ts#434


setPanel

setPanel(element): void

Change panel container

Parameters

Name Type
element string | HTMLElement

Returns

void

Inherited from

ViewWithToolbar.setPanel

Defined in

src/core/view/view-with-toolbar.ts#59


setReadOnly

setReadOnly(isReadOnly): void

Switch on/off the editor into the read-only state.
When in readonly, the user is not able to change the editor content, but can still
use some editor functions (show source code, print content, or seach).
This function firing the readonly event.

Parameters

Name Type
isReadOnly boolean

Returns

void

Defined in

src/jodit.ts#1110


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Inherited from

ViewWithToolbar.setStatus

Defined in

src/core/component/component.ts#227


synchronizeValues

synchronizeValues(): void

Returns

void

Defined in

src/jodit.ts#462


toggleFullSize

toggleFullSize(isFullSize?): void

Parameters

Name Type
isFullSize? boolean

Returns

void

Inherited from

ViewWithToolbar.toggleFullSize

Defined in

src/core/view/view.ts#184


toggleMode

toggleMode(): void

Toggle editor mode WYSIWYG to TEXTAREA(CodeMirror) to SPLIT(WYSIWYG and TEXTAREA) to again WYSIWYG

Returns

void

Example

var editor = Jodit.make('#editor');
editor.toggleMode();

Defined in

src/jodit.ts#1059


unlock

unlock(): boolean

Enable selecting

Returns

boolean

Inherited from

ViewWithToolbar.unlock

Defined in

src/jodit.ts#931


unregisterButton

unregisterButton(btn): Jodit

Remove button from group

Parameters

Name Type
btn IPluginButton

Returns

Jodit

Inherited from

ViewWithToolbar.unregisterButton

Defined in

src/core/view/view-with-toolbar.ts#112


waitForReady

waitForReady(): Promise<IJodit>

Return promise for ready actions

Returns

Promise<IJodit>

Example

const jodit = Jodit.make('#editor');
await jodit.waitForReady();
jodit.e.fire('someAsyncLoadedPluginEvent', (test) => {
  alert(test);
});

Defined in

src/jodit.ts#114