API Docs for: 1.0.0
Show:

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

()

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
)
protected

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:

  • evt Object | String

    this initial event info object or the event name for which the editorInteraction is 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:

CKEDITOR.dom.element:

_getValueElement

(
  • key
)
CKEDITOR.dom.element

Returns the Element holding the config under key

Parameters:

  • key String

Returns:

CKEDITOR.dom.element:

_getWrapperRegion

() Object private

Returns the wrapper element region.

Returns:

Object:

_setAlignment

(
  • type
)
protected

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:

  • type String

_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:

String:

getHref

() String

Returns the hrefof the embed.

Returns:

String:

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
)
Boolean

Checks whether the embed is aligned with type alignment.

Parameters:

  • type String

Returns:

Boolean:

isImage

() Boolean

Check whether the embed widget represents an image or not.

Returns:

Boolean:

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:

  • element CKEDITOR.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:

  • element CKEDITOR.dom.element

setAlignment

(
  • type
)

Sets the alignment of the embed widget to type and fires the corresponding editorInteraction event.

Parameters:

  • type String

setConfig

(
  • key
  • value
)
CKEDITOR.plugins.widget

Sets a config value under the key for the embed.

Parameters:

  • key String
  • value String

Returns:

CKEDITOR.plugins.widget:

setHref

(
  • href
)
CKEDITOR.plugins.widget

Sets the href of the embed is URI to the embed content or location. (ezcontent://32 for instance).

Parameters:

  • href String

Returns:

CKEDITOR.plugins.widget:

setImageType

() CKEDITOR.plugins.widget

Set the embed as an embed representing an image

Returns:

CKEDITOR.plugins.widget:

setWidgetContent

(
  • content
)
CKEDITOR.plugins.widget

Sets the widget content. It makes sure the config element is not overwritten.

Parameters:

  • content String | CKEDITOR.dom.node

Returns:

CKEDITOR.plugins.widget:

unsetAlignment

()

Removes the alignment of the widget and fires the corresponding editorInteraction event.