A Document instance which should be managed by this form.
Optional
options: 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
Static
INTERSECTION_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.
Static
OWNERSHIP_Icons for page ownership.
Static
RENDER_The sequence of rendering states that track the Application life-cycle.
Static
VIEW_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
Static
defaultProtected
Static
_customProtected
An 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?
Internal
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
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.
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
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
Internal
Additional 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
Internal
Handle application minimization behavior - collapsing content and reducing the size of the header
Optional
force: booleanOptional
options: {Optional
anchor?: stringRender the sheet with the given anchor for the given page in view.
Optional
collapsed?: booleanRender the sheet with the TOC sidebar collapsed?
Optional
mode?: numberRender the sheet in a given view mode, see JournalSheet.VIEW_MODES.
Optional
pageId?: stringRender the sheet with the page with the given ID in view.
Optional
pageIndex?: numberRender the sheet with the page at the given index in view.
Optional
tempOwnership?: booleanWhether the journal entry or one of its pages is being shown to players who might otherwise not have permission to view it.
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
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.
Optional
anchor: 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.
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
Handle saving the content of a specific editor by name
The named editor to save
Optional
options: { preventRender?: boolean; remove?: boolean } = {}Optional
preventRender?: booleanPrevent normal re-rendering of the sheet after saving.
Optional
remove?: 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
Optional
options: 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
_activateProtected
Activate an editor instance present within the form
The element which contains the editor
Protected
_activateProtected
Activate listeners after page content has been injected.
Protected
_activateProtected
Highlights the currently viewed page in the sidebar.
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
Test 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
_configureProtected
Configure ProseMirror plugins for this sheet.
The name of the editor.
Optional
options: { remove?: boolean } = {}Additional options to configure the plugins.
Optional
remove?: booleanWhether the editor should destroy itself on save.
Protected
_createProtected
Create an ID link button in the document sheet header which displays the document ID and copies to clipboard
Protected
_createProtected
Create objects for managing the functionality of secret blocks within this Document's content.
Protected
_disableProtected
If the form is not editable, disable its input fields
The form HTML
Protected
_getProtected
Identify 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
Optional
pageId?: stringThe ID of a page to render
Optional
pageIndex?: numberA numbered index of page to render
The currently displayed page index
Protected
_getProtected
Get 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
_getProtected
Get the HTML content that a given secret block is embedded in.
The secret block.
Protected
_getProtected
Get 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
_observeProtected
Create 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
_observeProtected
Create an intersection observer to maintain a list of pages that are in view.
Protected
_onProtected
Handle clicking the previous and next page buttons.
The button click event.
Protected
_onProtected
Handle the change of a color picker input which enters it's chosen value into a related input field
The color picker change event
Protected
_onProtected
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.
The initial change event
Protected
_onProtected
Handle changes to a range type input by propagating those changes to the sibling range-value element
The initial change event
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
Handle clicking an image to pop it out for fullscreen view.
The click event.
Protected
_onProtected
Handle clicking an entry in the sidebar to scroll that heading into view.
The originating click event.
Protected
_onProtected
Handle requests to configure the default sheet used by this Document
Protected
_onProtected
Handle closing the context menu.
The element the context menu has been triggered for.
Protected
_onProtected
Handle opening the context menu.
The element the context menu has been triggered for.
Protected
_onProtected
Callback actions which occur when a dragged element is over a drop target.
The originating DragEvent
Protected
_onProtected
Handle changing a Document's image.
The click event.
Protected
_onProtected
Edit one of this JournalEntry's JournalEntryPages.
The originating page edit event.
Protected
_onProtected
Handle new pages scrolling into view.
An Array of elements that have scrolled into or out of view.
The IntersectionObserver that invoked this callback.
Protected
_onProtected
Handle standard form submission steps
The submit event which triggered this handler
Optional
preventClose?: booleanOverride the standard behavior of whether to close the form on submit
Optional
preventRender?: booleanPrevent the application from re-rendering as a result of form submission
Optional
updateData?: 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
_renderProtected
Render the page view for an app v1 page sheet.
The existing page element in the journal entry view.
The page sheet.
Protected
_renderProtected
Add 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
_renderProtected
Render the page view for a page sheet.
The existing page element in the journal entry view.
The page sheet.
Protected
_renderProtected
Update child views inside the main sheet.
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
_synchronizeProtected
If 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
_updateProtected
Update the disabled state of the previous and next page buttons.
Protected
_updateProtected
Update the HTML content that a given secret block is embedded in.
The secret block.
The new content.
The updated Document.
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.
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