CKEDITOR.plugins.ezembed Class
CKEditor plugin to configure the widget plugin so that it recognizes the
div[data-ezelement="embed"] elements as widget.
Constructor
CKEDITOR.plugins.ezembed
()
Item Index
Methods
_cancelEditEvents
()
private
Cancels the widget events that trigger the edit event as
an embed widget can not be edited in a CKEditor way.
_fireEditorInteraction
-
evt
Fires the editorInteraction event so that AlloyEditor editor
UI remains visible and is updated. This method also computes
selectionData.region and the pageX and pageY properties
so that the add toolbar is correctly positioned on the
widget.
Parameters:
-
evtObject | Stringthis initial event info object or the event name for which the
editorInteractionis fired.
_getEzConfigElement
()
CKEDITOR.dom.element
private
Returns the element used as a container the config values. if it does not exist, it is created.
Returns:
_getValueElement
-
key
Returns the Element holding the config under key
Parameters:
-
keyString
Returns:
_getWrapperRegion
()
Object
private
Returns the wrapper element region.
Returns:
_setAlignment
-
type
Sets the alignment of the embed widget to type. The
alignment is set by adding the data-ezalign attribute
on the widget wrapper and the widget element.
Parameters:
-
typeString
_syncAlignment
()
protected
Initializes the alignment on the widget wrapper if the widget is aligned.
_unsetAlignment
()
protected
Removes the alignment of the widget.
edit
()
It's not possible to edit an embed widget in AlloyEditor,
so edit directly calls insert instead. This is needed
because by default, the CKEditor engine calls this method
when an embed widget has the focus and the ezembed command
is executed. In AlloyEditor, we want to insert a new widget,
not to edit the focused widget as the editing process is
provided by the style toolbar.
getConfig
()
String
Returns the config value for the key or undefined if the
config key is not found.
Returns:
getHref
()
String
Returns the hrefof the embed.
Returns:
insert
()
Insert an ezembed widget in the editor. It overrides the
default implementation to make sure that in the case where an
embed widget is focused, a new one is added after it.
isAligned
-
type
Checks whether the embed is aligned with type alignment.
Parameters:
-
typeString
Returns:
isImage
()
Boolean
Check whether the embed widget represents an image or not.
Returns:
moveAfter
-
element
Moves the widget after the given element. It also fires the
editorInteraction event so that the UI can respond to that
change.
Parameters:
-
elementCKEDITOR.dom.element
moveAfter
-
element
Moves the widget before the given element. It also fires the
editorInteraction event so that the UI can respond to that
change.
Parameters:
-
elementCKEDITOR.dom.element
setAlignment
-
type
Sets the alignment of the embed widget to type and fires
the corresponding editorInteraction event.
Parameters:
-
typeString
setConfig
-
key -
value
Sets a config value under the key for the embed.
Parameters:
-
keyString -
valueString
Returns:
setHref
-
href
Sets the href of the embed is URI to the embed content or
location. (ezcontent://32 for instance).
Parameters:
-
hrefString
Returns:
setImageType
()
CKEDITOR.plugins.widget
Set the embed as an embed representing an image
Returns:
setWidgetContent
-
content
Sets the widget content. It makes sure the config element is not overwritten.
Parameters:
-
contentString | CKEDITOR.dom.node
Returns:
unsetAlignment
()
Removes the alignment of the widget and fires the
corresponding editorInteraction event.
