Core Class
src/ui/react/src/adapter/alloy-editor.js:4
AlloyEditor main class. Creates instance of the editor and provides the user configuration to the UI.
Constructor
Core
()
Index
Methods
Methods
_getNativeEditor
()
Object
protected
Retrieves the native CKEditor instance. Having this, the developer may use the API of CKEditor OOTB.
Returns:
The current instance of CKEditor.
_loadLanguageFile
()
protected
Detects and load the corresponding language file if AlloyEditor language strings are not already present.
_renderUI
()
protected
Renders the specified from the user toolbars
_toElement
-
value
The function returns an HTML element from the passed value. If the passed value is a string, it should be the Id of the element which have to be retrieved from the DOM. If an HTML Element is passed, the element itself will be returned.
Parameters:
-
value
!(String | HTMLElement)String, which have to correspond to an HTML element from the DOM, or the HTML element itself. If Id is passed, the HTML element will be retrieved from the DOM.
Returns:
An HTML element.
_validateAllowedContent
-
The
Validates the allowed content attribute. Look here for more information about the supported values.
Parameters:
-
The
Anyvalue to be checked
Returns:
True if the current value is valid configuration, false otherwise
_validateToolbars
-
The
Validates the value of toolbars attribute
Parameters:
-
The
Anyvalue to be checked
Returns:
True if the current value is valid toolbars configuration, false otherwise
destructor
()
protected
Destructor lifecycle implementation for the AlloyEdtor class. Destroys the CKEditor instance and destroys all created toolbars.
initializer
-
config
Initializer lifecycle implementation for the AlloyEditor class. Creates a CKEditor instance, passing it the provided configuration attributes.
Parameters:
-
config
ObjectConfiguration object literal for the editor.
Properties
allowedContent
Boolean, String, Object
Configures the allowed content for the current instance of AlloyEditor. Look on the official CKEditor API for more information about the valid values.
Default: true
eventsDelay
Number
The delay (timeout), in ms, after which events such like key or mouse events will be processed.
extraPlugins
String
Specifies the extra plugins which have to be loaded to the current CKEditor instance in order to make AlloyEditor to work properly.
Default: 'uicore,selectionregion,dragresize,addimages,placeholder,tabletools,tableresize,autolink'
nativeEditor
Object
Retrieves the native CKEditor instance. Having this, the developer may use the full API of CKEditor.
placeholderClass
String
Specifies the class, which should be added by Placeholder plugin {{#crossLink "CKEDITOR.plugins.placeholder}}{{/crossLink}} when editor is not focused.
Default: 'ae-placeholder'
removePlugins
String
Specifies the plugins, which come by default with CKEditor, but which are not needed by AlloyEditor. These plugins add the default UI for CKeditor, which is no more needed. Please note that AlloyEdtor comes with its own highly optimized copy of CKEditor (just customized via their official download page). This version does not come with the unneeded plugins, so the value of this property won't be needed. However, if you decide to go with the OOTB version of CKEditor, you will have to remove some of the plugins if you decide to use AlloyEditor. Keep in mind that removing these plugins doesn't remove them entirely from CKEditor. It just removes them from its current instance, in which you will use different UI - those of AlloyEditor. You will be fully able to use both OOTB CKEditor and AlloyEditor on the same page!
Default: 'contextmenu,toolbar,elementspath,resize,liststyle,link'
srcNode
String | Node
The Node ID or HTMl node, which should be turned to an instance of AlloyEditor.
toolbars
Object
The toolbars configuration for this editor instance
uiNode
String | Node
The Node ID or HTMl node, where AlloyEditor's UI should be rendered.