Creates a component to work with an elemment.
ContentEditable_defReadyFnBinds DOM events and fires the ready event
_DOMPastee
Simple pass thru handler for the paste event so we can do content cleanup
_getHostValueThe
Retrieves a value from host attribute
The
Attr
attribute which value should be returned from the host
_getHTMLhtml
Get the content from the container
html
String
The raw HTML from the container.
_instanceLoadedinst
Called from the first YUI instance that sets up the internal instance. This loads the content into the ContentEditable element and attaches the contentready event.
inst
YUI
The internal YUI instance bound to the ContentEditable element
_onContentReady
on the internal instance so that the modules are loaded properly.Called once the content is available in the ContentEditable element and calls the final use call
_onDomEvente
Generic handler for all DOM events fired by the Editor container. This handler takes the current EventFacade and augments it to fire on the ContentEditable host. It adds two new properties to the EventFacade called frameX and frameY which adds the scroll and xy position of the ContentEditable element to the original pageX and pageY of the event so external nodes can be positioned over the element. In case of ContentEditable element these will be equal to pageX and pageY of the container.
_setDirvalue
Sets the dir (language direction) attribute on the container.
value
String
The language direction
_setExtraCSScss
Set's the extra CSS on the instance.
css
String
The CSS style to be set as extra css
_setHTMLhtml
Set the content of the container
html
String
The raw HTML to set to the container.
_setLangvalue
Sets the language value on the instance.
value
String
The language to be set
_setLinkedCSScss
Sets the linked CSS on the instance.
css
String
The linkedcss value
_validateLinkedCSSValidates linkedcss property
delegatetype
fn
cont
sel
A delegate method passed to the instance's delegate method
The Event handle returned from Y.delegate
destructorDestroys the instance.
focusfn
Set the focus to the container
fn
Function
Callback function to execute after focus happens
getInstanceGet a reference to the internal YUI instance.
The internal YUI instance
initializerInitializes the ContentEditable instance
rendernode
node
String/HTMLElement/Node
The node to render to
useThis is a scoped version of the normal YUI.use method & is bound to the ContentEditable element At setup, the inst.use method is mapped to this method.
NSThe namespace on which ContentEditable plugin will reside.
Default: 'contentEditable'
containerThe container to set contentEditable=true or to create on render.
containerChange
Fires when the value for the configuration attribute container is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
contentThe string to inject as Editor content. Default '
'
contentChange
Fires when the value for the configuration attribute content is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
defaultblockThe default tag to use for block level items, defaults to: p
defaultblockChange
Fires when the value for the configuration attribute defaultblock is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
dirThe default text direction for this ContentEditable element. Default: ltr
dirChange
Fires when the value for the configuration attribute dir is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
extracssA string of CSS to add to the Head of the Editor
extracssChange
Fires when the value for the configuration attribute extracss is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
idSet the id of the new Node. (optional)
idChange
Fires when the value for the configuration attribute id is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
langThe default language. Default: en-US
langChange
Fires when the value for the configuration attribute lang is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
linkedcssAn array of url's to external linked style sheets
linkedcssChange
Fires when the value for the configuration attribute linkedcss is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
nodeThe Node instance of the container.
nodeChange
Fires when the value for the configuration attribute node is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade
useArray of modules to include in the scoped YUI instance at render time. Default: ['node-base', 'editor-selection', 'stylesheet']
useChange
Fires when the value for the configuration attribute use is
changed. You can listen for the event using the on method if you
wish to be notified before the attribute's value has changed, or
using the after method if you wish to be notified after the
attribute's value has changed.
e
EventFacade