An object of dialog data which configures how the modal window is rendered
Optional
options: ApplicationV1Options & DialogV1OptionsDialog rendering options, see foundry.appv1.api.Application.
Internal
_dragDragDrop workflow handlers which are active for this Application
Internal
_elementAn internal reference to the HTML element this application renders
Internal
_minimizedTrack whether the Application is currently minimized
Internal
_scrollTrack the most recent scroll positions for any vertically scrolling containers
Internal
_searchSearchFilter handlers which are active for this Application
Internal
_tabsTab navigation handlers which are active for this Application
The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT
The options provided to this application upon initialization
Track the current position and dimensions of the Application UI
Protected
_priorThe prior render state of this Application. This allows for rendering logic to understand if the application is being rendered for the first time.
Protected
_stateThe current render state of the Application
Static
RENDER_The sequence of rendering states that track the Application life-cycle.
Whether the Application is currently closing.
Return the active application element, if it currently exists in the DOM
Return the CSS application ID which uniquely references this UI element
Control the rendering style of the application. If popOut is true, the application is rendered in its own wrapper window, otherwise only the inner app content is rendered
Return a flag for whether the Application instance is currently rendered
The path to the HTML template file which should be used to render the inner content of the app
An Application window should define its own title definition logic which may be dynamic depending on its data
Static
defaultInternal
Create a foundry.applications.ux.ContextMenu for this Application.
The Application's HTML.
Internal
Create drag-and-drop workflow handlers for this Application
An array of DragDrop handlers
Internal
Create search filter handlers for this Application
An array of SearchFilter handlers
Internal
Create tabbed navigation handlers for this Application
An array of Tabs handlers
Internal
Customize how a new HTML Application is added and first appears in the DOM
The HTML element which is ready to be added to the DOM
Internal
Additional actions to take when the application window is resized
Internal
Handle application minimization behavior - collapsing content and reducing the size of the header
Internal
Render the inner application content
The data used to render the inner template
A promise resolving to the constructed jQuery object
Render the outer application wrapper
A promise resolving to the constructed jQuery object
Internal
Customize how inner HTML is replaced when the application is refreshed
The original HTML processed as a jQuery object
New updated HTML as a jQuery object
After rendering, activate event listeners which provide interactivity for the Application. This is where user-defined Application subclasses should attach their event-handling logic.
Change the currently active tab
The target tab name to switch to
Options which configure changing the tab
A specific named tab group, useful if multiple sets of tabs are present
Whether to trigger tab-change callback functions
A convenience alias for bringToTop for when operating on an object that is either an Application or an ApplicationV2
Bring the application to the top of the rendering stack
Close the application and un-register references to it within UI mappings This function returns a Promise which resolves once the window closing animation concludes
Options which affect how the Application is closed
A Promise which resolves once the application is closed
An application should define the data object used to render its template. This function may either return an Object directly, or a Promise which resolves to an Object If undefined, the default implementation will return an empty object allowing only for rendering of static HTML
Maximize the pop-out window, expanding it to its original size Take no action for applications which are not of the pop-out variety or are already maximized
A Promise which resolves once the maximization action has completed
Minimize the pop-out window, collapsing it to a small tab Take no action for applications which are not of the pop-out variety or apps which are already minimized
A Promise which resolves once the minimization action has completed
Render the Application by evaluating its HTML template against the object of data provided by the getData method If the Application is rendered as a pop-out window, wrap the contained HTML in an outer frame with window controls
Add the rendered application to the DOM if it is not already present. If false, the Application will only be re-rendered if it is already present.
Additional rendering options which are applied to customize the way that the Application is rendered in the DOM.
Optional
focus?: booleanApply focus to the application, maximizing it and bringing it to the top of the vertical stack.
Optional
height?: numberThe rendered height
Optional
left?: numberThe left positioning attribute
Optional
renderContext?: stringA context-providing string which suggests what event triggered the render
Optional
renderData?: objectThe data change which motivated the render request
Optional
scale?: numberThe rendered transformation scale
Optional
top?: numberThe top positioning attribute
Optional
width?: numberThe rendered width
The rendered Application instance
Set the application position and store its new location. Returns the updated position object for the application containing the new values.
Positional data
The application height in pixels
The left offset position in pixels
The application scale as a numeric factor where 1.0 is default
The top offset position in pixels
The application width in pixels
Submit the Dialog by selecting one of its buttons.
The configuration of the chosen button
The originating click event
Protected
_activateProtected
Activate required listeners which must be enabled on every Application. These are internal interactions which should not be overridden by downstream subclasses.
Protected
_callProtected
Call all hooks for all applications in the inheritance chain.
The hook being triggered, which formatted with the Application class name
The arguments passed to the hook calls
Protected
_canProtected
Define whether a user is able to conclude a drag-and-drop workflow for a given drop selector
The candidate HTML selector for the drop target
Can the current user drop on this selector?
Protected
_canProtected
Define whether a user is able to begin a dragstart workflow for a given drag selector
The candidate HTML selector for dragging
Can the current user drag this selector?
Protected
_getProtected
Specify the set of config buttons which should appear in the Application header. Buttons should be returned as an Array of objects. The header buttons which are added to the application can be modified by the getApplicationV1HeaderButtons hook.
Protected
_onProtected
Handle changes to the active tab in a configured Tabs controller
A left click event
The Tabs controller
The new active tab name
Protected
_onProtected
Callback actions which occur when a dragged element is over a drop target.
The originating DragEvent
Protected
_onProtected
Callback actions which occur at the beginning of a drag start workflow.
The originating DragEvent
Protected
_onProtected
Callback actions which occur when a dragged element is dropped on a target.
The originating DragEvent
Protected
_onProtected
Handle a keydown event while the dialog is active
The keydown event
Protected
_onProtected
Handle changes to search filtering controllers which are bound to the Application
The key-up event from keyboard input
The raw string input to the search field
The regular expression to test against
The HTML element which should be filtered
Protected
_renderProtected
An asynchronous inner function which handles the rendering of the Application
Render and display the application even if it is not currently displayed.
Additional options which update the current values of the Application#options object
A Promise that resolves to the Application once rendering is complete
Protected
_restoreProtected
Restore the scroll positions of containers within the app after re-rendering the content
The HTML object being traversed
Protected
_saveProtected
Persist the scroll positions of containers within the app before re-rendering the content
The HTML object being traversed
Protected
_waitProtected
Wait for any images present in the Application to load.
A Promise that resolves when all images have loaded.
Static
_getInternal
Return the inheritance chain for this Application class up to (and including) it's base Application class.
Static
confirmA helper factory method to create simple confirmation dialog windows which consist of simple yes/no prompts. If you require more flexibility, a custom Dialog instance is preferred.
Optional
config: DialogData & DialogV1ConfirmOptions = {}Dialog configuration options
A promise which resolves once the user makes a choice or closes the window
Static
promptA helper factory method to display a basic "prompt" style Dialog with a single button
Optional
config: any = {}Dialog configuration options
The returned value from the provided callback function, if any
Static
waitWrap the Dialog with an enclosing Promise which resolves or rejects when the client makes a choice.
Optional
data: DialogData = {}Data passed to the Dialog constructor.
Optional
options: ApplicationV1Options & DialogV1Options = {}Options passed to the Dialog constructor.
Optional
renderOptions: object = {}Options passed to the Dialog render call.
A Promise that resolves to the chosen result.
Create a dialog window displaying a title, a message, and a set of buttons which trigger callback functions.
Example: Constructing a custom dialog instance
Deprecated
since v13