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

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 = ...

Parent View element

ownerWindow: Window = window

The window in which jodit was created

path: string = ''
source: string = 'default'
uid: string

Methods

  • Set the handlers Drag and Drop to $form

    Example

    var $form = jQuery('<form><input type="text" typpe="file"></form>');
    jQuery('body').append($form);
    Jodit.editors.someidfoeditor.uploader.bind($form[0], function (files) {
    var i;
    for (i = 0; i < data.files.length; i += 1) {
    parent.s.insertImage(data.files[i])
    }
    });

    Parameters

    • form: HTMLElement

      Form or any Node on which you can drag and drop the file. In addition will be processed <input type="file" >

    • Optional handlerSuccess: HandlerSuccess

      The function be called when a successful uploading files to the server

    • Optional handlerError: HandlerError

      The function that will be called during a failed download files a server

    Returns void

  • Returns string

  • Returns any

  • 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: Uploader) => void)

      a function that will be called when the status is status

    Returns void

  • Parameters

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

    Returns string

  • It sets the path for uploading files

    Parameters

    • path: string

    Returns Uploader

  • It sets the source for connector

    Parameters

    • source: string

    Returns Uploader

  • Set component status

    See

    ComponentStatus

    Parameters

    Returns void

  • Upload images to a server by its URL, making it through the connector server.

    Parameters

    Returns void

Accessors

  • get componentName(): string
  • Returns string

  • get defaultTimeout(): number
  • Returns number

  • 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 o(): this["options"]
  • Returns this["options"]

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

    Returns Document

Constructors

Jodit PRO

If you like Jodit - try Jodit PRO