Code Index | File Index

Namespaces

Classes


Class CKEDITOR.editor


Extends CKEDITOR.event.

Defined in: core/editor.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
CKEDITOR.editor(element)
Represents an editor instance.
Field Summary
Field Attributes Field Name and Description
 
The configurations for this editor instance.
 
The DOM element that has been replaced by this editor instance.
 
The current editing mode.
 
The editor instance name.
Method Summary
Method Attributes Method Name and Description
 
addMode(mode, modeEditor)
Registers an editing mode.
 
Gets the editor data.
 
setData(data)
Sets the editor data.
 
setMode(mode)
Sets the current editing mode in this editor instance.
 
Updates the <textarea> element that has been replaced by the editor with the current data available in the editor.
Methods borrowed from class CKEDITOR.event:
fire, fireOnce, implementOn, on, removeListener
Class Detail
CKEDITOR.editor(element)
Since: 3.0
Represents an editor instance. This constructor should be rarely used, being the standard replacement methods preferible.
var myTextarea = CKEDITOR.document.getById( 'myTextarea' );
var myEditor = new CKEDITOR.editor( myTextarea );
CKEDITOR.add( myEditor );
Parameters:
{CKEDITOR.dom.element} element
The original element replaced by this editor instance.
Field Detail
{Object} config
Since: 3.0
The configurations for this editor instance. It inherits all settings defined in (@link CKEDITOR.config}, combined with settings loaded from custom configuration files and those defined inline in the page when creating the editor.
var editor = CKEDITOR.instances.editor1;
alert( editor.config.theme );  "default" e.g.

{CKEDITOR.dom.element} element
Since: 3.0
The DOM element that has been replaced by this editor instance. This element holds the editor data on load and post.
var editor = CKEDITOR.instances.editor1;
alert( editor.element.getName() );  "textarea"

{String} mode
Since: 3.0
The current editing mode. An editing mode is basically a viewport for editing or content viewing. By default the possible values for this property are "wysiwyg" and "source".
Defined in: plugins/editingblock/plugin.js.
alert( CKEDITOR.instances.editor1.mode );  // "wysiwyg" (e.g.)

{String} name
Since: 3.0
The editor instance name. It hay be the replaced element id, name or a default name using a progressive counter (editor1, editor2, ...).
var editor = CKEDITOR.instances.editor1;
alert( editor.name );  "editor1"
Method Detail
{Undefined} addMode(mode, modeEditor)
Since: 3.0
Registers an editing mode. This function is to be used mainly by plugins.
Defined in: plugins/editingblock/plugin.js.
Parameters:
{String} mode
The mode name.
{Object} modeEditor
The mode editor definition.

{String} getData()
Since: 3.0
Gets the editor data. The data will be in raw format. It is the same data that is posted by the editor.
if ( CKEDITOR.instances.editor1.getData() == '' )
    alert( 'There is no data available' );
Returns:
(String) The editor data.

{Undefined} setData(data)
Since: 3.0
Sets the editor data. The data must be provided in raw format.
CKEDITOR.instances.editor1.setData( '<p>This is the editor data.</p>' );
Parameters:
data

{Undefined} setMode(mode)
Since: 3.0
Sets the current editing mode in this editor instance.
Defined in: plugins/editingblock/plugin.js.
// Switch to "source" view.
CKEDITOR.instances.editor1.setMode( 'source' );
Parameters:
{String} mode
A registered mode name.

{Undefined} updateElement()
Since: 3.0
Updates the <textarea> element that has been replaced by the editor with the current data available in the editor.
CKEDITOR.instances.editor1.updateElement();
alert( document.getElementById( 'editor1' ).value );  // The current editor data.

Documentation generated by JsDoc Toolkit