FilePicker

FilePicker

The FilePicker application renders contents of the server-side public directory This app allows for navigating and uploading files to the public path

Constructor

new FilePicker()

Source:

Members

(static) defaultOptions :Object

Source:

Assign the default options which are supported by this Application

Type:
  • Object

activeSource :string

Source:

Track the active source tab which is being browsed

Type:
  • string

button :HTMLElement

Source:

A button which controls the display of the picker UI

Type:
  • HTMLElement

canUpload

Source:

Return a flag for whether the current user is able to upload file content

extensions :Array

Source:

The current set of file extensions which are being filtered upon

Type:

field :HTMLElement

Source:

The target HTML element this file picker is bound to

Type:
  • HTMLElement

request :string

Source:

The full requested path given by the user

Type:
  • string

source

Source:

Return the source object for the currently active source

sources :Object

Source:

The file sources which are available for browsing

Type:
  • Object

target

Source:

Return the target directory for the currently active source

title

Source:

Render a window title for the FilePicker which indicates the types of files which can be selected

type :String

Source:

The general file type which controls the set of extensions which will be accepted

Type:

Methods

(async, static) browse(source, target, options) → {Promise}

Source:

Browse files for a certain directory location

Parameters:
Name Type Description
source string

The source location in which to browse

target string

The target within the source location

options Object

Optional arguments

Properties
Name Type Description
bucket string

A bucket within which to search if using the S3 source

extensions Array

An Array of file extensions to filter on

wildcard boolean

The requested dir represents a wildcard path

Returns:

A Promise which resolves to the directories and files contained in the location

Type
Promise

(static) fromButton(button)

Source:

Bind the file picker to a new target field. Assumes the user will provide a

Parameters:
Name Type Description
button HTMLElement

The button element

_inferCurrentDirectory(target) → {Array}

Source:

Given a current file path, determine the directory it belongs to

Parameters:
Name Type Description
target String

The currently requested target path

Returns:

An array of the inferred source and target path

Type
Array

activateListeners(html)

Source:

Activate listeners to handle user interactivity for the FilePicker UI

Parameters:
Name Type Description
html

(async) browse(target, options)

Source:

Browse to a specific location for this FilePicker instance

Parameters:
Name Type Description
target string

The target within the currently active source location.

options Object

Browsing options

(async) getData() → {Object}

Source:

Prepare and return the data object used for rendering the application template

Returns:
Type
Object

render()

Source:

Additional actions performed when the file-picker UI is rendered