# CKEditor 3.0 JavaScript API Documentation

Code Index | File Index

## Namespaces

- CKEDITOR
- CKEDITOR.ajax
- CKEDITOR.config
- CKEDITOR.dom
- CKEDITOR.dtd
- CKEDITOR.env
- CKEDITOR.imageCacher
- CKEDITOR.loader
- CKEDITOR.plugins
- CKEDITOR.resourceManager
- CKEDITOR.scriptLoader
- CKEDITOR.skins
- CKEDITOR.test
- CKEDITOR.themes
- CKEDITOR.tools

## Classes

- CKEDITOR.commandDefinition
- CKEDITOR.dialog
- CKEDITOR.dialog.buttonDefinition
- CKEDITOR.dialog.contentDefinition
- CKEDITOR.dialog.contentDefinitionObject
- CKEDITOR.dialog.dialogDefinition
- CKEDITOR.dialog.dialogDefinitionObject
- CKEDITOR.dialog.uiElementDefinition
- CKEDITOR.dialogCommand
- CKEDITOR.dom.document
- CKEDITOR.dom.domObject
- CKEDITOR.dom.element
- CKEDITOR.dom.event
- CKEDITOR.dom.node
- CKEDITOR.dom.selection
- CKEDITOR.dom.text
- CKEDITOR.dom.window
- CKEDITOR.editor
- CKEDITOR.event
- CKEDITOR.eventInfo
- CKEDITOR.focusManager
- CKEDITOR.htmlParser
- CKEDITOR.htmlParser.cdata
- CKEDITOR.htmlParser.comment
- CKEDITOR.htmlParser.element
- CKEDITOR.htmlParser.fragment
- CKEDITOR.htmlParser.text
- CKEDITOR.htmlWriter
- CKEDITOR.keystrokeHandler
- CKEDITOR.pluginDefinition
- CKEDITOR.ui
- CKEDITOR.ui.button
- CKEDITOR.ui.dialog.button
- CKEDITOR.ui.dialog.checkbox
- CKEDITOR.ui.dialog.file
- CKEDITOR.ui.dialog.fileButton
- CKEDITOR.ui.dialog.hbox
- CKEDITOR.ui.dialog.html
- CKEDITOR.ui.dialog.labeledElement
- CKEDITOR.ui.dialog.radio
- CKEDITOR.ui.dialog.select
- CKEDITOR.ui.dialog.textarea
- CKEDITOR.ui.dialog.textInput
- CKEDITOR.ui.dialog.uiElement
- CKEDITOR.ui.dialog.vbox
- CKEDITOR.ui.handlerDefinition
- CKEDITOR.xml

# Namespace CKEDITOR.config

Holds the default configuration settings. Changes to this object are reflected in all editor instances, if not specificaly specified for those instances.
Defined in: core/config.js.

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| CKEDITOR.config Holds the default configuration settings.

Field Summary
Field Attributes | Field Name and Description
--- | ---
<static> | CKEDITOR.config.baseFloatZIndex The base Z-index for floating dialogs and popups.
<static> | CKEDITOR.config.baseHref The base href URL used to resolve relative and absolute URLs in the editor content.
<static> | CKEDITOR.config.blockedKeystrokes A list of keystrokes to be blocked if not defined in the #keystrokes setting.
<static> | CKEDITOR.config.contentsCss The CSS file to be used to apply style to the contents.
<static> | CKEDITOR.config.contentsLangDirection The writting direction of the language used to write the editor contents.
<static> | CKEDITOR.config.corePlugins A comma separated list of plugins that are not related to editor instances.
<static> | CKEDITOR.config.customConfig The URL path for the custom configuration file to be loaded.
<static> | CKEDITOR.config.defaultLanguage The language to be used if [@link #language] is left empty and it's not possible to localize the editor to the user language.
<static> | CKEDITOR.config.dialog_backgroundCoverColor The color of the dialog background cover.
<static> | CKEDITOR.config.dialog_backgroundCoverOpacity The opacity of the dialog background cover.
<static> | CKEDITOR.config.dialog_magnetDistance The distance of magnetic borders used in moving and resizing dialogs, measured in pixels.
<static> | CKEDITOR.config.disableNativeSpellChecker Disables the built-in spell checker while typing natively available in the browser (currently Firefox and Safari only).
<static> | CKEDITOR.config.disableNativeTableHandles Disables the "table tools" offered natively by the browser (currently Firefox only) to make quick table editing operations, like adding or deleting rows and columns.
<static> | CKEDITOR.config.disableObjectResizing Disables the ability of resize objects (image and tables) in the editing area
<static> | CKEDITOR.config.docType Sets the doctype to be used when loading the editor content as HTML.
<static> | CKEDITOR.config.extraPlugins List of additional plugins to be loaded.
<static> | CKEDITOR.config.fullPage Indicates whether the contents to be edited are being inputted as a full HTML page.
<static> | CKEDITOR.config.height The editor height, in CSS size format or pixel integer.
<static> | CKEDITOR.config.ignoreEmptyParagraph The editor will post an empty value ("") if you have just an empty paragraph on it, like this:
<static> | CKEDITOR.config.keystrokes A list associating keystrokes to editor commands.
<static> | CKEDITOR.config.language The user interface language localization to use.
<static> | CKEDITOR.config.plugins Comma separated list of plugins to load and initialize for an editor instance.
<static> | CKEDITOR.config.protectedSource List of regular expressions to be executed over the input HTML, indicating code that must stay untouched.
<static> | CKEDITOR.config.removePlugins List of plugins that must not be loaded.
<static> | CKEDITOR.config.skin The skin to load.
<static> | CKEDITOR.config.startupFocus Sets whether the editor should have the focus when the page loads.
<static> | CKEDITOR.config.startupMode The mode to load at the editor startup.
<static> | CKEDITOR.config.tabIndex The editor tabindex value.
<static> | CKEDITOR.config.tabSpaces Intructs the editor to add a number of spaces (&nbsp;) to the text when hitting the TAB key.
<static> | CKEDITOR.config.templates The templates definition set to use.
<static> | CKEDITOR.config.templates_files The list of templates definition files to load.
<static> | CKEDITOR.config.templates_replaceContent Whether replace the current document content OR insert current editing position.
<static> | CKEDITOR.config.theme The theme to be used to build the UI.
<static> | CKEDITOR.config.toolbar The toolbox (alias toolbar) definition.
<static> | CKEDITOR.config.toolbar_Basic The toolbar definition.
<static> | CKEDITOR.config.toolbarLocation The "theme space" to which rendering the toolbar.
<static> | CKEDITOR.config.width The editor width in CSS size format or pixel integer.

Namespace Detail
CKEDITOR.config
Since: 3.0
Holds the default configuration settings. Changes to this object are reflected in all editor instances, if not specificaly specified for those instances.

    // All editor created after the following setting will not load custom
    // configuration files.
    CKEDITOR.config.customConfig = '';

Field Detail
<static> {Number} CKEDITOR.config.baseFloatZIndex
Since: 3.0
The base Z-index for floating dialogs and popups.

    config.baseFloatZIndex = 2000

Default Value:
  10000

<static> {String} CKEDITOR.config.baseHref
Since: 3.0
The base href URL used to resolve relative and absolute URLs in the editor content.

    config.baseHref = 'http://www.example.com/path/';

Default Value:
  '' (empty string)

<static> {Array} CKEDITOR.config.blockedKeystrokes
Since: 3.0
A list of keystrokes to be blocked if not defined in the #keystrokes setting. In this way it is possible to block the default browser behavior for those keystrokes.
Defined in: plugins/keystrokes/plugin.js.

<static> {String} CKEDITOR.config.contentsCss
Since: 3.0
The CSS file to be used to apply style to the contents. It should reflect the CSS used in the final pages where the contents are to be used.

    config.contentsCss = '/css/mysitestyles.css';

Default Value:
  '<CKEditor folder>/contents.css'

<static> {String} CKEDITOR.config.contentsLangDirection
Since: 3.0
The writting direction of the language used to write the editor contents. Allowed values are 'ltr' for Left-To-Right language (like English), or 'rtl' for Right-To-Left languages (like Arabic).

    config.contentsLangDirection = 'rtl';

Default Value:
  'ltr'

<static> {String} CKEDITOR.config.corePlugins
Since: 3.0
A comma separated list of plugins that are not related to editor instances. Reserved to plugins that extend the core code only.
There are no ways to override this setting, except by editing the source code of CKEditor (_source/core/config.js).

<static> {String} CKEDITOR.config.customConfig
Since: 3.0
The URL path for the custom configuration file to be loaded. If not overloaded with inline configurations, it defaults to the "config.js" file present in the root of the CKEditor installation directory.
CKEditor will recursively load custom configuration files defined inside other custom configuration files.

    // Load a specific configuration file.
    CKEDITOR.replace( 'myfiled', { customConfig : '/myconfig.js' } );

    // Do not load any custom configuration file.
    CKEDITOR.replace( 'myfiled', { customConfig : '' } );

Default Value:
  '<CKEditor folder>/config.js'

<static> {String} CKEDITOR.config.defaultLanguage
Since: 3.0
The language to be used if [@link #language] is left empty and it's not possible to localize the editor to the user language.

    config.defaultLanguage = 'it';

Default Value:
  'en'

<static> {String} CKEDITOR.config.dialog_backgroundCoverColor
Since: 3.0
The color of the dialog background cover. It should be a valid CSS color string.
Defined in: plugins/dialog/plugin.js.

    config.dialog_backgroundCoverColor = 'rgb(255, 254, 253)';

Default Value:
  white

<static> {Number} CKEDITOR.config.dialog_backgroundCoverOpacity
Since: 3.0
The opacity of the dialog background cover. It should be a number within the range [0.0, 1.0].
Defined in: plugins/dialog/plugin.js.

    config.dialog_backgroundCoverOpacity = 0.7;

Default Value:
  0.5

<static> {Number} CKEDITOR.config.dialog_magnetDistance
Since: 3.0
The distance of magnetic borders used in moving and resizing dialogs, measured in pixels.
Defined in: plugins/dialog/plugin.js.

    config.dialog_magnetDistance = 30;

Default Value:
  20

<static> {Boolean} CKEDITOR.config.disableNativeSpellChecker
Since: 3.0
Disables the built-in spell checker while typing natively available in the browser (currently Firefox and Safari only).
Even if word suggestions will not appear in the CKEditor context menu, this feature is useful to help quickly identifying misspelled words.
This setting is currently compatible with Firefox only due to limitations in other browsers.
Defined in: plugins/wysiwygarea/plugin.js.

    config.disableNativeSpellChecker = false;

Default Value:
  true

<static> {Boolean} CKEDITOR.config.disableNativeTableHandles
Since: 3.0
Disables the "table tools" offered natively by the browser (currently Firefox only) to make quick table editing operations, like adding or deleting rows and columns.
Defined in: plugins/wysiwygarea/plugin.js.

    config.disableNativeTableHandles = false;

Default Value:
  true

<static> {Boolean} CKEDITOR.config.disableObjectResizing
Since: 3.0
Disables the ability of resize objects (image and tables) in the editing area
Defined in: plugins/wysiwygarea/plugin.js.

    config.disableObjectResizing = true;

Default Value:
  false

<static> {String} CKEDITOR.config.docType
Since: 3.0
Sets the doctype to be used when loading the editor content as HTML.

    // Set the doctype to the HTML 4 (quirks) mode.
    config.docType = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">';

Default Value:
  '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'

<static> {String} CKEDITOR.config.extraPlugins
Since: 3.0
List of additional plugins to be loaded. This is a tool setting which makes it easier to add new plugins, whithout having to touch and possibly breaking the plugins setting.

    config.extraPlugins = 'myplugin,anotherplugin';

<static> {Boolean} CKEDITOR.config.fullPage
Since: 3.0
Indicates whether the contents to be edited are being inputted as a full HTML page. A full page includes the <html>, <head> and <body> tags. The final output will also reflect this setting, including the <body> contents only if this setting is disabled.

    config.fullPage = true;

Default Value:
  false

<static> {String|Number} CKEDITOR.config.height
Since: 3.0
The editor height, in CSS size format or pixel integer.

Default Value:
  '200'

<static> {Undefined} CKEDITOR.config.ignoreEmptyParagraph
Since: 3.0
The editor will post an empty value ("") if you have just an empty paragraph on it, like this:
Defined in: plugins/wysiwygarea/plugin.js.

<static> {Array} CKEDITOR.config.keystrokes
Since: 3.0
A list associating keystrokes to editor commands. Each element in the list is an array where the first item is the keystroke, and the second is the command to be executed.
Defined in: plugins/keystrokes/plugin.js.

<static> {Boolean} CKEDITOR.config.language
Since: 3.0
The user interface language localization to use. If empty, the editor automatically localize the editor to the user language, if supported, otherwise the [@link #defaultLanguage] language is used.

    // Load the German interface.
    config.language = 'de';

Default Value:
  true

<static> {String} CKEDITOR.config.plugins
Since: 3.0
Comma separated list of plugins to load and initialize for an editor instance.

    config.plugins = 'basicstyles,button,htmldataprocessor,toolbar,wysiwygarea';

<static> {Array} CKEDITOR.config.protectedSource
Since: 3.0
List of regular expressions to be executed over the input HTML, indicating code that must stay untouched.

    config.protectedSource.push( /<\?[\s\S]*?\?>/g );   // PHP Code
    config.protectedSource.push( /<%[\s\S]*?%>/g );   // ASP Code
    config.protectedSource.push( /(]+>[\s|\S]*?<\/asp:[^\>]+>)|(]+\/>)/gi );   // ASP.Net Code

<static> {String} CKEDITOR.config.removePlugins
Since: 3.0
List of plugins that must not be loaded. This is a tool setting which makes it easier to avoid loading plugins definied in the plugins setting, whithout having to touch and possibly breaking it.

    config.removePlugins = 'elementspath,save,font';

<static> {String} CKEDITOR.config.skin
Since: 3.0
The skin to load. It may be the name of the skin folder inside the editor installation path, or the name and the path separated by a comma.

    config.skin = 'v2';

    config.skin = 'myskin,/customstuff/myskin/';

Default Value:
  'default'

<static> {Boolean} CKEDITOR.config.startupFocus
Since: 3.0
Sets whether the editor should have the focus when the page loads.
Defined in: plugins/editingblock/plugin.js.

    NO EXAMPLE AVAILABLE

Default Value:
  false

<static> {String} CKEDITOR.config.startupMode
Since: 3.0
The mode to load at the editor startup. It depends on the plugins loaded. By default, the "wysiwyg" and "source" modes are available.
Defined in: plugins/editingblock/plugin.js.

    config.toolbarLocation = 'source';

Default Value:
  'wysiwyg'

<static> {Number} CKEDITOR.config.tabIndex
Since: 3.0
The editor tabindex value.

    config.tabIndex = 1;

Default Value:
  0 (zero)

<static> {Undefined} CKEDITOR.config.tabSpaces
Since: 3.0
Intructs the editor to add a number of spaces (&nbsp;) to the text when hitting the TAB key. If set to zero, the TAB key will have its default behavior instead (like moving out of the editor).
Defined in: plugins/tab/plugin.js.

    config.tabSpaces = 4;

Default Value:
  0

<static> {String} CKEDITOR.config.templates
Since: 3.0
The templates definition set to use. It accepts a list of names separated by comma. It must match definitions loaded with the templates_files setting.
Defined in: plugins/templates/plugin.js.

    NO EXAMPLE AVAILABLE

Default Value:
  'default'

<static> {(String) Array} CKEDITOR.config.templates_files
Since: 3.0
The list of templates definition files to load.
Defined in: plugins/templates/plugin.js.

    NO EXAMPLE AVAILABLE

Default Value:
  [ 'plugins/templates/templates/default.js' ]

<static> {Boolean} CKEDITOR.config.templates_replaceContent
Since: 3.0
Whether replace the current document content OR insert current editing position.
Defined in: plugins/templates/plugin.js.

    NO EXAMPLE AVAILABLE

Default Value:
  true

<static> {String} CKEDITOR.config.theme
Since: 3.0
The theme to be used to build the UI.

    config.theme = 'default';

See:
  CKEDITOR.config.skin

Default Value:
  'default'

<static> {Array or String} CKEDITOR.config.toolbar
Since: 3.0
The toolbox (alias toolbar) definition. It is a toolbar name or an array of toolbars (strips), each one being also an array, containing a list of UI items.
Defined in: plugins/toolbar/plugin.js.

    // Defines a toolbar with only one strip containing the "Source" button, a
    // separator and the "Bold" and "Italic" buttons.
    CKEDITOR.config.toolbar =
    [
        [ 'Source', '-', 'Bold', 'Italic' ]
    ];
    // Load toolbar_Name where Name = Basic.
    CKEDITOR.config.toolbar = 'Basic';

<static> {Array} CKEDITOR.config.toolbar_Basic
Since: 3.0
The toolbar definition. It is an array of toolbars (strips), each one being also an array, containing a list of UI items.
Defined in: plugins/toolbar/plugin.js.

    // Defines a toolbar with only one strip containing the "Source" button, a
    // separator and the "Bold" and "Italic" buttons.
    CKEDITOR.config.toolbar_Basic =
    [
        [ 'Source', '-', 'Bold', 'Italic' ]
    ];

<static> {String} CKEDITOR.config.toolbarLocation
Since: 3.0
The "theme space" to which rendering the toolbar. For the default theme, the recommended options are "top" and "bottom".
Defined in: plugins/toolbar/plugin.js.

    config.toolbarLocation = 'bottom';

See:
  CKEDITOR.config.theme

Default Value:
  'top'

<static> {String|Number} CKEDITOR.config.width
Since: 3.0
The editor width in CSS size format or pixel integer.

Default Value:
  '100%'

Copyright © 2003-2009, CKSource - Frederico Knabben. All rights reserved.