Uploader

modules/uploader.Uploader

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

Hierarchy

Implements

constructor

new Uploader(editor, options?): Uploader

Parameters

Name Type
editor IViewBased<IViewOptions>
options? IUploaderOptions<Uploader>

Returns

Uploader

Overrides

ViewComponent.constructor

Defined in

src/modules/uploader/uploader.ts#291

STATUSES

Static STATUSES: Object = STATUSES

Type declaration

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

Inherited from

ViewComponent.STATUSES

Defined in

src/core/component/component.ts#40


async

async: IAsync

Implementation of

IUploader.async

Inherited from

ViewComponent.async

Defined in

src/core/component/component.ts#44


uid

Readonly uid: string

Implementation of

IUploader.uid

Inherited from

ViewComponent.uid

Defined in

src/core/component/component.ts#59


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IUploader.ownerWindow

Inherited from

ViewComponent.ownerWindow

Defined in

src/core/component/component.ts#109


jodit

Readonly jodit: IViewBased<IViewOptions>

Parent View element

Implementation of

IUploader.jodit

Overrides

ViewComponent.jodit

Defined in

src/modules/uploader/uploader.ts#45


path

path: string = ''

Implementation of

IUploader.path

Defined in

src/modules/uploader/uploader.ts#56


source

source: string = 'default'

Implementation of

IUploader.source

Defined in

src/modules/uploader/uploader.ts#57


options

Readonly options: IUploaderOptions<IUploader>

Implementation of

IUploader.options

Defined in

src/modules/uploader/uploader.ts#59

componentName

get componentName(): string

Returns

string

Implementation of

IUploader.componentName

Inherited from

ViewComponent.componentName

Defined in

src/core/component/component.ts#46


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IUploader.ownerDocument

Inherited from

ViewComponent.ownerDocument

Defined in

src/core/component/component.ts#95


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IUploader.od

Inherited from

ViewComponent.od

Defined in

src/core/component/component.ts#102


ow

get ow(): Window

Returns

Window

Implementation of

IUploader.ow

Inherited from

ViewComponent.ow

Defined in

src/core/component/component.ts#110


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IUploader.isReady

Inherited from

ViewComponent.isReady

Defined in

src/core/component/component.ts#145


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

IUploader.isDestructed

Inherited from

ViewComponent.isDestructed

Defined in

src/core/component/component.ts#152


isInDestruct

get isInDestruct(): boolean

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

Returns

boolean

Implementation of

IUploader.isInDestruct

Inherited from

ViewComponent.isInDestruct

Defined in

src/core/component/component.ts#160


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

IUploader.componentStatus

Inherited from

ViewComponent.componentStatus

Defined in

src/core/component/component.ts#210

set componentStatus(componentStatus): void

Setter for current component status

Parameters

Name Type
componentStatus ComponentStatus

Returns

void

Implementation of

IUploader.componentStatus

Inherited from

ViewComponent.componentStatus

Defined in

src/core/component/component.ts#217


defaultTimeout

get defaultTimeout(): number

Returns

number

Implementation of

IUploader.defaultTimeout

Inherited from

ViewComponent.defaultTimeout

Defined in

src/core/component/view-component.ts#31


j

get j(): IViewBased<IViewOptions>

Shortcut for this.jodit

Returns

IViewBased<IViewOptions>

Implementation of

IUploader.j

Overrides

ViewComponent.j

Defined in

src/modules/uploader/uploader.ts#47


o

get o(): this["options"]

Returns

this["options"]

Implementation of

IUploader.o

Defined in

src/modules/uploader/uploader.ts#60

getFullElName

getFullElName(elementName): string

Calc BEM element class name

Parameters

Name Type Description
elementName string element name in the bem classification

Returns

string

Implementation of

IUploader.getFullElName

Inherited from

ViewComponent.getFullElName

Defined in

src/core/component/component.ts#65

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Implementation of

IUploader.getFullElName

Inherited from

ViewComponent.getFullElName

Defined in

src/core/component/component.ts#66

getFullElName(elementName, mod, modValue): string

Parameters

Name Type
elementName string
mod string
modValue string | boolean

Returns

string

Implementation of

IUploader.getFullElName

Inherited from

ViewComponent.getFullElName

Defined in

src/core/component/component.ts#67


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

Implementation of

IUploader.get

Inherited from

ViewComponent.get

Defined in

src/core/component/component.ts#138


bindDestruct

bindDestruct(component): this

Bind destructor to some View

Parameters

Name Type
component IComponent<IViewBased<IViewOptions>>

Returns

this

Implementation of

IUploader.bindDestruct

Inherited from

ViewComponent.bindDestruct

Defined in

src/core/component/component.ts#170


setStatus

setStatus(componentStatus): void

Set component status

Parameters

Name Type Description
componentStatus ComponentStatus component status

Returns

void

See

ComponentStatus

Implementation of

IUploader.setStatus

Inherited from

ViewComponent.setStatus

Defined in

src/core/component/component.ts#226


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: this) => void a function that will be called when the status is status

Returns

void

Implementation of

IUploader.hookStatus

Inherited from

ViewComponent.hookStatus

Defined in

src/core/component/component.ts#265


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

ViewComponent.isInstanceOf

Defined in

src/core/component/component.ts#283


i18n

i18n(text, ...params): string

Parameters

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

Returns

string

Implementation of

IUploader.i18n

Inherited from

ViewComponent.i18n

Defined in

src/core/component/view-component.ts#35


setParentView

setParentView(jodit): this

Attach component to View

Parameters

Name Type
jodit IViewBased<IViewOptions>

Returns

this

Implementation of

IUploader.setParentView

Inherited from

ViewComponent.setParentView

Defined in

src/core/component/view-component.ts#42


className

className(): string

Returns

string

Implementation of

IUploader.className

Overrides

ViewComponent.className

Defined in

src/modules/uploader/uploader.ts#52


setPath

setPath(path): this

It sets the path for uploading files

Parameters

Name Type
path string

Returns

this

Implementation of

IUploader.setPath

Defined in

src/modules/uploader/uploader.ts#67


setSource

setSource(source): this

It sets the source for connector

Parameters

Name Type
source string

Returns

this

Implementation of

IUploader.setSource

Defined in

src/modules/uploader/uploader.ts#75


bind

bind(form, handlerSuccess?, handlerError?): void

Set the handlers Drag and Drop to $form

Parameters

Name Type Description
form HTMLElement Form or any Node on which you can drag and drop the file. In addition will be processed <input type="file" >
handlerSuccess? HandlerSuccess The function be called when a successful uploading files to the server
handlerError? HandlerError The function that will be called during a failed download files a server

Returns

void

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])
    }
});

Implementation of

IUploader.bind

Defined in

src/modules/uploader/uploader.ts#100


uploadRemoteImage

uploadRemoteImage(url, handlerSuccess?, handlerError?): void

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

Parameters

Name Type
url string
handlerSuccess? HandlerSuccess
handlerError? HandlerError

Returns

void

Implementation of

IUploader.uploadRemoteImage

Defined in

src/modules/uploader/uploader.ts#257


destruct

destruct(): any

Returns

any

Implementation of

IUploader.destruct

Overrides

ViewComponent.destruct

Defined in

jodit/src/modules/uploader/uploader.ts:303