Module: alfresco/editors/TinyMCE

alfresco/editors/TinyMCE

This module can be used to create a TinyMCE editor it is primarily used by the TinyMCE form control but can be used independently if required. Without any additional configuration it will instantiate an editor using the Alfresco preferred configuration, however this can be overridden by providing specific configuration that will augment or override the [default configuration]{@link module:alfresco/forms/controls/TinyMCE#defaultEditorConfig}.
Author:
  • Dave Draper
License:
Source:

Mixes In

Members

_editorInitialized :boolean

Starts as false and gets set to true on the editorInitialized callback that is bound to the TinyMCE editors "init_instance_callback" configuration options.
Type:
  • boolean
Default Value:
  • false
Source:

_focusWhenInitialized :boolean

Indicates whether or not the TinyMCE editor should be focused once it has been initialized. This will be set to true by the focus function if it is called before the editor has been initialized.
Type:
  • boolean
Since:
  • 1.0.46
Default Value:
  • false
Source:

_resizeWhenInitialized :boolean

Indicates whether or not the TinyMCE editor should be resized once it has been initialized. This will be set to true by the focus function if it is called before the editor has been initialized.
Type:
  • boolean
Since:
  • 1.0.47
Default Value:
  • false
Source:

autoResize :boolean

This indicates whether the size should be adjusted on resize events.
Type:
  • boolean
Since:
  • 1.0.47
Default Value:
  • false
Source:

contentChangeHandler :object

A function that should be called whenever the content of the editor changes. The function will be bound to the supplied contentChangeScope.
Type:
  • object
Default Value:
  • null
Source:

contentChangeScope :object

A scope for calling the contentChangeHandler against.
Type:
  • object
Default Value:
  • null
Source:

defaultEditorConfig :object

The default configuration for the editor. These settings should not be configured (as they will apply to all instances of the editor). However specific overrides can be achieved by setting the value of editorConfig which will be mixed into these default values.
Type:
  • object
Source:

editorConfig :object

Should be used to override the defaultEditorConfig
Type:
  • object
Default Value:
  • null
Source:

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/TinyMCE.properties"}]
Source:

immediateInit :boolean

Indicates whether or not the editor should be initialized as soon as it is created. This defaults to true but should be configured to false if the editor is being created in a DOM fragment and the init function should only be called once the DOM fragment has been placed into the document.
Type:
  • boolean
Default Value:
  • true
Source:

initiallyDisabled :boolean

Indicates whether or not the editor should be initially disabled
Type:
  • boolean
Default Value:
  • false
Source:

intialContent :string

The content with which to intially populate the editor
Type:
  • string
Default Value:
  • ""
Source:

nonAmdDependencies :String[]

Make sure TinyMCE is included on the page.
Type:
  • String[]
Source:

supportedLocales :string

The list of support locales for the editor. Can be overridden by only if there are the message bundles available to support the additional locales.
Type:
  • string
Default Value:
  • "en,de,es,fr,it,ja,nl,zh_CN,ru,nb,pt_BR"
Source:

templateString :String

The HTML template to use for the widget.
Type:
  • String
Source:

Methods

editorInitialized(editor)

This is bound to the TinyMCE editors "init_instance_callback" configuration option. This then sets up the various events required to manage the editor.
Parameters:
Name Type Description
editor object The initialized editor.
Source:

focus()

Give focus to the TinyMCE editor
Since:
  • 1.0.46
Source:
Fires:

getValue(isDisabled)

This function has been added to support the use of this widget within the [TinyMCE form control] module:alfresco/forms/controls/TinyMCE so that the content can be easily retrieved.
Parameters:
Name Type Description
isDisabled boolean Indicates whether or not to move the editor into disabled mode
Source:

init(config)

Parameters:
Name Type Description
config object The configuration to initialise the editor with
Source:

onResize()

When autoResize is configured to true this will respond to resize events by finding the first ancestor with height and width dimensions and then increasing the size of the TinyMCE editor to fill the available space as best it can.
Since:
  • 1.0.47
Source:

postCreate()

Source:

setDisabled(isDisabled)

This function has been added to support the use of this widget within the [TinyMCE form control] module:alfresco/forms/controls/TinyMCE so that it can be disabled as necessary during form state changes.
Parameters:
Name Type Description
isDisabled boolean Indicates whether or not to move the editor into disabled mode
Source:

setValue(isDisabled)

This function has been added to support the use of this widget within the [TinyMCE form control] module:alfresco/forms/controls/TinyMCE so that the content can be easily retrieved.
Parameters:
Name Type Description
isDisabled boolean Indicates whether or not to move the editor into disabled mode
Source:

updateEditorConfig(config)

This is an extension point function that provides the opportunity for extending widgets to make updates to the default configuration. This allows non-configurable options to be added to the configuration such as specific callback overrides for configuration plugins.
Parameters:
Name Type Description
config object The configuration object to be updated
Since:
  • 1.0.66
Source: