ve.FileExplorer

ve.Component. ve.FileExplorer

Refer to ve.Component for methods or fields inherited from this Component's parent such as .options.attributes or .element.

File explorer used either for navigation (i.e. saving/loading) or as a generic file explorer primitive.

  • Functional binding: veFileExplorer().
Constructor:
  • arg0_value: string - The file path in which the FileExplorer should be initialised.
  • arg1_options: Object
    • .actions_components_obj: Object<ve.Component> - Appended components in the topbar action meny, usually at the end.
    • .file_components_obj={select: ...}: Object<ve.Component>
    • .file_icon="<icon>description</icon>": string
    • .file_options: Object
    • .folder_components_obj={select: ...}: Object<ve.Component>
    • .folder_icon="<icon>folder</icon>": string
    • .folder_options: Object
    • .name: string
    • .navigation_only=false: boolean
    • .onrefresh: function(v:ve.FileExplorer.v, arg1_e:ve.FileExplorer)
    • .load_function: function(arg0_data:string, arg1_file_path:string) - Automatically loads the text content of a valid extension into this function.
    • .save_extension: Array<string>|string - The save dot extension that files can be loaded from. .* refers to all file extensions.
    • .save_function: function(arg0_save_file_name:string) - Returns the value of the current savedata state.
Instance:
  • .clipboard: Array<string> - The list of full file paths currently stored in the clipboard.
  • .selected: Array<string> - The list of selected file paths.
  • .v: string - Accessor. The current file path.
Methods:
  • clearClipboard()
  • deselect(arg0_file_path:string, arg1_options:{do_not_modify_classes: boolean}) | Array<string>
  • deselectAll()
  • fireSelectToggle(v:boolean, e:ve.Toggle) - Internal handler for toggling file/folder selection.
  • select(arg0_file_path:string) | Array<string>
  • selectAll()
  • setClipboard() - Sets the clipboard to currently selected file paths.
  • refresh() - Refreshes the current ve.FileExplorer display. Handled automatically.
  • getFiles(arg0_file_paths:Array<string>) | Array<string> - Returns all the subpaths in the set of file/folder paths given.
  • copy(arg0_file_paths:Array<string>, arg1_file_path:string, arg2_function:function) - Opens a copy files modal with a callback function.
  • delete(arg0_file_paths:Array<string>, arg1_file_path:string, arg2_function:function) - Opens a delete files modal with a callback function.
  • move(arg0_file_paths:Array<string>, arg1_file_path:string, arg2_function:function) - Opens a move files modal with a callback function.
  • rename(arg0_file_path:string, arg1_function:function) - Opens a rename file modal with a callback function.

Extends

Members

v :string

Returns the present file path.

  • Accessor of ve.FileExplorer
Source:
Type:
  • string

v

Sets the present file path.

  • Accessor of ve.FileExplorer
Source:

clipboard :Array.<string>

Contains all file paths currently in the clipboard.

  • Field of: ve.FileExplorer
Source:
Type:

from_binding

Internal .from_binding setter for handling .options.from_binding. Accepts a string literal that is then parsed to a variable reference.

.to_binding counterparts are manually handled child-side.

Overrides:
Source:

limit

Tests the current this.limit by calling this.limit_function(this.v, this). Otherwise resolves to true if no .options.limit is set.

Overrides:
Source:

name

Returns the visual name of the present ve.Component,

Overrides:
Source:

selected :Array.<string>

Contains all currently selected file paths.

  • Field of: ve.FileExplorer
Source:
Type:

Methods

#copy(arg0_file_paths, arg1_file_path, arg2_function)

Copies specific file paths in arg0_file_paths to arg1_file_path.

  • Method of: ve.FileExplorer
Source:
Parameters:
Name Type Description
arg0_file_paths Array.<string>

The file paths to copy.

arg1_file_path string

Where to copy the file paths to.

arg2_function function

Callback function once the copy operation is finished.

#delete(arg0_file_paths, arg1_function)

Deletes selected file paths in arg0_file_paths recursively with error logging.

  • Method of: ve.FileExplorer
Source:
Parameters:
Name Type Description
arg0_file_paths Array.<string>

The file paths to delete.

arg1_function function

Callback function once the delete operation is finished.

#getFiles(arg0_file_paths) → {Array.<string>}

Returns all the subpaths in the set of file/folder paths given.

  • Method of: ve.FileExplorer
Source:
Parameters:
Name Type Description
arg0_file_paths Array.<string>
Returns:
Type:
Array.<string>

#move(arg0_file_paths, arg1_file_path, arg2_function)

Moves files from selected file paths in arg0_file_paths to arg1_file_path.

  • Method of: ve.FileExplorer
Source:
Parameters:
Name Type Description
arg0_file_paths Array.<string>

The file paths to move.

arg1_file_path string

The folder path to move to.

arg2_function function

Callback function once the move operation is finished.

#rename(arg0_file_path, arg1_function)

Creates a modal for renaming a specific file path in arg0_file_path.

  • Method of: ve.FileExplorer
Source:
Parameters:
Name Type Description
arg0_file_path string

The file path to rename.

arg1_function function

Callback function after the rename operation is complete.

clearClipboard()

Clears the present keyboard.

  • Method of ve.FileExplorer
Source:

deselect(arg0_file_path, arg1_optionsopt)

Deselects a specific file path and removes it from this.selected.

  • Method of ve.FileExplorer
Source:
Parameters:
Name Type Attributes Description
arg0_file_path string
arg1_options Object <optional>
Name Type Attributes Default Description
do_not_modify_classes boolean <optional>
false
Returns:

string[]

deselectAll()

Deselects all file paths, clearing this.selected.

  • Method of ve.FileExplorer
Source:

fireSelectToggle(v, e)

Fires a select toggle element for the full path.

  • Method of: ve.FileExplorer
Source:
Parameters:
Name Type Description
v string
e ve.FileExplorer

refresh()

Refreshes the current file explorer path, rerendering the display for folders and files within the Component.

  • Method of: ve.FileExplorer
Source:

select(arg0_file_path)

Selects a specific file path, then returns this.selected.

  • Method of ve.FileExplorer
Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:

string[]

selectAll()

Selects all file paths in the current folder being navigated.

  • Method of ve.FileExplorer
Source:

setClipboard()

Sets the clipboard to the current selection.

  • Method of ve.FileExplorer
Source:

addComponent()

Adds the current component to this.parent_el should it exist.

Overrides:
Source:

bind(arg0_container_el)

Manually binds/mounts the present ve.Component into the visual DOM.

Overrides:
Source:
Parameters:
Name Type Description
arg0_container_el HTMLElement

fireFromBinding()

Pseudo-setter from binding. Fires only upon program-driven changes to .v directly, which means that this has to be monitored manually component-side in set v(). This should always come last in set v().

Overrides:
Source:

fireToBinding()

Pseudo-setter to binding. Fires only upon user-driven changes, which means that this has to be monitored manually component-side.

Overrides:
Source:

remove()

Removes the component/element from the DOM.

Overrides:
Source:

removeComponent()

Removes the current component from this.parent_el should it exist.

Overrides:
Source:

setOwner(arg0_value, arg1_owner_array)

Sets the root parent and ownership tree. Influences this.parent_el, this.owner, this.owners.

Overrides:
Source:
Parameters:
Name Type Description
arg0_value
arg1_owner_array

setValueFromObject(arg0_object, arg1_object)

Destructures Object values and transfers them into the .v instance fields of each Vercengen component.

Overrides:
Source:
Parameters:
Name Type Description
arg0_object Object

The Vercengen object to transfer to.

arg1_object Object

The other object to transfer from.