Type Alias TJSContentEditOptions
button?: boolean;
classes?: string[];
clickToEdit?: boolean;
document?: ClientDocument;
editable?: boolean;
enrichContent?: boolean;
enrichOptions?: EnrichmentOptions;
fieldName?: string;
initialSelection?: "all" | "end" | "start";
keyCode?: string;
maxCharacterLength?: number;
preventEnterKey?: boolean;
preventPaste?: boolean;
saveOnBlur?: boolean;
saveOnEnterKey?: boolean;
styles?: { [x: string]: string };
}
Properties
Optionalbutton
Optionalclasses
An array of strings to add to the .editor element classes. This allows easier
setting of CSS variables across a range of various editor components.
OptionalclickToEdit  
When true the edit button is not shown and a click on the editor content initializes the editor.
Optionaldocument
Set to a Foundry document to load and save content from it.
Requires fieldName to be set.
Optionaleditable
Prevents editing and hides button. When set to false any active editor is cancelled. Default: user is GM or when a document is assigned the user has ownership.
OptionalenrichContent 
When set to false content won't be enriched by TextEditor.enrichHTML.
OptionalenrichOptions 
Additional TextEditor.enrichHTML options.
OptionalfieldName 
A field name to load and save to / from associated document. IE a.b.c.
OptionalinitialSelection 
Initial selection range; 'all', 'end' or 'start'.
OptionalkeyCode 
Defines the key event code to activate the editor when focused.
OptionalmaxCharacterLength  
When defined as an integer greater than 0 this limits the max characters that can be entered.
OptionalpreventEnterKey  
When true this prevents enter key from creating a new line / paragraph.
OptionalpreventPaste 
Prevents pasting content into the editor.
OptionalsaveOnBlur  
When true any loss of focus / blur from the editor saves the editor state.
OptionalsaveOnEnterKey   
When true saves the editor state when the enter key is pressed.
Optionalstyles
Additional CSS property names and values to set as inline styles. This is useful for dynamically overriding any built in styles and in particular setting CSS variables supported.
Provides an edit button to start editing. When button is false editing is always enabled.