UserConfig

UserConfig

The Application responsible for configuring a single User document.

Constructor

new UserConfig(user, optionsopt)

Parameters:
Name Type Attributes Description
user User

The User entity being configured.

options object <optional>

Additional rendering options which modify the behavior of the form.

Extends

Members

(static) defaultOptions

_dragDrop :Array.<DragDrop>

Inherited From:

DragDrop workflow handlers which are active for this Application

Type:

_element :jQuery

Inherited From:

An internal reference to the HTML element this application renders

Type:
  • jQuery

_minimized :boolean

Inherited From:

Track whether the Application is currently minimized

Type:
  • boolean

(protected) _priorState :number

Inherited From:
See:
  • {Application.RENDER_STATES}

The prior render state of this Application. This allows for rendering logic to understand if the application is being rendered for the first time.

Type:
  • number

_scrollPositions :Object|null

Inherited From:

Track the most recent scroll positions for any vertically scrolling containers

Type:
  • Object | null

_searchFilters :Array.<SearchFilter>

Inherited From:

SearchFilter handlers which are active for this Application

Type:

(protected) _state :number

Inherited From:
See:
  • {Application.RENDER_STATES}

The current render state of the Application

Type:
  • number

_tabs :Array.<Tabs>

Inherited From:

Tab navigation handlers which are active for this Application

Type:

appId :number

Inherited From:

The application ID is a unique incrementing integer which is used to identify every application window drawn by the VTT

Type:
  • number

editors :Object.<string, object>

Inherited From:

Keep track of any mce editors which may be active as part of this form The values of this object are inner-objects with references to the MCE editor and other metadata

Type:
  • Object.<string, object>

element :jQuery|HTMLElement

Inherited From:

Return the active application element, if it currently exists in the DOM

Type:
  • jQuery | HTMLElement

filepickers :Array.<FilePicker>

Inherited From:

Keep track of any FilePicker instances which are associated with this form The values of this Array are inner-objects with references to the FilePicker instances and other metadata

Type:

form :HTMLElement

Inherited From:

A convenience reference to the form HTMLElement

Type:
  • HTMLElement

id :string

Inherited From:

Return the CSS application ID which uniquely references this UI element

Type:
  • string

isEditable :boolean

Inherited From:

Is the Form Application currently editable?

Type:
  • boolean

object :*

Inherited From:

The object target which we are using this form to modify

Type:
  • *

options :Object

Inherited From:

The options provided to this application upon initialization

Type:
  • Object

popOut :boolean

Inherited From:

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

Type:
  • boolean

position :Object

Inherited From:

Track the current position and dimensions of the Application UI

Type:
  • Object

RENDER_STATES :number

Inherited From:

The sequence of rendering states that track the Application life-cycle.

Type:
  • number

rendered :boolean

Inherited From:

Return a flag for whether the Application instance is currently rendered

Type:
  • boolean

template :string

Inherited From:

The path to the HTML template file which should be used to render the inner content of the app

Type:
  • string

title :string

Overrides:

An Application window should define its own title definition logic which may be dynamic depending on its data

Type:
  • string

Methods

(protected) _activateEditor(div)

Inherited From:

Activate a TinyMCE editor instance present within the form

Parameters:
Name Type Description
div HTMLElement

The element which contains the editor

(protected) _activateFilePicker(event)

Inherited From:

Activate a FilePicker instance present within the form

Parameters:
Name Type Description
event PointerEvent

The mouse click event on a file picker activation button

(protected) _disableFields(form)

Inherited From:

If the form is not editable, disable its input fields

Parameters:
Name Type Description
form HTMLElement

The form HTML

(protected) _getFilePickerOptions(event) → {object}

Inherited From:

Determine the configuration options used to initialize a FilePicker instance within this FormApplication. Subclasses can extend this method to customize the behavior of pickers within their form.

Parameters:
Name Type Description
event PointerEvent

The initiating mouse click event which opens the picker

Returns:

Options passed to the FilePicker constructor

Type
object

(protected) _getSubmitData(updateData) → {object}

Inherited From:

Get an object of update data used to update the form's target object

Parameters:
Name Type Description
updateData object

Additional data that should be merged with the form data

Returns:

The prepared update data

Type
object

(protected) _onChangeColorPicker()

Inherited From:

Handle the change of a color picker input which enters it's chosen value into a related input field

(async, protected) _onChangeInput(event)

Inherited From:

Handle changes to an input element, submitting the form if options.submitOnChange is true. Do not preventDefault in this handler as other interactions on the form may also be occurring.

Parameters:
Name Type Description
event Event

The initial change event

(protected) _onChangeRange(event)

Inherited From:

Handle changes to a range type input by propagating those changes to the sibling range-value element

Parameters:
Name Type Description
event Event

The initial change event

(protected) _onSelectFile(selection, filePicker)

Inherited From:

Additional handling which should trigger when a FilePicker contained within this FormApplication is submitted.

Parameters:
Name Type Description
selection string

The target path which was selected

filePicker FilePicker

The FilePicker instance which was submitted

(async, protected) _onSubmit(event, updateDataopt, preventCloseopt, preventRenderopt) → {Promise}

Inherited From:

Handle standard form submission steps

Parameters:
Name Type Attributes Description
event Event

The submit event which triggered this handler

updateData Object | null <optional>

Additional specific data keys/values which override or extend the contents of the parsed form. This can be used to update other flags or data fields at the same time as processing a form submission to avoid multiple database operations.

preventClose boolean <optional>

Override the standard behavior of whether to close the form on submit

preventRender boolean <optional>

Prevent the application from re-rendering as a result of form submission

Returns:

A promise which resolves to the validated update data

Type
Promise

(async, abstract) _updateObject(event, formData) → {Promise}

Inherited From:

This method is called upon form submission after form data is validated

Parameters:
Name Type Description
event Event

The initial triggering submission event

formData object

The object of validated form data with which to update the object

Returns:

A Promise which resolves once the update operation has completed

Type
Promise

activateEditor(name, options, initialContent)

Inherited From:

Activate a named TinyMCE text editor

Parameters:
Name Type Description
name string

The named data field which the editor modifies.

options object

TinyMCE initialization options passed to TextEditor.create

initialContent string

Initial text content for the editor area.

bringToTop()

Inherited From:

Bring the application to the top of the rendering stack

(async) maximize() → {Promise.<void>}

Inherited From:

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

Returns:

A Promise which resolves once the maximization action has completed

Type
Promise.<void>

(async) minimize() → {Promise.<void>}

Inherited From:

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

Returns:

A Promise which resolves once the minimization action has completed

Type
Promise.<void>

render(force, options) → {Application}

Inherited From:

Render the Application by evaluating it's 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

Parameters:
Name Type Default Description
force boolean false

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.

options Object

Additional rendering options which are applied to customize the way that the Application is rendered in the DOM.

Properties
Name Type Attributes Default Description
left number <optional>

The left positioning attribute

top number <optional>

The top positioning attribute

width number <optional>

The rendered width

height number <optional>

The rendered height

scale number <optional>

The rendered transformation scale

focus boolean <optional>
false

Apply focus to the application, maximizing it and bringing it to the top of the vertical stack.

renderContext string <optional>

A context-providing string which suggests what event triggered the render

renderData object <optional>

The data change which motivated the render request

Returns:

The rendered Application instance

Type
Application

(async) saveEditor(name, removeopt) → {Promise.<void>}

Inherited From:

Handle saving the content of a specific editor by name

Parameters:
Name Type Attributes Description
name string

The named editor to save

remove boolean <optional>

Remove the editor after saving its content

Returns:
Type
Promise.<void>

setPosition(left, top, width, height, scale) → {Object}

Inherited From:

Set the application position and store it's new location.

Parameters:
Name Type Description
left number | null

The left offset position in pixels

top number | null

The top offset position in pixels

width number | null

The application width in pixels

height number | string | null

The application height in pixels

scale number | null

The application scale as a numeric factor where 1.0 is default

Returns:

The updated position object for the application containing the new values

Type
Object

(async) submit(optionsopt) → {FormApplication}

Inherited From:

Submit the contents of a Form Application, processing its content as defined by the Application

Parameters:
Name Type Attributes Description
options object <optional>

Options passed to the _onSubmit event handler

Returns:

Return a self-reference for convenient method chaining

Type
FormApplication