A Document instance which should be managed by this form.
Optionaloptions: any = {}Optional configuration parameters for how the form behaves.
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
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
A convenience reference to the form HTMLElement
The object target which we are using this form to modify
The options provided to this application upon initialization
Track the current position and dimensions of the Application UI
Protected_pagesThe cached list of processed page entries. This array is populated in the getData method.
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_secretsThe list of handlers for secret block functionality.
Protected_stateThe current render state of the Application
StaticINTERSECTION_The minimum amount of content that must be visible before the next page is marked as in view. Cannot be less than 25% without also modifying the IntersectionObserver threshold.
StaticOWNERSHIP_Icons for page ownership.
StaticRENDER_The sequence of rendering states that track the Application life-cycle.
StaticVIEW_Available view modes for journal entries.
Whether the Application is currently closing.
A semantic convenience reference to the Document instance which is the target object for this form.
Return the active application element, if it currently exists in the DOM
Return the CSS application ID which uniquely references this UI element
Is the Form Application currently editable?
The currently active IntersectionObserver.
The index of the currently viewed page.
The pages that are currently scrolled into view and marked as 'active' in the sidebar.
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 current search mode for this journal
Is the table-of-contents sidebar currently collapsed?
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
StaticdefaultProtected Static_customProtectedAn array of custom element tag names that should be listened to for changes.
Activate required listeners which must be enabled on every Application. These are internal interactions which should not be overridden by downstream subclasses.
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?
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?
InternalCreate a foundry.applications.ux.ContextMenu for this Application.
The Application's HTML.
InternalCreate drag-and-drop workflow handlers for this Application
An array of DragDrop handlers
InternalCreate search filter handlers for this Application
An array of SearchFilter handlers
InternalCreate tabbed navigation handlers for this Application
An array of Tabs handlers
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.
InternalCustomize 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
Callback actions which occur at the beginning of a drag start workflow.
The originating DragEvent
Callback actions which occur when a dragged element is dropped on a target.
The originating DragEvent
InternalAdditional actions to take when the application window is resized
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
Handle requests to show the referenced Journal Entry to other Users Save the form before triggering the show request, in case content has changed
The triggering click event
InternalHandle application minimization behavior - collapsing content and reducing the size of the header
Optionalforce: booleanOptionaloptions: {Optionalanchor?: stringRender the sheet with the given anchor for the given page in view.
Optionalcollapsed?: booleanRender the sheet with the TOC sidebar collapsed?
Optionalmode?: numberRender the sheet in a given view mode, see JournalSheet.VIEW_MODES.
OptionalpageId?: stringRender the sheet with the page with the given ID in view.
OptionalpageIndex?: numberRender the sheet with the page at the given index in view.
OptionaltempOwnership?: booleanWhether the journal entry or one of its pages is being shown to players who might otherwise not have permission to view it.
InternalRender 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
InternalCustomize 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
This method is called upon form submission after form data is validated
The initial triggering submission event
The object of validated form data with which to update the object
A Promise which resolves once the update operation has completed
Activate a named TinyMCE text editor
The named data field which the editor modifies.
Editor initialization options passed to foundry.applications.ux.TextEditor.create.
Initial text content for the editor area.
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
Prompt the user with a Dialog for creation of a new JournalEntryPage
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
Retrieve the sheet instance for rendering this page inline.
The ID of the page.
Turn to a specific page.
The ID of the page to turn to.
Optionalanchor: stringOptionally an anchor slug to focus within that page.
Determine whether a page is visible to the current user.
The page.
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
Turn to the next page.
Turn to the previous page.
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.
Optionalfocus?: booleanApply focus to the application, maximizing it and bringing it to the top of the vertical stack.
Optionalheight?: numberThe rendered height
Optionalleft?: numberThe left positioning attribute
OptionalrenderContext?: stringA context-providing string which suggests what event triggered the render
OptionalrenderData?: objectThe data change which motivated the render request
Optionalscale?: numberThe rendered transformation scale
Optionaltop?: numberThe top positioning attribute
Optionalwidth?: numberThe rendered width
The rendered Application instance
Handle saving the content of a specific editor by name
The named editor to save
Optionaloptions: { preventRender?: boolean; remove?: boolean } = {}OptionalpreventRender?: booleanPrevent normal re-rendering of the sheet after saving.
Optionalremove?: booleanRemove the editor after saving its content
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 contents of a Form Application, processing its content as defined by the Application
Optionaloptions: object = {}Options passed to the _onSubmit event handler
Return a self-reference for convenient method chaining
Toggle the search mode for this journal between "name" and "full" text search
Toggle the collapsed or expanded state of the Journal Entry table-of-contents sidebar.
Protected_activateProtectedActivate an editor instance present within the form
The element which contains the editor
Protected_activateProtectedActivate listeners after page content has been injected.
Protected_activateProtectedHighlights the currently viewed page in the sidebar.
Protected_callProtectedCall 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_canProtectedTest whether a certain User has permission to view this Document Sheet.
The user requesting to render the sheet
Does the User have permission to view this sheet?
Protected_configureProtectedConfigure ProseMirror plugins for this sheet.
The name of the editor.
Optionaloptions: { remove?: boolean } = {}Additional options to configure the plugins.
Optionalremove?: booleanWhether the editor should destroy itself on save.
Protected_createProtectedCreate an ID link button in the document sheet header which displays the document ID and copies to clipboard
Protected_createProtectedCreate objects for managing the functionality of secret blocks within this Document's content.
Protected_disableProtectedIf the form is not editable, disable its input fields
The form HTML
Protected_getProtectedIdentify which page of the journal sheet should be currently rendered. This can be controlled by options passed into the render method or by a subclass override.
Sheet rendering options
OptionalpageId?: stringThe ID of a page to render
OptionalpageIndex?: numberA numbered index of page to render
The currently displayed page index
Protected_getProtectedGet the set of ContextMenu options which should be used for JournalEntryPages in the sidebar.
The Array of context options passed to the ContextMenu instance.
Protected_getProtected_getProtectedGet the HTML content that a given secret block is embedded in.
The secret block.
Protected_getProtectedGet an object of update data used to update the form's target object
Additional data that should be merged with the form data
The prepared update data
Protected_observeProtectedCreate an intersection observer to maintain a list of headings that are in view. This is much more performant than calling getBoundingClientRect on all headings whenever we want to determine this list.
Protected_observeProtectedCreate an intersection observer to maintain a list of pages that are in view.
Protected_onProtectedHandle clicking the previous and next page buttons.
The button click event.
Protected_onProtectedHandle the change of a color picker input which enters it's chosen value into a related input field
The color picker change event
Protected_onProtectedHandle 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.
The initial change event
Protected_onProtectedHandle changes to a range type input by propagating those changes to the sibling range-value element
The initial change event
Protected_onProtectedHandle changes to the active tab in a configured Tabs controller
A left click event
The Tabs controller
The new active tab name
Protected_onProtectedHandle clicking an image to pop it out for fullscreen view.
The click event.
Protected_onProtectedHandle clicking an entry in the sidebar to scroll that heading into view.
The originating click event.
Protected_onProtectedHandle requests to configure the default sheet used by this Document
Protected_onProtectedHandle closing the context menu.
The element the context menu has been triggered for.
Protected_onProtectedHandle opening the context menu.
The element the context menu has been triggered for.
Protected_onProtectedCallback actions which occur when a dragged element is over a drop target.
The originating DragEvent
Protected_onProtectedHandle changing a Document's image.
The click event.
Protected_onProtectedEdit one of this JournalEntry's JournalEntryPages.
The originating page edit event.
Protected_onProtectedHandle new pages scrolling into view.
An Array of elements that have scrolled into or out of view.
The IntersectionObserver that invoked this callback.
Protected_onProtectedHandle standard form submission steps
The submit event which triggered this handler
OptionalpreventClose?: booleanOverride the standard behavior of whether to close the form on submit
OptionalpreventRender?: booleanPrevent the application from re-rendering as a result of form submission
OptionalupdateData?: null | objectAdditional 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.
A promise which resolves to the validated update data
Protected_renderProtectedRender the page view for an app v1 page sheet.
The existing page element in the journal entry view.
The page sheet.
Protected_renderProtectedAdd headings to the table of contents for the given page node.
The HTML node of the page's rendered contents.
The page's table of contents.
Protected_renderProtectedRender the page view for a page sheet.
The existing page element in the journal entry view.
The page sheet.
Protected_renderProtectedUpdate child views inside the main sheet.
Protected_restoreProtectedRestore the scroll positions of containers within the app after re-rendering the content
The HTML object being traversed
Protected_saveProtectedPersist the scroll positions of containers within the app before re-rendering the content
The HTML object being traversed
Protected_synchronizeProtectedIf the set of active pages has changed, various elements in the sidebar will expand and collapse. For particularly long ToCs, this can leave the scroll position of the sidebar in a seemingly random state. We try to do our best to sync the sidebar scroll position with the current journal viewport.
Protected_updateProtectedUpdate the disabled state of the previous and next page buttons.
Protected_updateProtectedUpdate the HTML content that a given secret block is embedded in.
The secret block.
The new content.
The updated Document.
Protected_waitProtectedWait for any images present in the Application to load.
A Promise that resolves when all images have loaded.
Static_getInternalReturn the inheritance chain for this Application class up to (and including) it's base Application class.
The Application responsible for displaying and editing a single JournalEntry document.
Deprecated
since v13
Param: object
The JournalEntry instance which is being edited
Param: options
Application options