Type Alias TJSTinyMCEOptions
button?: boolean;
classes?: string[];
clickToEdit?: boolean;
document?: foundry.abstract.Document;
editable?: boolean;
enrichContent?: boolean;
enrichOptions?: globalThis.EnrichmentOptions;
fieldName?: string;
fonts?: any;
initialSelection?: "all" | "end" | "start";
keyCode?: string;
maxCharacterLength?: number;
mceConfig?: object;
preventEnterKey?: boolean;
preventPaste?: boolean;
saveOnBlur?: boolean;
saveOnEnterKey?: boolean;
styles?: {
[x: string]: string;
};
}
Type declaration
Optionalbutton?: booleanOptionalclasses?: string[]An array of strings to add to the
.editorelement classes. This allows easier setting of CSS variables across a range of various editor components.OptionalclickTo ?: booleanEdit When true the edit button is not shown and a click on the editor content initializes the editor.
Optionaldocument?: foundry.abstract.DocumentSet to a Foundry document to load and save content from it. Requires
fieldNameto be set.Optionaleditable?: booleanPrevents 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 ?: booleanWhen set to false content won't be enriched by
TextEditor.enrichHTML.OptionalenrichOptions ?: globalThis.EnrichmentOptionsAdditional
TextEditor.enrichHTMLoptions.OptionalfieldName ?: stringA field name to load and save to / from associated document. IE
a.b.c.Optionalfonts?: anyAn additional object defining module / custom fonts to load specific to this editor.
OptionalinitialSelection ?: "all" | "end" | "start"Initial selection range; 'all', 'end' or 'start'.
OptionalkeyCode ?: stringDefines the key event code to activate the editor when focused.
OptionalmaxCharacter ?: numberLength When defined as an integer greater than 0 this limits the max characters that can be entered.
OptionalmceConfig ?: objectUser defined TinyMCE config object. Please see TinyMCE documentation and also take into consideration that there are differences between Foundry v9 (TinyMCE v5) and Foundry v10+ (TinyMCE v6). Note: There are several pre-made configurations available in TinyMCEHelper. If not defined TinyMCEHelper.configStandard is used.
OptionalpreventEnter ?: booleanKey When true this prevents enter key from creating a new line / paragraph.
OptionalpreventPaste ?: booleanPrevents pasting content into the editor.
OptionalsaveOn ?: booleanBlur When true any loss of focus / blur from the editor saves the editor state.
OptionalsaveOn ?: booleanEnter Key When true saves the editor state when the enter key is pressed. This is useful when configuring the editor for single line entry. For an automatic setup for single line entry refer to TinyMCEHelper.optionsSingleLine.
Optionalstyles?: {
[x: string]: string;
}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.
[x: string]: string
Provides an edit button to start editing. When button is false editing is always enabled.