Optionaloptions: any = {}Options that configure the behavior of the FilePicker
Track the active source tab which is being browsed
A button controlling the display of the picker UI
A callback function to trigger once a file has been selected
The display mode of the FilePicker UI
The current set of file extensions which are being filtered upon
The target HTML element this file picker is bound to
Application instance configuration options.
The current position of the application with respect to the window.document.body.
The full requested path given by the user
The latest set of results browsed from the server
The file sources available for browsing
If this Application uses tabbed navigation groups, this mapping is updated whenever the changeTab method is called.
Reports the active tab for each group, with a value of null indicating no tab is active.
Subclasses may override this property to define default tabs for each group.
The general file type which controls the set of extensions which will be accepted
Static Internal_appAn incrementing integer Application ID.
Static Internal_maxZThe current maximum z-index of any displayed Application.
StaticBASE_Designates which upstream Application class in this class' inheritance chain is the base application. Any DEFAULT_OPTIONS of super-classes further upstream of the BASE_APPLICATION are ignored. Hook events for super-classes further upstream of the BASE_APPLICATION are not dispatched.
StaticDEFAULT_StaticDISPLAY_Enumerate the allowed FilePicker display modes
StaticemittedStaticFILE_The allowed values for the type of this FilePicker instance.
StaticLAST_Record the last-browsed directory path so that re-opening a different FilePicker instance uses the same target
StaticLAST_Record the last-configured display mode so that re-opening a different FilePicker instance uses the same mode.
StaticLAST_Record the last-configured tile size which can automatically be applied to new FilePicker instances
StaticPARTSStaticRENDER_The sequence of rendering states that describe the Application life-cycle.
StaticS3_Cache the names of S3 buckets which can be used
StaticTABSWhether the current user is able to create folders.
Whether the current use is able to upload file content.
The CSS class list of this Application instance
The HTMLElement which renders this Application into the DOM.
Get favorite folders for quick access
Does this Application have a top-level form element?
Does this Application instance render within an outer window frame?
The HTML element ID of this Application instance.
This provides a readonly view into the internal ID used by this application.
This getter should not be overridden by subclasses, which should instead configure the ID in DEFAULT_OPTIONS or
by defining a uniqueId during _initializeApplicationOptions.
Is this Application instance currently minimized?
Is this Application instance currently rendered?
Return the source object for the currently active source
The current render state of the Application.
Return the target directory for the currently active source
Convenience references to window header elements.
StaticimplementationRetrieve the configured FilePicker implementation.
StaticuploadURLReturn the upload URL to which the FilePicker should post uploaded files
InternalWait for a CSS transition to complete for an element.
The element which is transitioning
A timeout in milliseconds in case the transitionend event does not occur
InternalPerform an event in the application life-cycle. Await an internal life-cycle method defined by the class. Optionally dispatch an event for any registered listeners.
A handler function to call
Options which configure event handling
Optionalasync?: booleanAwait the result of the handler function?
OptionaldebugText?: stringDebugging text to log for the event
OptionaleventName?: stringAn event name to dispatch for registered listeners
OptionalhandlerArgs?: any[]Arguments passed to the handler function
OptionalhookArgs?: any[]Arguments passed to the requested hook function
OptionalhookName?: stringA hook name to dispatch for this and all parent classes
OptionalhookResponse?: booleanAdd the handler response to hookArgs
OptionalparentClassHooks?: booleanCall hooks for parent classes in the inheritance chain?
A promise which resoles once the handler is complete if async is true
Abstract_renderHTMLRender an HTMLElement for the Application. An Application subclass must implement this method in order for the Application to be renderable.
Context data for the render operation
Options which configure application rendering behavior
The result of HTML rendering may be implementation specific. Whatever value is returned here is passed to _replaceHTML
Add a new event listener for a certain type of event.
The type of event being registered for
The listener function called when the event occurs
Optionaloptions: { once?: boolean } = {}Options which configure the event listener
Optionalonce?: booleanShould the event only be responded to once and then removed
Bring this Application window to the front of the rendering stack by increasing its z-index. Once ApplicationV1 is deprecated we should switch from _maxZ to ApplicationV2#maxZ We should also eliminate ui.activeWindow in favor of only ApplicationV2#frontApp
Browse to a specific location for this FilePicker instance
Optionaltarget: string = ...The target within the currently active source location.
Optionaloptions: object = {}Browsing options
Close the Application, removing it from the DOM.
Optionaloptions: Partial<ApplicationClosingOptions> = {}Options which modify how the application is closed.
A Promise which resolves to the closed Application instance
Dispatch an event on this target.
The Event to dispatch
Was default behavior for the event prevented?
Restore the Application to its original dimensions.
Minimize the Application, collapsing it to a minimal header.
Remove an event listener for a certain type of event.
The type of event being removed
The listener function being removed
Update the Application element position using provided data which is merged with the prior position.
Optionalposition: Partial<ApplicationPosition>New Application positioning data
The updated application position
Programmatically submit an ApplicationV2 instance which implements a single top-level form.
OptionalsubmitOptions: object = {}Arbitrary options which are supported by and provided to the configured form submission handler.
A promise that resolves to the returned result of the form submission handler, if any.
Toggle display of the Application controls menu. Only applicable to window Applications.
Optionalexpanded: booleanSet the controls visibility to a specific state. Otherwise, the visible state is toggled from its current value
Optionaloptions: { animate?: boolean } = {}Options to configure the toggling behavior.
Optionalanimate?: booleanAnimate the controls toggling.
A Promise which resolves once the control expansion animation is complete
Protected_attachProtectedAttach event listeners to the Application frame.
Protected_canProtectedTest whether this Application is allowed to be rendered.
Provided render options
Return false to prevent rendering
Protected_configureProtectedModify the provided options passed to a render request.
Options which configure application rendering behavior
Protected_createProtectedCreate a ContextMenu instance used in this Application.
A handler function that provides initial context options
A CSS selector to which the ContextMenu will be bound
Optionaloptions: { container?: HTMLElement; hookName?: string; parentClassHooks?: boolean } = {}Additional options which affect ContextMenu construction
Optionalcontainer?: HTMLElementA parent HTMLElement which contains the selector target
OptionalhookName?: stringThe hook name
OptionalparentClassHooks?: booleanWhether to call hooks for the parent classes in the inheritance chain.
A created ContextMenu or null if no menu items were defined
Protected_getProtectedConfigure the array of header control menu options
Protected_getProtectedGet the configuration for a tabs group.
The ID of a tabs group
Protected_headerProtectedIterate over header control buttons, filtering for controls which are visible for the current client.
Protected_inferProtectedGiven a current file path, determine the directory to which it belongs.
The currently requested target path
A tuple of the inferred source and target directory path
Protected_initializeProtectedInitialize configuration options for the Application instance. The default behavior of this method is to intelligently merge options for each class with those of their parents.
Options provided directly to the constructor
Configured options for the application instance
Protected_insertProtectedInsert the application HTML element into the DOM. Subclasses may override this method to customize how the application is inserted.
The element to insert
Protected_onProtectedHandle changes to an input element within the form.
The form configuration for which this handler is bound
An input change event within the form
Protected_onProtectedHandle changes to the tile size.
The triggering event.
Protected_onProtectedA generic event handler for action clicks which can be extended by subclasses. Action handlers defined in DEFAULT_OPTIONS are called first. This method is only called for actions which have no defined handler.
The originating click event
The capturing HTML element which defined a [data-action]
Protected_onProtectedHandle click events on a tab within the Application.
Protected_onProtectedActions performed after closing the Application. Post-close steps are not awaited by the close process.
Provided render options
Protected_onProtectedActions performed after a first render of the Application.
Prepared context data
Provided render options
Protected_onProtectedActions performed after the Application is re-positioned.
The requested application position
Protected_onProtectedSearch among shown directories and files.
The triggering event
The search input value
Protected_onProtectedHandle submission for an Application which uses the form element.
The form configuration for which this handler is bound
The form submission event
Protected_postProtectedPerform post-render finalization actions.
Prepared context data.
Provided render options.
Protected_preProtectedActions performed before closing the Application. Pre-close steps are awaited by the close process.
Provided render options
Protected_preProtectedActions performed before a first render of the Application.
Prepared context data
Provided render options
Protected_preProtectedActions performed before the Application is re-positioned. Pre-position steps are not awaited because setPosition is synchronous.
The requested application position
Protected_preProtectedActions performed before any render of the Application. Pre-render steps are awaited by the render process.
Prepared context data
Provided render options
Protected_removeProtectedRemove the application HTML element from the DOM. Subclasses may override this method to customize how the application element is removed.
The element to be removed
Protected_renderProtectedRender the outer framing HTMLElement which wraps the inner HTML of the Application.
Options which configure application rendering behavior
Protected_renderProtectedRender a header control button.
Protected_replaceHTMLProtectedReplace the HTML of the application with the result provided by the rendering backend. An Application subclass should implement this method in order for the Application to be renderable.
The result returned by the application rendering backend
The content element into which the rendered result must be inserted
Options which configure application rendering behavior
Protected_updateProtectedWhen the Application is rendered, optionally update aspects of the window frame.
Options provided at render-time
Protected_updateProtectedTranslate a requested application position updated into a resolved allowed position for the Application. Subclasses may override this method to implement more advanced positioning behavior.
Requested Application positioning data
Resolved Application positioning data
StaticbrowseBrowse files for a certain directory location
The source location in which to browse: see FilePicker#sources for details.
The target within the source location
Optional arguments
Optionalbucket?: stringA bucket within which to search if using the S3 source
Optionalextensions?: string[]An Array of file extensions to filter on
Optionalwildcard?: booleanThe requested dir represents a wildcard path
A Promise that resolves to the directories and files contained in the location
StaticconfigureConfigure metadata settings regarding a certain file system path
The source location in which to browse: see FilePicker#sources for details.
The target within the source location
Optional arguments modifying the request
StaticcreateCreate a subdirectory within a given source. The requested subdirectory path must not already exist.
The source location in which to browse. See FilePicker#sources for details
The target within the source location
Optional arguments which modify the request
StaticfromBind the file picker to a new target field. Assumes the user will provide a HTMLButtonElement which has the data-target and data-type attributes The data-target attribute should provide the name of the input field which should receive the selected file The data-type attribute is a string in ["image", "audio"] which sets the file extensions which will be accepted
The button element
StaticinheritanceIterate over the inheritance chain of this Application. The chain includes this Application itself and all parents until the base application is encountered.
StaticmatchTest a URL to see if it matches a well known s3 key pattern
An input URL to test
A regular expression match
StaticparseCSSDimensionParse a CSS style rule into a number of pixels which apply to that dimension.
The CSS style rule
The relevant dimension of the parent element
The parsed style dimension in pixels
StaticrequestRequest wildcard token images from the server and return them.
The actor whose prototype token contains the wildcard image path.
Optionaloptions: { pack?: string } = {}Optionalpack?: stringThe ID of the compendium the actor is in.
StaticuploadDispatch a POST request to the server containing a directory path and a file to upload
The data source to which the file should be uploaded
The destination path
The File object to upload
Optionalbody: object = {}Additional file upload options sent in the POST body
Optionaloptions: { notify?: boolean } = {}Additional options to configure how the method behaves
Optionalnotify?: booleanDisplay a UI notification when the upload is processed
The response object
StaticuploadA convenience function that uploads a file to a given package's persistent /storage/ directory
The id of the package to which the file should be uploaded. Only supports Systems and Modules.
The relative destination path in the package's storage directory
The File object to upload
Optionalbody: object = {}Additional file upload options sent in the POST body
Optionaloptions: { notify?: boolean } = {}Additional options to configure how the method behaves
Optionalnotify?: booleanDisplay a UI notification when the upload is processed
The response object
StaticwaitWait for any images in the given element to load.
The element.
The FilePicker application renders contents of the server-side public directory. This app allows for navigating and uploading files to the public path.
Mixes
HandlebarsApplication