Creates a component to work with an elemment.
ContentEditable
_defReadyFn
Binds DOM events and fires the ready event
_DOMPaste
e
Simple pass thru handler for the paste event so we can do content cleanup
_getHostValue
The
Retrieves a value from host attribute
The
Attr
attribute which value should be returned from the host
_getHTML
html
Get the content from the container
html
String
The raw HTML from the container.
_instanceLoaded
inst
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
_onDomEvent
e
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.
_setDir
value
Sets the dir (language direction) attribute on the container.
value
String
The language direction
_setExtraCSS
css
Set's the extra CSS on the instance.
css
String
The CSS style to be set as extra css
_setHTML
html
Set the content of the container
html
String
The raw HTML to set to the container.
_setLang
value
Sets the language value on the instance.
value
String
The language to be set
_setLinkedCSS
css
Sets the linked CSS on the instance.
css
String
The linkedcss value
_validateLinkedCSS
Validates linkedcss property
delegate
type
fn
cont
sel
A delegate method passed to the instance's delegate method
The Event handle returned from Y.delegate
destructor
Destroys the instance.
focus
fn
Set the focus to the container
fn
Function
Callback function to execute after focus happens
getInstance
Get a reference to the internal YUI instance.
The internal YUI instance
initializer
Initializes the ContentEditable instance
render
node
node
String/HTMLElement/Node
The node to render to
use
This 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.
NS
The namespace on which ContentEditable plugin will reside.
Default: 'contentEditable'
container
The 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
content
The 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
defaultblock
The 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
dir
The 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
extracss
A 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
id
Set 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
lang
The 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
linkedcss
An 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
node
The 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
use
Array 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