Class TJSDocumentDialog
Constructors
constructor
- new TJSDocumentDialog(): TJSDocumentDialog
Returns TJSDocumentDialog
Methods
Static
configureOwnership
- configureOwnership(
document: object,
options?: any,
dialogData?: any,
): Promise<object> Change ownership of a document by rendering a dialog to alter the default and all user / player ownership.
Parameters
- document: object
Document instance to modify.
Optional
options: anyRest of options to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<object>
The modified document or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Static
documentCreate
- documentCreate(
documentCls: object,
data?: object,
context?: {
options?: any;
pack?: object;
parent?: object;
renderSheet?: boolean;
},
dialogData?: any,
): Promise<object> Create a new Document of the type specified by
documentCls
by rendering a dialog window to provide basic creation details.Parameters
- documentCls: object
Document class to create.
Optional
data: objectDocument data.
Optional
context: { options?: any; pack?: object; parent?: object; renderSheet?: boolean }Additional context options or dialog positioning options.
Optional
options?: anyRest of options to pass to TJSDialog / Application.
Optional
pack?: objectA Compendium pack identifier within which the Documents should be modified.
Optional
parent?: objectA parent Document within which these Documents should be embedded.
Optional
renderSheet?: booleanRender the sheet for the new document.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<object>
The newly created document or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- documentCls: object
Static
documentDelete
- documentDelete(
document: object,
opts?: { context?: object; options?: any },
dialogData?: any,
): Promise<boolean | object> Shows a modal / non-draggable dialog to delete a document.
Parameters
- document: object
Document to delete.
Optional
opts: { context?: object; options?: any }Additional context options or dialog positioning options.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
The document if deleted or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Static
folderCreate
- folderCreate(
folderData: object,
options?: any,
dialogData?: any,
): Promise<object> Create a new Folder by rendering a dialog window to provide basic creation details.
Parameters
- folderData: object
Initial data with which to populate the creation form.
Optional
options: anyOptions to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<object>
The newly created Folder or null if the dialog is closed.
- folderData: object
Static
folderDelete
- folderDelete(
document: object,
options?: any,
dialogData?: any,
): Promise<boolean | object> Deletes a folder and does delete subfolders / documents.
Parameters
- document: object
Folder to delete.
Optional
options: anyOptions to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
The deleted Folder or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Static
folderExport
- folderExport(
document: object,
opts?: { keepId?: boolean; merge?: boolean; options?: any; pack?: string },
dialogData?: any,
): Promise<boolean | object> Shows a modal / non-draggable dialog to export a folder to an eligible compendium pack.
Parameters
- document: object
Folder to export.
Optional
opts: { keepId?: boolean; merge?: boolean; options?: any; pack?: string }Additional options.
Optional
keepId?: booleanKeep document IDs.
Optional
merge?: booleanUpdate existing entries in the Compendium pack, matching by name
Optional
options?: anyRest of options to pass to TJSDialog / Application.
Optional
pack?: stringThe name of the compendium pack to provide an initial selection value in the dialog.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
The compendium collection the folder is exported to or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Static
folderRemove
- folderRemove(
document: object,
options?: any,
dialogData?: any,
): Promise<boolean | object> Removes a folder, but does not delete / remove sub-folders / documents.
Parameters
- document: object
Folder to remove.
Optional
options: anyOptions to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
The removed Folder or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Static
folderRolltable
- folderRolltable(
document: object,
options?: any,
dialogData?: any,
): Promise<boolean | object> Create a RollTable from the contents of the Folder.
Parameters
- document: object
Folder to create roll table from...
Optional
options: anyOptions to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
The newly created RollTable or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Static
folderUpdate
- folderUpdate(document: object, options?: any, dialogData?: any): Promise<object>
Updates an existing Folder by rendering a dialog window with basic details.
Parameters
- document: object
The folder to edit.
Optional
options: anyOptions to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<object>
The modified Folder or null if the dialog is closed.
- document: object
Static
importFromJSON
- importFromJSON(
document: object,
options?: any,
dialogData?: any,
): Promise<boolean | object> Render an import dialog for updating the data related to this Document through an exported JSON file
Parameters
- document: object
The document to import JSON to...
Optional
options: anyOptions to pass to TJSDialog / Application.
Optional
dialogData: anyOptional data to modify dialog.
Returns Promise<boolean | object>
The document after import completes or a falsy value; either 'false' for cancelling or 'null' if the user closed the dialog via
<Esc>
or the close header button.- document: object
Provides several methods to create documents, folders, and modify them through use of TJSDialog and a modal and non-draggable by default user experience.