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

Hierarchy

Implements

Constructors

Properties

ES: "es5" | "es2015" | "es2018" | "es2021" = ES
STATUSES: {
    beforeDestruct: "beforeDestruct";
    beforeInit: "beforeInit";
    destructed: "destructed";
    ready: "ready";
} = STATUSES

Type declaration

  • Readonly beforeDestruct: "beforeDestruct"
  • Readonly beforeInit: "beforeInit"
  • Readonly destructed: "destructed"
  • Readonly ready: "ready"
async: IAsync = ...
components: Set<IComponent<IViewBased<IViewOptions>>> = ...

All created ViewComponent inside this view

create: ICreate
defaultOptions: IViewOptions
esModern: boolean = IS_ES_MODERN
esNext: boolean = IS_ES_NEXT
files: FileBrowserFiles = ...
id: string

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

isJodit: boolean = false
isView: true = ...
mods: IDictionary<null | string | boolean> = {}
ownerWindow: Window = window

The window in which jodit was created

registeredButtons: Set<IPluginButton> = ...
toolbar: IToolbarCollection = ...
tree: FileBrowserTree = ...
uid: string
uploader: IUploader
version: string = APP_VERSION

Accessors

  • get basePath(): string
  • Get path for loading extra staff

    Returns string

  • get c(): this["create"]
  • Returns this["create"]

  • get componentName(): string
  • Returns string

  • get componentStatus(): ComponentStatus
  • Current component status

    Returns ComponentStatus

  • set componentStatus(componentStatus): void
  • Setter for current component status

    Parameters

    Returns void

  • get defaultTimeout(): number
  • Return default timeout period in milliseconds for some debounce or throttle functions. By default, {history.timeout} options

    Returns number

  • get e(): this["events"]
  • Returns this["events"]

  • get isDestructed(): boolean
  • Component was destructed

    Returns boolean

  • get isFullSize(): boolean
  • View is in fullSize

    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 isLocked(): boolean
  • View is locked

    Returns boolean

  • get isOpened(): boolean
  • Returns boolean

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

    Returns boolean

  • get o(): this["options"]
  • Short alias for options

    Returns this["options"]

  • get options(): this["OPTIONS"]
  • Returns this["OPTIONS"]

  • set options(options): void
  • Parameters

    • options: this["OPTIONS"]

    Returns void

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

    Returns Document

Methods

  • Parameters

    Returns void

  • Parameters

    • this: IViewBased<IViewOptions> & IDlgs
    • msg: string | HTMLElement
    • Optional title: string | (() => false | void)
    • Optional callback: string | ((dialog) => false | void)
    • Optional className: string

    Returns IDialog

  • Returns string

  • Close dialog

    Returns void

  • Parameters

    • this: IViewBased<IViewOptions> & IDlgs
    • msg: string
    • title: undefined | string | ((yes) => void)
    • Optional callback: ((yes) => false | void)
        • (yes): false | void
        • Parameters

          • yes: boolean

          Returns false | void

    Returns IDialog

  • Returns void

  • Safe get any field

    Type Parameters

    • T

    Parameters

    • chain: string

      the path to be traversed in the obj object

    • Optional 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
  • 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

  • Make one instance of one module

    Type Parameters

    Parameters

    • moduleName: string
    • Optional options: object

    Returns T

  • Get BEM class modification value

    Parameters

    • this: IMods
    • name: string

    Returns ModType

  • Returns string

  • Return current version

    Returns string

  • Adds a handler for changing the component's status

    Parameters

    • status: ComponentStatus

      the status at which the callback is triggered

    • callback: ((component) => void)

      a function that will be called when the status is status

        • (component): void
        • Parameters

          Returns void

    Returns void

  • Internationalization method. Uses Jodit.lang object

    Parameters

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

    Returns string

  • Parameters

    • name: string

    Returns boolean

  • Disable selecting

    Parameters

    • name: string = 'any'

    Returns boolean

  • It opens a web browser window

    Parameters

    • callback: CanUndef<((_) => void)> = ...

      The function that will be called after the file selection in the browser

    • onlyImages: boolean = false

      Show only images

    Returns Promise<void>

    Example

    var fb = new Jodit.modules.FileBrowser(parent);
    fb.open(function (data) {
    var i;
    for (i = 0;i < data.files.length; i += 1) {
    parent.s.insertImage(data.baseurl + data.files[i]);
    }
    });
  • Parameters

    • this: IViewBased<IViewOptions> & IDlgs
    • msg: string
    • title: undefined | string | (() => false | void)
    • callback: ((value) => false | void)
        • (value): false | void
        • Parameters

          • value: string

          Returns false | void

    • Optional placeholder: string
    • Optional defaultValue: string

    Returns IDialog

  • Change panel container

    Parameters

    Returns void

  • Set component status

    Parameters

    Returns void

    See

    ComponentStatus

  • It displays a message in the status bar of filebrowser

    Parameters

    • message: string | Error
    • Optional success: boolean

      true It will be shown a message light . If no option is specified , ßan error will be shown the red

    Returns void

    Example

    parent.filebrowser.status('There was an error uploading file', false);
    
  • Parameters

    • Optional isFullSize: boolean

    Returns void

  • Enable selecting

    Returns boolean

Jodit PRO

If you like Jodit - try Jodit PRO