Options
All
  • Public
  • Public/Protected
  • All
Menu

File system view UI component.

This component displays file system entries as icons.

Hierarchy

Index

Constructors

constructor

  • new FSViewUIComponent(fsPath: string): any
  • Creates a new File System View.

    Parameters

    • fsPath: string

      The path to use for this view.

    Returns any

Properties

dropzone

dropzone: DropZone

FS Dropzone.

eventQueue

eventQueue: EmitterEvent[]

fsPath

fsPath: string

Current filesystem path.

history

history: string[]

Navigation history.

historyPos

historyPos: number

Current history position.

initialNav

initialNav: boolean

Whether to navigate initially

options

options: FSViewOptions

FS view options

selBoxListener

selBoxListener: SelectBoxListener

Select box listener.

selectedIcons

selectedIcons: HTMLElement[]

Currently selected icons

uiComponent

uiComponent: Element

The underlying HTML element.

Methods

_createIconFolderDropzone

  • _createIconFolderDropzone(iconElement: HTMLDivElement, ep: any): void
  • Makes an icon dropzone.

    Parameters

    • iconElement: HTMLDivElement

      The icon to make draggable.

    • ep: any

    Returns void

backwards

  • backwards(navigate?: boolean): string
  • Go backwards in history.

    Parameters

    • Optional navigate: boolean

      Whether to navigate. Default = true.

    Returns string

clipboardPut

  • clipboardPut(items: string[], action: "copy" | "cut"): void
  • Puts items on the clipboard.

    Parameters

    • items: string[]

      The items to put

    • action: "copy" | "cut"

      The action.

    Returns void

createRenameBoxListener

  • createRenameBoxListener(icon: HTMLDivElement, onfinish: (value?: string) => void): void
  • Creates the rename box listener.

    Parameters

    • icon: HTMLDivElement

      The icon to create the listener for.

    • onfinish: (value?: string) => void

      On finish callback.

        • (value?: string): void
        • Parameters

          • Optional value: string

          Returns void

    Returns void

deselectAllIcons

  • deselectAllIcons(): void
  • Deselects all icons.

    Returns void

destroy

  • destroy(): void
  • Destroys the UI component.

    Returns void

drawWatermark

  • drawWatermark(): Promise<void>
  • [internal] Draw the watermark.

    Returns Promise<void>

emit

  • emit(evtName: String, ...args: any): void
  • Fires an event.

    Parameters

    • evtName: String

      The event name to fire.

    • Rest ...args: any

      The arguments to pass.

    Returns void

forwards

  • forwards(navigate?: boolean): string
  • Go forwards in history.

    Parameters

    • Optional navigate: boolean

      Whether to navigate. Default = true.

    Returns string

getElement

  • getElement(): Element
  • Returns the element for this UI component.

    Returns Element

getSize

  • getSize(): { height: Number; w: Number }
  • Returns the size of the component.

    Returns { height: Number; w: Number }

    • height: Number
    • w: Number

init

  • init(): void
  • [unused]

    Returns void

makeDraggable

  • makeDraggable(iconElement: HTMLDivElement): void
  • Makes an icon draggable.

    Parameters

    • iconElement: HTMLDivElement

      The icon to make draggable.

    Returns void

mkIcon

  • mkIcon(label: string, url: string): HTMLDivElement
  • Creates an icon.

    Parameters

    • label: string

      The label of the icon.

    • url: string

      The URL of the icon image.

    Returns HTMLDivElement

navigate

  • navigate(path: string, callback?: (ents: string[]) => void, quiet?: boolean, addHistory?: boolean): Promise<void>
  • Navigates to the specified path.

    Parameters

    • path: string

      The path to navigate to.

    • Optional callback: (ents: string[]) => void

      On navigation complete callback.

        • (ents: string[]): void
        • Parameters

          • ents: string[]

          Returns void

    • Optional quiet: boolean

      Whether to play a sound upon navigation.

    • Optional addHistory: boolean

      Whether to add the navigation to the navigation history.

    Returns Promise<void>

on

  • on(evtName: String, callback: Function): void
  • Listens for an event.

    Parameters

    • evtName: String

      The event name to listen for.

    • callback: Function

      The callback to assign.

    Returns void

once

  • once(evtName: String, callback: Function): void
  • Listens for an event once.

    Parameters

    • evtName: String

      The event name to listen for.

    • callback: Function

      The callback to assign.

    Returns void

onclipboard

  • onclipboard(): void
  • Returns void

ondropfinish

  • ondropfinish(): void
  • Occurs when a drag drop operation is completed.

    Returns void

onicondrop

  • onicondrop(element: HTMLElement): void
  • Occurs on item drop

    Parameters

    • element: HTMLElement

    Returns void

onitemdblclick

  • onitemdblclick(element: HTMLElement): void
  • Occurs when an item is double clicked

    Parameters

    • element: HTMLElement

    Returns void

onitemselected

  • onitemselected(element: HTMLElement): void
  • Occurs when an item is selected

    Parameters

    • element: HTMLElement

    Returns void

onkeyrequest

  • onkeyrequest(): boolean
  • Conditional

    Returns boolean

onrefreshneeded

  • onrefreshneeded(): void
  • On refresh needed

    Returns void

performClipboard

  • performClipboard(action: "copy" | "cut" | "paste"): Promise<void>
  • Performs a clipboard action.

    Parameters

    • action: "copy" | "cut" | "paste"

      The clipboard action to perform.

    Returns Promise<void>

readdirFunc

  • Readdir function

    Parameters

    • path: string

    Returns Promise<FSScanModeResult[]>

refreshView

  • refreshView(callback?: (ents: string[]) => void): Promise<void>
  • Refreshes the view.

    Parameters

    • Optional callback: (ents: string[]) => void

      Callback.

        • (ents: string[]): void
        • Parameters

          • ents: string[]

          Returns void

    Returns Promise<void>

resetClipboard

  • resetClipboard(): void
  • Resets the clipboard.

    Returns void

selectIcon

  • selectIcon(iconEl: HTMLElement, noDesel?: boolean): void
  • Selects an icon.

    Parameters

    • iconEl: HTMLElement

      The icon element to target.

    • Optional noDesel: boolean

      Do not deselect all previous icons.

    Returns void

setSize

  • setSize(w: string | number, h: string | number): void
  • Sets the size of the component.

    Parameters

    • w: string | number

      CSS prefixed width.

    • h: string | number

      CSS prefixed height.

    Returns void

setViewMode

  • setViewMode(mode: "icons" | "tile" | "details"): void
  • Sets the view mode.

    Parameters

    • mode: "icons" | "tile" | "details"

      The view mode to use.

    Returns void

sortIcons

  • sortIcons(): void
  • Sorts the icons.

    Returns void

uiCreateDirectory

  • uiCreateDirectory(cb: (result: boolean) => void): void
  • UI Create Directory.

    Parameters

    • cb: (result: boolean) => void
        • (result: boolean): void
        • Parameters

          • result: boolean

          Returns void

    Returns void

uiCreateFile

  • uiCreateFile(cb: (result: boolean) => void): void
  • UI Create File.

    Parameters

    • cb: (result: boolean) => void
        • (result: boolean): void
        • Parameters

          • result: boolean

          Returns void

    Returns void

up

  • up(navigate?: boolean): string
  • Go up a folder

    Parameters

    • Optional navigate: boolean

      Whether to navigate. Default = true.

    Returns string

Generated using TypeDoc