tinymce.EditorOptions
TinyMCE Editor Options API. The options API provides the ability to register, lookup and set editor options.
All options need to be registered before they can be used in the editor. This is done by using the register()
API which requires a name and an option specification. The specification should contain a processor
and an optional default
value. The processor is used to parse and validate the option value either passed in the initial configuration or via the set()
API.
The processor can either be a custom function that returns if the option value is valid, or one of the following built-in processors:
-
string
-
number
-
boolean
-
array
-
function
-
object
-
string[]
-
object[]
-
regexp
Examples
// Register an option
editor.options.register('custom_option', {
processor: 'string',
default: 'myoption'
});
// Lookup an option
editor.options.get('custom_option');
// Set an option
editor.options.set('custom_option', 'value');
Summary
Methods
Name | Summary | Defined by |
---|---|---|
Logs the initial raw editor options to the console. |
||
Get the value of a registered option. |
||
Check if an option has been registered. |
||
Checks to see if a value has been set for the specified option. |
||
Register a new option that can be used within TinyMCE. |
||
Set the value for a registered option. |
||
Clear the set value for the specified option and revert back to the default value. |
Methods
isSet()
isSet(name: String): Boolean
Checks to see if a value has been set for the specified option.
register()
register(name: String, spec: OptionSpec)
Register a new option that can be used within TinyMCE.