Module for creating snapshot of editor which includes html content and the current selection

Hierarchy

Implements

Properties

STATUSES: {
    beforeDestruct: "beforeDestruct";
    beforeInit: "beforeInit";
    destructed: "destructed";
    ready: "ready";
} = STATUSES

Type declaration

  • beforeDestruct: "beforeDestruct"
  • beforeInit: "beforeInit"
  • destructed: "destructed"
  • ready: "ready"
async: IAsync = ...
jodit: IJodit

Parent View element

ownerWindow: Window = window

The window in which jodit was created

uid: string

Methods

  • Returns string

  • Returns void

  • Safe get any field

    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

    Type Parameters

    • T

    Parameters

    • chain: string

      the path to be traversed in the obj object

    • Optional obj: IDictionary<any, string>

      the object in which the value is searched

    Returns Nullable<T>

  • Calc BEM element class name

    Parameters

    • elementName: string

      element name in the bem classification

    Returns string

  • Parameters

    • elementName: string
    • mod: string

    Returns string

  • Parameters

    • elementName: string
    • mod: string
    • modValue: string | boolean

    Returns string

  • Adds a handler for changing the component's status

    Parameters

    • status: ComponentStatus

      the status at which the callback is triggered

    • callback: ((component: Snapshot) => void)

      a function that will be called when the status is status

    Returns void

  • Parameters

    • text: string
    • Rest ...params: (string | number)[]

    Returns string

  • Creates object a snapshot of editor: html and the current selection. Current selection calculate by offset by start document {html: string, range: {startContainer: int, startOffset: int, endContainer: int, endOffset: int}} or {html: string} without selection

    Returns SnapshotType

  • Restores the state of the editor of the snapshot. Rebounding is not only html but selected text

    See

    make

    Parameters

    • snapshot: SnapshotType

      snapshot of editor resulting from the [[Snapshot.make]] method

    Returns void

  • Restore selection from snapshot

    See

    make

    Parameters

    Returns void

  • Set component status

    See

    ComponentStatus

    Parameters

    Returns void

  • Parameters

    • changes: (() => void)
        • (): void
        • Returns void

    Returns void

Accessors

  • get componentName(): string
  • Returns string

  • get defaultTimeout(): number
  • Returns number

  • get isBlocked(): boolean
  • Returns boolean

  • get isDestructed(): boolean
  • Component was destructed

    Returns boolean

  • 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

  • get isReady(): boolean
  • Component is ready for work

    Returns boolean

  • get j(): T
  • Shortcut for this.jodit

    Returns T

  • get ownerDocument(): Document
  • The document in which jodit was created

    Returns Document

Constructors

Jodit PRO

If you like Jodit - try Jodit PRO