Members
(static) defaultOptions
- Source:
(static) DISPLAY_MODES :Object.<string, number>
- Source:
Enumerate the allowed FilePicker display modes
Type:
- Object.<string, number>
(static) S3_BUCKETS :Array|null
- Source:
Cache the names of S3 buckets which can be used
Type:
- Array | null
(static) uploadURL
- Source:
Return the upload URL to which the FilePicker should post uploaded files
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
displayMode :string
- Source:
The display mode of the FilePicker UI
Type:
- string
extensions :Array.<string>
- Source:
The current set of file extensions which are being filtered upon
Type:
- Array.<string>
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
results :Object
- Source:
The latest set of results browsed from the server
Type:
- Object
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:
type :string
- Source:
The general file type which controls the set of extensions which will be accepted
Type:
- string
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. See FilePicker#sources for details |
||||||||||||
target |
string | The target within the source location |
||||||||||||
options |
Object | Optional arguments Properties
|
Returns:
A Promise which resolves to the directories and files contained in the location
- Type
- Promise
(async, static) configurePath(source, target, options) → {Promise.<Object>}
- Source:
Configure metadata settings regarding a certain file system path
Parameters:
Name | Type | Description |
---|---|---|
source |
string | The source location in which to browse. See FilePicker#sources for details |
target |
string | The target within the source location |
options |
Object | Optional arguments which modify the request |
Returns:
- Type
- Promise.<Object>
(async, static) createDirectory(source, target, options) → {Promise.<Object>}
- Source:
Create a subdirectory within a given source. The requested subdirectory path must not already exist.
Parameters:
Name | Type | Description |
---|---|---|
source |
string | The source location in which to browse. See FilePicker#sources for details |
target |
string | The target within the source location |
options |
Object | Optional arguments which modify the request |
Returns:
- Type
- Promise.<Object>
(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 |
(static) matchS3URL(url) → {RegExpMatchArray|null}
- Source:
Test a URL to see if it matches a well known s3 key pattern
Parameters:
Name | Type | Description |
---|---|---|
url |
string | An input URL to test |
Returns:
A regular expression match
- Type
- RegExpMatchArray | null
(async, static) upload(source, path, file, options) → {Promise.<Object>}
- Source:
Dispatch a POST request to the server containing a directory path and a file to upload
Parameters:
Name | Type | Description |
---|---|---|
source |
string | The data source to which the file should be uploaded |
path |
string | The destination path |
file |
File | The File object to upload |
options |
Object | Additional file upload options passed as form data |
Returns:
The response object
- Type
- Promise.<Object>
_canDragDrop()
- Source:
_canDragStart()
- Source:
_inferCurrentDirectory(target) → {Array.<string>}
- 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 directory path
- Type
- Array.<string>
_onChangeTab()
- Source:
_onDragStart()
- Source:
(async) _onDrop()
- Source:
_onSearchFilter()
- Source:
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()
- Source:
render()
- Source:
Additional actions performed when the file-picker UI is rendered