YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

editor  2.3.1

Yahoo! UI Library > editor > YAHOO.widget.Editor

Show Private Show Protected

Class YAHOO.widget.Editor - extends YAHOO.util.Element

The Rich Text Editor is a UI control that replaces a standard HTML textarea; it allows for the rich formatting of text content, including common structural treatments like lists, formatting treatments like bold and italic text, and drag-and-drop inclusion and sizing of images. The Rich Text Editor's toolbar is extensible via a plugin architecture so that advanced implementations can achieve a high degree of customization.

Constructor

YAHOO.widget.Editor ( el , attrs )
Parameters:
el <String/HTMLElement> The textarea element to turn into an editor.
attrs <Object> Object liternal containing configuration parameters.

Properties

_alwaysDisabled - private Object

The Toolbar items that should ALWAYS be disabled event if there is a selection present in the editor.

_alwaysEnabled - private Object

The Toolbar items that should ALWAYS be enabled event if there isn't a selection present in the editor.

_baseHREF - private String

The base location of the editable page (this page) so that relative paths for image work.

_blankImageLoaded - private Date

Don't load the blank image more than once..

_contentTimer - private object

setTimeout holder for documentReady check

_contentTimerCounter - private Number

Counter to check the number of times the body is polled for before giving up

_disabled - private Array

The Toolbar items that should be disabled if there is no selection present in the editor.

_fixNodesTimer - private Date

Holder for the fixNodes timer

_lastButton - private Object

The last button pressed, so we don't disable it.

_lastImage - private HTMLElement

Safari reference for the last image selected (for styling as selected).

_lastNodeChange - private Date

Flag to determine when the last node change was fired

_lastNodeChangeEvent - private Event

Flag to determine the last event that fired a node change

_mask - private Object

DOM Element holder for the editor Mask when disabled

_nodeChangeTimer - private Number

Holds a reference to the nodeChange setTimeout call

_rendered - private Boolean

Flag to determine if editor has been rendered or not

_selection - private Object

Holder for caching iframe selections

_semantic - private Object

The Toolbar commands that we should attempt to make tags out of instead of using styles.

_showingHiddenElements - private Boolean

Status of the hidden elements button

_tag2cmd - private Object

A tag map of HTML tags to convert to the different types of commands so we can select the proper toolbar button.

afterElement - HTMLElement

A reference to the H2 placed after the editor for Accessibilty.

beforeElement - HTMLElement

A reference to the H2 placed before the editor for Accessibilty.

browser - Object

Standard browser detection

CLASS_CONTAINER - protected String

Default CSS class to apply to the editors container element

CLASS_EDITABLE - protected String

Default CSS class to apply to the editors iframe element

CLASS_EDITABLE_CONT - protected String

Default CSS class to apply to the editors iframe's parent element

CLASS_HIDDEN - protected String

CSS class applied to the body when the hiddenelements button is pressed.

CLASS_LOCAL_FILE - protected String

CSS class applied to an element when it's found to have a local url.

CLASS_PREFIX - protected String

Default prefix for dynamically created class names

currentElement - Array

A reference to the current working element in the editor

currentEvent - Event

A reference to the current editor event

currentFont - HTMLElement

A reference to the last font selected from the Toolbar

currentWindow - Object

A reference to the currently open EditorWindow

dompath - HTMLElement

A reference to the dompath container for writing the current working dom path to.

DOMReady - private Boolean

Flag to determine if DOM is ready or not

EDITOR_PANEL_ID - String

HTML id to give the properties window in the DOM.

el - object

The issue here is that we have no way of knowing where the cursor position is inside of the iframe, so we have to place the newly inserted data in the best place that we can.

invalidHTML - Object

Contains a list of HTML elements that are invalid inside the editor. They will be removed when they are found.

operaEvent - private Object

setTimeout holder for Opera and Image DoubleClick event..

sel - object

This work around traps the MouseUp event and sets a timer to check if another MouseUp event fires in so many seconds. If another event is fired, they we internally fire the DoubleClick event.

SEP_DOMPATH - String

The value to place in between the Dom path items

STOP_EXEC_COMMAND - protected Boolean

Set to true when you want the default execCommand function to not process anything

STOP_NODE_CHANGE - protected Boolean

Set to true when you want the default nodeChange function to not process anything

STR_BEFORE_EDITOR - String

The accessibility string for the element before the iFrame

STR_CLOSE_WINDOW - String

The Title of the close button in the Editor Window

STR_CLOSE_WINDOW_NOTE - String

A note appearing in the Editor Window to tell the user that the Escape key will close the window

STR_IMAGE_BORDER - String

The label string for the image border.

STR_IMAGE_COPY - String

The label string for the image copy and paste message for Opera and Safari

STR_IMAGE_HERE - String

The text to place in the URL textbox when using the blankimage.

STR_IMAGE_ORIG_SIZE - String

The label string for Original Image Size

STR_IMAGE_PADDING - String

The label string for the image padding.

STR_IMAGE_PROP_TITLE - String

The title for the Image Property Editor Window

STR_IMAGE_SIZE - String

The label string for Image Size

STR_IMAGE_TEXTFLOW - String

The label string for the image text flow.

STR_IMAGE_TITLE - String

The label string for Image Description

STR_IMAGE_URL - String

The label string for Image URL

STR_LEAVE_EDITOR - String

The accessibility string for the element after the iFrame

STR_LINK_NEW_WINDOW - String

The string for the open in a new window label.

STR_LINK_PROP_REMOVE - String

The label string for the Remove link from text link inside the property editor.

STR_LINK_PROP_TITLE - String

The label string for the Link Property Editor Window.

STR_LINK_TITLE - String

The string for the link description.

STR_LINK_URL - String

The label string for the Link URL.

STR_LOCAL_FILE_WARNING - String

The label string for the local file warning.

STR_TITLE - String

The Title of the HTML document that is created in the iFrame

tag - object


toolbar - YAHOO.widget.Toolbar

Local property containing the YAHOO.widget.Toolbar instance

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

_checkLoaded

private void _checkLoaded ( )
Called from a setTimeout loop to check if the iframes body.onload event has fired, then it will init the editor.
Returns: void

_closeWindow

private void _closeWindow ( ev )
Close the currently open EditorWindow with the Escape key.
Parameters:
ev <Event> The keypress Event that we are trapping
Returns: void

_createCurrentElement

private void _createCurrentElement ( tagName , tagStyle )
This is a work around for the various browser issues with execCommand. This method will run execCommand('fontname', false, 'yui-tmp') on the given selection. It will then search the document for an element with the font-family set to yui-tmp and replace that with another span that has other information in it, then assign the new span to the this.currentElement array, so we now have element references to the elements that were just modified. At this point we can use standard DOM manipulation to change them as we see fit.
Parameters:
tagName <String> (optional defaults to a) The tagname of the element that you wish to create
tagStyle <Object> (optional) Object literal containing styles to apply to the new element.
Returns: void

_createIframe

private void _createIframe ( id )
_createIframe
Parameters:
id <String> The string ID to prefix the iframe with
Returns: void

_fixNodes

private void _fixNodes ( )
Fix href and imgs as well as remove invalid HTML.
Returns: void

_focusWindow

private void _focusWindow ( onLoad )
Attempt to set the focus of the iframes window.
Parameters:
onLoad <Boolean> Safari needs some special care to set the cursor in the iframe
Returns: void

_getBlankImage

private void _getBlankImage ( )
Retrieves the full url of the image to use as the blank image.
Returns: void

_getDoc

private Object _getDoc ( )
Get the Document of the IFRAME
Returns: Object

_getDomPath

private void _getDomPath ( )
This method will attempt to build the DOM path from the currently selected element.
Returns: void

_getRange

private void _getRange ( )
Handles the different range objects across the A-Grade list.
Returns: void

_getSelectedElement

private void _getSelectedElement ( )
This method will attempt to locate the element that was last interacted with, either via selection, location or event.
Returns: void

_getSelection

private void _getSelection ( )
Handles the different selection objects across the A-Grade list.
Returns: void

_getWindow

private Object _getWindow ( )
Get the Window of the IFRAME
Returns: Object

_handleAfterNodeChange

private void _handleAfterNodeChange ( )
Fires after a nodeChange happens to setup the things that where reset on the node change (button state).
Returns: void

_handleAlign

private void _handleAlign ( o )
Handles the alignment buttons in the toolbar.
Parameters:
o <Object> Object returned from Toolbar's buttonClick Event
Returns: void

_handleClick

private void _handleClick ( ev )
Handles all click events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleColorPicker

private void _handleColorPicker ( o )
Handles the colorpicker buttons in the toolbar.
Parameters:
o <Object> Object returned from Toolbar's buttonClick Event
Returns: void

_handleCreateLinkClick

private void _handleCreateLinkClick ( )
Handles the opening of the Link Properties Window when the Create Link button is clicked or an href is doubleclicked.
Returns: void

_handleCreateLinkWindowClose

private void _handleCreateLinkWindowClose ( )
Handles the closing of the Link Properties Window.
Returns: void

_handleDoubleClick

private void _handleDoubleClick ( ev )
Handles all doubleclick events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleFontSize

private void _handleFontSize ( o )
Handles the font size button in the toolbar.
Parameters:
o <Object> Object returned from Toolbar's buttonClick Event
Returns: void

_handleInsertImageClick

private void _handleInsertImageClick ( )
Opens the Image Properties Window when the insert Image button is clicked or an Image is Double Clicked.
Returns: void

_handleInsertImageWindowClose

private void _handleInsertImageWindowClose ( )
Handles the closing of the Image Properties Window.
Returns: void

_handleKeyDown

private void _handleKeyDown ( ev )
Handles all keydown events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleKeyPress

private void _handleKeyPress ( ev )
Handles all keypress events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleKeyUp

private void _handleKeyUp ( ev )
Handles all keyup events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleMouseDown

private void _handleMouseDown ( ev )
Handles all mousedown events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleMouseUp

private void _handleMouseUp ( ev )
Handles all mouseup events inside the iFrame document.
Parameters:
ev <Event> The event we are working on.
Returns: void

_handleToolbarClick

private void _handleToolbarClick ( ev )
This is an event handler attached to the Toolbar's buttonClick event. It will fire execCommand with the command identifier from the Toolbar Button.
Parameters:
ev <Event> The event that triggered the button click
Returns: void

_hasSelection

private void _hasSelection ( )
Determines if there is a selection in the editor document.
Returns: void

_initEditor

private void _initEditor ( )
This method is fired from _checkLoaded when the document is ready. It turns on designMode and set's up the listeners.
Returns: void

_isElement

private void _isElement ( el , tag )
_isElement
Parameters:
el <HTMLElement> The element to check
tag <String> The tag that the element needs to be
Returns: void

_isLocalFile

private void _isLocalFile ( url )
Checks to see if a string (href or img src) is possibly a local file reference..
Parameters:
url <String> THe url/string to check
Returns: void

_renderPanel

private void _renderPanel ( )
Renders the panel used for Editor Windows to the document so we can start using it..
Returns: void

_selectNode

private void _selectNode ( node )
Places the highlight around a given node
Parameters:
node <HTMLElement> The node to select
Returns: void

_setCurrentEvent

private void _setCurrentEvent ( ev )
Sets the current event property
Parameters:
ev <Event> The event to cache
Returns: void

_setDesignMode

private void _setDesignMode ( state )
Sets the designMode of the iFrame document.
Parameters:
state <String> This should be either on or off
Returns: void

_setEditorStyle

void _setEditorStyle ( stat )
Set the editor to use CSS instead of HTML
Parameters:
stat <Booleen> True/False
Returns: void

_setInitialContent

private void _setInitialContent ( )
This method will open the iframes content document and write the textareas value into it, then start the body.onload checking.
Returns: void

_setMarkupType

private void _setMarkupType ( action )
This method will turn on/off the useCSS execCommand.
Parameters:
action <String> The action to take. Possible values are: css, default or semantic
Returns: void

_setupAfterElement

private void _setupAfterElement ( )
Creates the accessibility h2 header and places it after the iframe in the Dom for navigation.
Returns: void

_showHidden

private void _showHidden ( )
Toggle on/off the hidden.css file.
Returns: void

_swapEl

private void _swapEl ( el , tagName , callback )
This function will create a new element in the DOM and populate it with the contents of another element. Then it will assume it's place.
Parameters:
el <HTMLElement> The element to swap with
tagName <String> The tagname of the element that you wish to create
callback <Function> (optional) A function to run on the element after it is created, but before it is replaced. An element reference is passed to this function.
Returns: void

_toggleDesignMode

private void _toggleDesignMode ( )
Toggles the designMode of the iFrame document on and off.
Returns: void

_updateMenuChecked

private void _updateMenuChecked ( button , value , The )
Gets the menu from a button instance, if the menu is not rendered it will render it. It will then search the menu for the specified value, unchecking all other items and checking the specified on.
Parameters:
button <Object> The command identifier of the button you want to check
value <String> The value of the menu item you want to check
The <YAHOO.widget.Toolbar> Toolbar instance the button belongs to (defaults to this.toolbar)
Returns: void

_writeDomPath

private void _writeDomPath ( )
Write the current DOM path out to the dompath container below the editor.
Returns: void

cleanHTML

void cleanHTML ( html )
Process the HTML with a few regexes to clean it up and stabilize the output
Parameters:
html <String> The unfiltered HTML
Returns: void

clearEditorDoc

void clearEditorDoc ( )
Clear the doc of the Editor
Returns: void

closeWindow

void closeWindow ( )
Close the currently open EditorWindow.
Returns: void

destroy

Boolean destroy ( )
Destroys the editor, all of it's elements and objects.
Returns: Boolean

execCommand

void execCommand ( action , value )
This method attempts to try and level the differences in the various browsers and their support for execCommand actions
Parameters:
action <String> The "execCommand" action to try to execute (Example: bold, insertimage, inserthtml)
value <String> (optional) The value for a given action such as action: fontname value: 'Verdana'
Returns: void

getEditorHTML

void getEditorHTML ( )
Gets the unprocessed/unfiltered HTML from the editor
Returns: void

hide

void hide ( )
This method needs to be called if the Editor is to be hidden (like in a TabView or Panel). It should be called to clear timeouts and close open editor windows.
Returns: void

init

void init ( )
The Editor class' initialization method
Returns: void

initAttributes

void initAttributes ( attr )
Initializes all of the configuration attributes used to create the editor.
Parameters:
attr <Object> Object literal specifying a set of configuration attributes used to create the editor.
Returns: void

moveWindow

void moveWindow ( force )
Realign the window with the currentElement and reposition the knob above the panel.
Parameters:
force <Boolean> Boolean to tell it to move but not use any animation (Usually done the first time the window is loaded.)
Returns: void

nodeChange

void nodeChange ( force )
Handles setting up the toolbar buttons, getting the Dom path, fixing nodes.
Parameters:
force <Boolean> Optional paramenter to skip the threshold counter
Returns: void

openWindow

void openWindow ( win )
Opens a new "window/panel"
Parameters:
win <YAHOO.widget.EditorWindow> A YAHOO.widget.EditorWindow instance
Returns: void

render

void render ( )
Causes the toolbar and the editor to render and replace the textarea.
Returns: void

saveHTML

void saveHTML ( )
Cleans the HTML with the cleanHTML method then places that string back into the textarea.
Returns: void

setEditorHTML

void setEditorHTML ( html )
Loads HTML into the editors body
Parameters:
html <String> The html content to load into the editor
Returns: void

show

void show ( )
This method needs to be called if the Editor was hidden (like in a TabView or Panel). It is used to reset the editor after being in a container that was set to display none.
Returns: void

toString

String toString ( )
Returns a string representing the editor.
Returns: String

Events

afterExecCommand

afterExecCommand ( )
Event fires at the end of the execCommand process. See Element.addListener for more information on listening for this event.

afterNodeChange

afterNodeChange ( )
Event fires at the end of the nodeChange process. See Element.addListener for more information on listening for this event.

afterOpenWindow

afterOpenWindow ( win , panel )
Event fires after an Editor Window is opened. See Element.addListener for more information on listening for this event.
Parameters:
win <EditorWindow> The EditorWindow object
panel <Overlay> The Overlay object that is used to create the window.

afterRender

afterRender ( )
Event is fired after the render process finishes. See Element.addListener for more information on listening for this event.

animateChangeEvent

animateChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'animate' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

beforeAnimateChangeEvent

beforeAnimateChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'animate' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeBlankimageChangeEvent

beforeBlankimageChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'blankimage' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeCssChangeEvent

beforeCssChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'css' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeDisabledChangeEvent

beforeDisabledChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'disabled' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeDompathChangeEvent

beforeDompathChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'dompath' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeEditor_wrapperChangeEvent

beforeEditor_wrapperChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'editor_wrapper' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeElement_contChangeEvent

beforeElement_contChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'element_cont' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeExecCommand

beforeExecCommand ( )
Event fires at the beginning of the execCommand process. See Element.addListener for more information on listening for this event.

beforeFocusatstartChangeEvent

beforeFocusatstartChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'focusAtStart' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHandlesubmitChangeEvent

beforeHandlesubmitChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'handleSubmit' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHeightChangeEvent

beforeHeightChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'height' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHiddencssChangeEvent

beforeHiddencssChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'hiddencss' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHtmlChangeEvent

beforeHtmlChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'html' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeIframeChangeEvent

beforeIframeChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'iframe' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeLocalfilewarningChangeEvent

beforeLocalfilewarningChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'localFileWarning' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeMarkupChangeEvent

beforeMarkupChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'markup' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeNodeChange

beforeNodeChange ( )
Event fires at the beginning of the nodeChange process. See Element.addListener for more information on listening for this event.

beforeNodechangethresholdChangeEvent

beforeNodechangethresholdChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'nodeChangeThreshold' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeOpenWindow

beforeOpenWindow ( win , panel )
Event fires before an Editor Window is opened. See Element.addListener for more information on listening for this event.
Parameters:
win <EditorWindow> The EditorWindow object
panel <Overlay> The Overlay object that is used to create the window.

beforePanelChangeEvent

beforePanelChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'panel' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeRemovelinebreaksChangeEvent

beforeRemovelinebreaksChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'removeLineBreaks' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeTextareaChangeEvent

beforeTextareaChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'textarea' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeToolbar_contChangeEvent

beforeToolbar_contChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'toolbar_cont' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeToolbarChangeEvent

beforeToolbarChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'toolbar' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeWidthChangeEvent

beforeWidthChangeEvent ( eventInfo )
Fires before the value for the configuration attribute 'width' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

blankimageChangeEvent

blankimageChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'blankimage' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

closeWindow

closeWindow ( win )
Event fires after an Editor Window is closed. See Element.addListener for more information on listening for this event.
Parameters:
win <EditorWindow> The EditorWindow object

cssChangeEvent

cssChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'css' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

disabledChangeEvent

disabledChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'disabled' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

dompathChangeEvent

dompathChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'dompath' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

editor_wrapperChangeEvent

editor_wrapperChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'editor_wrapper' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

editorContentLoaded

editorContentLoaded ( )
Event is fired after the editor iframe's document fully loads and fires it's onload event. From here you can start injecting your own things into the document. See Element.addListener for more information on listening for this event.

editorDoubleClick

editorDoubleClick ( ev )
Passed through HTML Event. See Element.addListener for more information on listening for this event.
Parameters:
ev <Event> The DOM Event that occured

editorKeyDown

editorKeyDown ( ev )
Passed through HTML Event. See Element.addListener for more information on listening for this event.
Parameters:
ev <Event> The DOM Event that occured

editorKeyPress

editorKeyPress ( ev )
Passed through HTML Event. See Element.addListener for more information on listening for this event.
Parameters:
ev <Event> The DOM Event that occured

editorKeyUp

editorKeyUp ( ev )
Passed through HTML Event. See Element.addListener for more information on listening for this event.
Parameters:
ev <Event> The DOM Event that occured

editorMouseDown

editorMouseDown ( ev )
Passed through HTML Event. See Element.addListener for more information on listening for this event.
Parameters:
ev <Event> The DOM Event that occured

editorMouseUp

editorMouseUp ( ev )
Passed through HTML Event. See Element.addListener for more information on listening for this event.
Parameters:
ev <Event> The DOM Event that occured

element_contChangeEvent

element_contChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'element_cont' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

focusAtStartChangeEvent

focusAtStartChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'focusAtStart' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

handleSubmitChangeEvent

handleSubmitChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'handleSubmit' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

heightChangeEvent

heightChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'height' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

hiddencssChangeEvent

hiddencssChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'hiddencss' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

htmlChangeEvent

htmlChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'html' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

iframeChangeEvent

iframeChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'iframe' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

localFileWarningChangeEvent

localFileWarningChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'localFileWarning' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

markupChangeEvent

markupChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'markup' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

nodeChangeThresholdChangeEvent

nodeChangeThresholdChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'nodeChangeThreshold' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

panelChangeEvent

panelChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'panel' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

removeLineBreaksChangeEvent

removeLineBreaksChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'removeLineBreaks' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

textareaChangeEvent

textareaChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'textarea' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

toolbar_contChangeEvent

toolbar_contChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'toolbar_cont' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

toolbarChangeEvent

toolbarChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'toolbar' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

toolbarLoaded

toolbarLoaded ( )
Event is fired during the render process directly after the Toolbar is loaded. Allowing you to attach events to the toolbar. See Element.addListener for more information on listening for this event.

widthChangeEvent

widthChangeEvent ( eventInfo )
Fires when the value for the configuration attribute 'width' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

windowCMDClose

windowCMDClose ( win , panel )
Dynamic event fired when an EditorWindow is closed.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkClose event. See Element.addListener for more information on listening for this event.
Parameters:
win <EditorWindow> The EditorWindow object
panel <Overlay> The Overlay object that is used to create the window.

windowCMDOpen

windowCMDOpen ( win , panel )
Dynamic event fired when an EditorWindow is opened.. The dynamic event is based on the name of the window. Example Window: createlink, opening this window would fire the windowcreatelinkOpen event. See Element.addListener for more information on listening for this event.
Parameters:
win <EditorWindow> The EditorWindow object
panel <Overlay> The Overlay object that is used to create the window.

Events inherited from YAHOO.util.Element:

Configuration Attributes

animate - Boolean

Should the editor animate window movements
Default Value: false unless Animation is found, then true

blankimage - String

The CSS used to show/hide hidden elements on the page
Default Value: 'assets/blankimage.png'

css - String

The Base CSS used to format the content of the editor
Default Value:
html {
height: 95%;
}
body {
height: 100%;
padding: 7px; background-color: #fff; font:13px/1.22 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;
}
a {
color: blue;
text-decoration: underline;
cursor: pointer;
}
.warning-localfile {
border-bottom: 1px dashed red !important;
}
.yui-busy {
cursor: wait !important;
}
img.selected { //Safari image selection
border: 2px dotted #808080;
}
img {
cursor: pointer !important;
border: none;
}

disabled - Boolean

This will toggle the editor's disabled state. When the editor is disabled, designMode is turned off and a mask is placed over the iframe so no interaction can take place. All Toolbar buttons are also disabled so they cannot be used.
Default Value: false

dompath - Boolean

Toggle the display of the current Dom path below the editor
Default Value: false

editor_wrapper - private HTMLElement

The outter wrapper for the entire editor.
Default Value: null

element_cont - HTMLElement

Internal config for the editors container
Default Value: false

focusAtStart - Boolean

Should we focus the window when the content is ready?
Default Value: false

handleSubmit - Boolean

Config handles if the editor will attach itself to the textareas parent form's submit handler. If it is set to true, the editor will attempt to attach a submit listener to the textareas parent form. Then it will trigger the editors save handler and place the new content back into the text area before the form is submitted.
Default Value: false

height - String

The height of the editor iframe container, not including the toolbar..
Default Value: Best guessed size of the textarea, for best results use CSS to style the height of the textarea or pass it in as an argument

hiddencss - String

The CSS used to show/hide hidden elements on the page, these rules must be prefixed with the class provided in this.CLASS_HIDDEN
Default Value:
.hidden font, .hidden strong, .hidden b, .hidden em, .hidden i, .hidden u, .hidden div, .hidden p, .hidden span, .hidden img, .hidden ul, .hidden ol, .hidden li, .hidden table {
border: 1px dotted #ccc;
}
.hidden .yui-non {
border: none;
}
.hidden img {
padding: 2px;
}

html - String

The default HTML to be written to the iframe document before the contents are loaded
Default Value: This HTML requires a few things if you are to override:

{TITLE}, {CSS}, {HIDDEN_CSS} and {CONTENT} need to be there, they are passed to YAHOO.lang.substitute to be replace with other strings.

onload="document.body._rteLoaded = true;" : the onload statement must be there or the editor will not finish loading.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>{TITLE}</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
{CSS}
</style>
<style>
{HIDDEN_CSS}
</style>
</head>
<body onload="document.body._rteLoaded = true;">
{CONTENT}
</body>
</html>

iframe - private HTMLElement

Internal config for holding the iframe element.
Default Value: null

localFileWarning - Boolean

Should we throw the warning if we detect a file that is local to their machine?
Default Value: true

markup - String

Should we try to adjust the markup for the following types: semantic, css, default or xhtml
Default Value: "semantic"

nodeChangeThreshold - Number

The number of seconds that need to be in between nodeChange processing
Default Value: 3

panel - Boolean

A reference to the panel we are using for windows.
Default Value: false

removeLineBreaks - Boolean

Should we remove linebreaks and extra spaces on cleanup
Default Value: false

textarea - private HTMLElement

Internal config for holding the textarea element (replaced with element).
Default Value: null

toolbar - Object

The default toolbar config.
Default Value: This config is too large to display here, view the code to see it:

toolbar_cont - Boolean

Internal config for the toolbars container
Default Value: false

width - String

The width of the editor container.
Default Value: Best guessed size of the textarea, for best results use CSS to style the width of the textarea or pass it in as an argument

Configuration attributes inherited from YAHOO.util.Element:


Copyright © 2007 Yahoo! Inc. All rights reserved.