FileBrowser

modules/file-browser.FileBrowser

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

Hierarchy

Implements

constructor

new FileBrowser(options?): FileBrowser

Parameters

Name Type
options? IFileBrowserOptions

Returns

FileBrowser

Inherited from

Dlgs.constructor

Defined in

src/modules/file-browser/file-browser.ts#356

STATUSES

Static STATUSES: Object = STATUSES

Type declaration

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

Inherited from

ViewWithToolbar.STATUSES

Defined in

src/core/component/component.ts#40


async

async: IAsync

Implementation of

IFileBrowser.async

Inherited from

ViewWithToolbar.async

Defined in

src/core/component/component.ts#44


uid

Readonly uid: string

Implementation of

IFileBrowser.uid

Inherited from

ViewWithToolbar.uid

Defined in

src/core/component/component.ts#59


ownerWindow

ownerWindow: Window = window

The window in which jodit was created

Implementation of

IFileBrowser.ownerWindow

Inherited from

ViewWithToolbar.ownerWindow

Defined in

src/core/component/component.ts#109


TOOLBAR

TOOLBAR: IToolbarCollection

Inherited from

ViewWithToolbar.TOOLBAR

Defined in

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


toolbar

toolbar: IToolbarCollection

Implementation of

IFileBrowser.toolbar

Inherited from

ViewWithToolbar.toolbar

Defined in

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


registeredButtons

registeredButtons: Set<IPluginButton>

Implementation of

IFileBrowser.registeredButtons

Inherited from

ViewWithToolbar.registeredButtons

Defined in

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


isJodit

Readonly isJodit: boolean = false

Inherited from

ViewWithToolbar.isJodit

Defined in

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


isView

Readonly isView: true

Implementation of

IFileBrowser.isView

Inherited from

ViewWithToolbar.isView

Defined in

src/core/view/view.ts#61


parent

parent: Nullable<IViewBased<IViewOptions>> = null

Implementation of

IFileBrowser.parent

Inherited from

ViewWithToolbar.parent

Defined in

src/core/view/view.ts#62


mods

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

Implementation of

IFileBrowser.mods

Inherited from

ViewWithToolbar.mods

Defined in

src/core/view/view.ts#64


id

id: string

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

Implementation of

IFileBrowser.id

Inherited from

ViewWithToolbar.id

Defined in

src/core/view/view.ts#69


components

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

All created ViewComponent inside this view

Implementation of

IFileBrowser.components

Inherited from

ViewWithToolbar.components

Defined in

src/core/view/view.ts#74


ES

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

Inherited from

ViewWithToolbar.ES

Defined in

src/core/view/view.ts#88


version

Static Readonly version: string = APP_VERSION

Inherited from

ViewWithToolbar.version

Defined in

src/core/view/view.ts#89


esNext

Static Readonly esNext: boolean = IS_ES_NEXT

Inherited from

ViewWithToolbar.esNext

Defined in

src/core/view/view.ts#90


esModern

Static Readonly esModern: boolean = IS_ES_MODERN

Inherited from

ViewWithToolbar.esModern

Defined in

src/core/view/view.ts#91


create

Readonly create: ICreate

Implementation of

IFileBrowser.create

Inherited from

ViewWithToolbar.create

Defined in

src/core/view/view.ts#127


events

events: IEventEmitter

Implementation of

IFileBrowser.events

Inherited from

ViewWithToolbar.events

Defined in

src/core/view/view.ts#146


defaultOptions

Static defaultOptions: IViewOptions

Inherited from

ViewWithToolbar.defaultOptions

Defined in

src/core/view/view.ts#393


tree

tree: FileBrowserTree

Implementation of

IFileBrowser.tree

Defined in

src/modules/file-browser/file-browser.ts#74


files

files: FileBrowserFiles

Implementation of

IFileBrowser.files

Defined in

src/modules/file-browser/file-browser.ts#75


state

state: IFileBrowserState & IObservable

Implementation of

IFileBrowser.state

Defined in

src/modules/file-browser/file-browser.ts#77


OPTIONS

OPTIONS: IFileBrowserOptions

Implementation of

IFileBrowser.OPTIONS

Inherited from

ViewWithToolbar.OPTIONS

Defined in

src/modules/file-browser/file-browser.ts#145


uploader

uploader: IUploader

Defined in

src/modules/file-browser/file-browser.ts#175

componentName

get componentName(): string

Returns

string

Implementation of

IFileBrowser.componentName

Defined in

src/core/component/component.ts#46


ownerDocument

get ownerDocument(): Document

The document in which jodit was created

Returns

Document

Implementation of

IFileBrowser.ownerDocument

Defined in

src/core/component/component.ts#95


od

get od(): Document

Shortcut for this.ownerDocument

Returns

Document

Implementation of

IFileBrowser.od

Defined in

src/core/component/component.ts#102


ow

get ow(): Window

Returns

Window

Implementation of

IFileBrowser.ow

Defined in

src/core/component/component.ts#110


isReady

get isReady(): boolean

Component is ready for work

Returns

boolean

Implementation of

IFileBrowser.isReady

Defined in

src/core/component/component.ts#145


isDestructed

get isDestructed(): boolean

Component was destructed

Returns

boolean

Implementation of

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

IFileBrowser.isInDestruct

Defined in

src/core/component/component.ts#160


componentStatus

get componentStatus(): ComponentStatus

Current component status

Returns

ComponentStatus

Implementation of

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

IFileBrowser.componentStatus

Defined in

src/core/component/component.ts#217


toolbarContainer

get toolbarContainer(): HTMLElement

Container for toolbar

Returns

HTMLElement

Implementation of

IFileBrowser.toolbarContainer

Defined in

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


basePath

get basePath(): string

Get a path for loading extra staff

Returns

string

Implementation of

IFileBrowser.basePath

Defined in

src/core/view/view.ts#79


defaultTimeout

get defaultTimeout(): number

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

Returns

number

Implementation of

IFileBrowser.defaultTimeout

Defined in

src/core/view/view.ts#97


buffer

get buffer(): IStorage<StorageValueType>

Some extra data inside editor

Returns

IStorage<StorageValueType>

See

copyformat plugin

Implementation of

IFileBrowser.buffer

Defined in

src/core/view/view.ts#106


message

get message(): IMessages

Returns

IMessages

Implementation of

IFileBrowser.message

Defined in

src/core/view/view.ts#111


c

get c(): this["create"]

Short alias for create

Returns

this["create"]

Implementation of

IFileBrowser.c

Defined in

src/core/view/view.ts#133


container

get container(): HTMLDivElement

Returns

HTMLDivElement

Implementation of

IFileBrowser.container

Defined in

src/core/view/view.ts#138

set container(container): void

Parameters

Name Type
container HTMLDivElement

Returns

void

Implementation of

IFileBrowser.container

Defined in

src/core/view/view.ts#142


e

get e(): this["events"]

Short alias for events

Returns

this["events"]

Implementation of

IFileBrowser.e

Defined in

src/core/view/view.ts#152


progressbar

get progressbar(): IProgressBar

progress_bar Progress bar

Returns

IProgressBar

Implementation of

IFileBrowser.progressbar

Defined in

src/core/view/view.ts#160


options

get options(): this["OPTIONS"]

Returns

this["OPTIONS"]

Implementation of

IFileBrowser.options

Defined in

src/core/view/view.ts#166

set options(options): void

Parameters

Name Type
options this["OPTIONS"]

Returns

void

Implementation of

IFileBrowser.options

Defined in

src/core/view/view.ts#170


o

get o(): this["options"]

Short alias for options

Returns

this["options"]

Implementation of

IFileBrowser.o

Defined in

src/core/view/view.ts#177


isLocked

get isLocked(): boolean

View is locked

Returns

boolean

Implementation of

IFileBrowser.isLocked

Defined in

src/core/view/view.ts#208


isFullSize

get isFullSize(): boolean

View is in fullSize

Returns

boolean

Implementation of

IFileBrowser.isFullSize

Defined in

src/core/view/view.ts#242


dataProvider

get dataProvider(): IFileBrowserDataProvider

Returns

IFileBrowserDataProvider

Implementation of

IFileBrowser.dataProvider

Defined in

src/modules/file-browser/file-browser.ts#92


storage

get storage(): IStorage<StorageValueType>

Container for set/get value

Returns

IStorage<StorageValueType>

Implementation of

IFileBrowser.storage

Defined in

src/modules/file-browser/file-browser.ts#168


isOpened

get isOpened(): boolean

Returns

boolean

Implementation of

IFileBrowser.isOpened

Defined in

src/modules/file-browser/file-browser.ts#177

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#65

getFullElName(elementName, mod): string

Parameters

Name Type
elementName string
mod string

Returns

string

Inherited from

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

Inherited from

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

Inherited from

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

Inherited from

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

Inherited from

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

Inherited from

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

ViewWithToolbar.isInstanceOf

Defined in

src/core/component/component.ts#283


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


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


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


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


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


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


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


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


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#63


getRegisteredButtonGroups

getRegisteredButtonGroups(): IDictionary<string[]>

Returns

IDictionary<string[]>

Inherited from

ViewWithToolbar.getRegisteredButtonGroups

Defined in

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


registerButton

registerButton(btn): this

Register button for a group

Parameters

Name Type
btn IPluginButton

Returns

this

Inherited from

ViewWithToolbar.registerButton

Defined in

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


unregisterButton

unregisterButton(btn): this

Remove button from a group

Parameters

Name Type
btn IPluginButton

Returns

this

Inherited from

ViewWithToolbar.unregisterButton

Defined in

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


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#184


toggleFullSize

toggleFullSize(isFullSize?): void

Parameters

Name Type
isFullSize? boolean

Returns

void

Inherited from

ViewWithToolbar.toggleFullSize

Defined in

src/core/view/view.ts#190


isLockedNotBy

isLockedNotBy(name): boolean

Parameters

Name Type
name string

Returns

boolean

Inherited from

ViewWithToolbar.isLockedNotBy

Defined in

src/core/view/view.ts#212


lock

lock(name?): boolean

Disable selecting

Parameters

Name Type Default value
name string 'any'

Returns

boolean

Inherited from

ViewWithToolbar.lock

Defined in

src/core/view/view.ts#218


unlock

unlock(): boolean

Enable selecting

Returns

boolean

Inherited from

ViewWithToolbar.unlock

Defined in

src/core/view/view.ts#230


getVersion

getVersion(): string

Return current version

Returns

string

Inherited from

ViewWithToolbar.getVersion

Defined in

src/core/view/view.ts#249


getVersion

getVersion(): string

Returns

string

Inherited from

ViewWithToolbar.getVersion

Defined in

src/core/view/view.ts#253


getInstance

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

Make one instance of one module

Type parameters

Name Type
T extends IComponent<IViewBased<IViewOptions>>

Parameters

Name Type
module Function
options? object

Returns

T

Inherited from

ViewWithToolbar.getInstance

Defined in

src/core/view/view.ts#306

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

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#307


className

className(): string

Returns

string

Inherited from

ViewWithToolbar.className

Defined in

src/modules/file-browser/file-browser.ts#67


status

status(message, success?): void

It displays a message in the status bar of filebrowser

Parameters

Name Type Description
message string | Error The message that will be displayed
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);
Defined in

src/modules/file-browser/file-browser.ts#193


close

close(): void

Close dialog

Returns

void

Defined in

src/modules/file-browser/file-browser.ts#216


open

open(callback?, onlyImages?): Promise<void>

It opens a web browser window

Parameters

Name Type Default value Description
callback CanUndef<(_: IFileBrowserCallBackData) => void> undefined 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]);
    }
});
Defined in

src/modules/file-browser/file-browser.ts#237


destruct

destruct(): void

Returns

void

Inherited from

ViewWithToolbar.destruct

Defined in

jodit/src/modules/file-browser/file-browser.ts:448