2 Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
3 For licensing, see LICENSE.html or http://ckeditor.com/license
7 * @fileOverview Defines the {@link CKEDITOR.editor} class, which represents an
13 // The counter for automatic instance names.
16 var getNewName = function()
18 var name = 'editor' + ( ++nameCounter );
19 return ( CKEDITOR.instances && CKEDITOR.instances[ name ] ) ? getNewName() : name;
22 // ##### START: Config Privates
24 // These function loads custom configuration files and cache the
25 // CKEDITOR.editorConfig functions defined on them, so there is no need to
26 // download them more than once for several instances.
27 var loadConfigLoaded = {};
28 var loadConfig = function( editor )
30 var customConfig = editor.config.customConfig;
32 // Check if there is a custom config to load.
36 customConfig = CKEDITOR.getUrl( customConfig );
38 var loadedConfig = loadConfigLoaded[ customConfig ] || ( loadConfigLoaded[ customConfig ] = {} );
40 // If the custom config has already been downloaded, reuse it.
41 if ( loadedConfig.fn )
43 // Call the cached CKEDITOR.editorConfig defined in the custom
44 // config file for the editor instance depending on it.
45 loadedConfig.fn.call( editor, editor.config );
47 // If there is no other customConfig in the chain, fire the
48 // "configLoaded" event.
49 if ( CKEDITOR.getUrl( editor.config.customConfig ) == customConfig || !loadConfig( editor ) )
50 editor.fireOnce( 'customConfigLoaded' );
54 // Load the custom configuration file.
55 CKEDITOR.scriptLoader.load( customConfig, function()
57 // If the CKEDITOR.editorConfig function has been properly
58 // defined in the custom configuration file, cache it.
59 if ( CKEDITOR.editorConfig )
60 loadedConfig.fn = CKEDITOR.editorConfig;
62 loadedConfig.fn = function(){};
64 // Call the load config again. This time the custom
65 // config is already cached and so it will get loaded.
73 var initConfig = function( editor, instanceConfig )
75 // Setup the lister for the "customConfigLoaded" event.
76 editor.on( 'customConfigLoaded', function()
80 // Register the events that may have been set at the instance
81 // configuration object.
82 if ( instanceConfig.on )
84 for ( var eventName in instanceConfig.on )
86 editor.on( eventName, instanceConfig.on[ eventName ] );
90 // Overwrite the settings from the in-page config.
91 CKEDITOR.tools.extend( editor.config, instanceConfig, true );
93 delete editor.config.on;
96 onConfigLoaded( editor );
99 // The instance config may override the customConfig setting to avoid
100 // loading the default ~/config.js file.
101 if ( instanceConfig && instanceConfig.customConfig != undefined )
102 editor.config.customConfig = instanceConfig.customConfig;
104 // Load configs from the custom configuration files.
105 if ( !loadConfig( editor ) )
106 editor.fireOnce( 'customConfigLoaded' );
109 // ##### END: Config Privates
111 var onConfigLoaded = function( editor )
113 // Set config related properties.
115 var skin = editor.config.skin.split( ',' ),
116 skinName = skin[ 0 ],
117 skinPath = CKEDITOR.getUrl( skin[ 1 ] || (
118 '_source/' + // @Packager.RemoveLine
119 'skins/' + skinName + '/' ) );
122 * The name of the skin used by this editor instance. The skin name can
123 * be set though the {@link CKEDITOR.config.skin} setting.
124 * @name CKEDITOR.editor.prototype.skinName
127 * alert( editor.skinName ); // "kama" (e.g.)
129 editor.skinName = skinName;
132 * The full URL of the skin directory.
133 * @name CKEDITOR.editor.prototype.skinPath
136 * alert( editor.skinPath ); // "http://example.com/ckeditor/skins/kama/" (e.g.)
138 editor.skinPath = skinPath;
141 * The CSS class name used for skin identification purposes.
142 * @name CKEDITOR.editor.prototype.skinClass
145 * alert( editor.skinClass ); // "cke_skin_kama" (e.g.)
147 editor.skinClass = 'cke_skin_' + skinName;
150 * The <a href="http://en.wikipedia.org/wiki/Tabbing_navigation">tabbing
151 * navigation</a> order that has been calculated for this editor
152 * instance. This can be set by the {@link CKEDITOR.config.tabIndex}
153 * setting or taken from the "tabindex" attribute of the
154 * {@link #element} associated to the editor.
155 * @name CKEDITOR.editor.prototype.tabIndex
159 * alert( editor.tabIndex ); // "0" (e.g.)
161 editor.tabIndex = editor.config.tabIndex || editor.element.getAttribute( 'tabindex' ) || 0;
163 // Fire the "configLoaded" event.
164 editor.fireOnce( 'configLoaded' );
166 // Load language file.
170 var loadLang = function( editor )
172 CKEDITOR.lang.load( editor.config.language, editor.config.defaultLanguage, function( languageCode, lang )
175 * The code for the language resources that have been loaded
176 * for the user internface elements of this editor instance.
177 * @name CKEDITOR.editor.prototype.langCode
180 * alert( editor.langCode ); // "en" (e.g.)
182 editor.langCode = languageCode;
185 * An object holding all language strings used by the editor
187 * @name CKEDITOR.editor.prototype.lang
188 * @type CKEDITOR.lang
190 * alert( editor.lang.bold ); // "Negrito" (e.g. if language is Portuguese)
192 // As we'll be adding plugin specific entries that could come
193 // from different language code files, we need a copy of lang,
194 // not a direct reference to it.
195 editor.lang = CKEDITOR.tools.prototypedCopy( lang );
197 // We're not able to support RTL in Firefox 2 at this time.
198 if ( CKEDITOR.env.gecko && CKEDITOR.env.version < 10900 && editor.lang.dir == 'rtl' )
199 editor.lang.dir = 'ltr';
201 var config = editor.config;
202 config.contentsLangDirection == 'ui' && ( config.contentsLangDirection = editor.lang.dir );
204 loadPlugins( editor );
208 var loadPlugins = function( editor )
210 var config = editor.config,
211 plugins = config.plugins,
212 extraPlugins = config.extraPlugins,
213 removePlugins = config.removePlugins;
217 // Remove them first to avoid duplications.
218 var removeRegex = new RegExp( '(?:^|,)(?:' + extraPlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' );
219 plugins = plugins.replace( removeRegex, '' );
221 plugins += ',' + extraPlugins;
226 removeRegex = new RegExp( '(?:^|,)(?:' + removePlugins.replace( /\s*,\s*/g, '|' ) + ')(?=,|$)' , 'g' );
227 plugins = plugins.replace( removeRegex, '' );
230 // Load the Adobe AIR plugin conditionally.
231 CKEDITOR.env.air && ( plugins += ',adobeair' );
233 // Load all plugins defined in the "plugins" setting.
234 CKEDITOR.plugins.load( plugins.split( ',' ), function( plugins )
236 // The list of plugins.
237 var pluginsArray = [];
239 // The language code to get loaded for each plugin. Null
240 // entries will be appended for plugins with no language files.
241 var languageCodes = [];
243 // The list of URLs to language files.
244 var languageFiles = [];
247 * And object holding references to all plugins used by this
249 * @name CKEDITOR.editor.prototype.plugins
252 * alert( editor.plugins.dialog.path ); // "http://example.com/ckeditor/plugins/dialog/" (e.g.)
254 editor.plugins = plugins;
256 // Loop through all plugins, to build the list of language
257 // files to get loaded.
258 for ( var pluginName in plugins )
260 var plugin = plugins[ pluginName ],
261 pluginLangs = plugin.lang,
262 pluginPath = CKEDITOR.plugins.getPath( pluginName ),
265 // Set the plugin path in the plugin.
266 plugin.path = pluginPath;
268 // If the plugin has "lang".
271 // Resolve the plugin language. If the current language
272 // is not available, get the first one (default one).
273 lang = ( CKEDITOR.tools.indexOf( pluginLangs, editor.langCode ) >= 0 ? editor.langCode : pluginLangs[ 0 ] );
275 if ( !plugin.lang[ lang ] )
277 // Put the language file URL into the list of files to
279 languageFiles.push( CKEDITOR.getUrl( pluginPath + 'lang/' + lang + '.js' ) );
283 CKEDITOR.tools.extend( editor.lang, plugin.lang[ lang ] );
288 // Save the language code, so we know later which
289 // language has been resolved to this plugin.
290 languageCodes.push( lang );
292 pluginsArray.push( plugin );
295 // Load all plugin specific language files in a row.
296 CKEDITOR.scriptLoader.load( languageFiles, function()
298 // Initialize all plugins that have the "beforeInit" and "init" methods defined.
299 var methods = [ 'beforeInit', 'init', 'afterInit' ];
300 for ( var m = 0 ; m < methods.length ; m++ )
302 for ( var i = 0 ; i < pluginsArray.length ; i++ )
304 var plugin = pluginsArray[ i ];
306 // Uses the first loop to update the language entries also.
307 if ( m === 0 && languageCodes[ i ] && plugin.lang )
308 CKEDITOR.tools.extend( editor.lang, plugin.lang[ languageCodes[ i ] ] );
310 // Call the plugin method (beforeInit and init).
311 if ( plugin[ methods[ m ] ] )
312 plugin[ methods[ m ] ]( editor );
316 // Load the editor skin.
317 editor.fire( 'pluginsLoaded' );
323 var loadSkin = function( editor )
325 CKEDITOR.skins.load( editor, 'editor', function()
331 var loadTheme = function( editor )
333 var theme = editor.config.theme;
334 CKEDITOR.themes.load( theme, function()
337 * The theme used by this editor instance.
338 * @name CKEDITOR.editor.prototype.theme
339 * @type CKEDITOR.theme
341 * alert( editor.theme ); "http://example.com/ckeditor/themes/default/" (e.g.)
343 var editorTheme = editor.theme = CKEDITOR.themes.get( theme );
344 editorTheme.path = CKEDITOR.themes.getPath( theme );
345 editorTheme.build( editor );
347 if ( editor.config.autoUpdateElement )
348 attachToForm( editor );
352 var attachToForm = function( editor )
354 var element = editor.element;
356 // If are replacing a textarea, we must
357 if ( editor.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE && element.is( 'textarea' ) )
359 var form = element.$.form && new CKEDITOR.dom.element( element.$.form );
364 editor.updateElement();
366 form.on( 'submit',onSubmit );
368 // Setup the submit function because it doesn't fire the
370 if ( !form.$.submit.nodeName && !form.$.submit.length )
372 form.$.submit = CKEDITOR.tools.override( form.$.submit, function( originalSubmit )
376 editor.updateElement();
378 // For IE, the DOM submit function is not a
379 // function, so we need thid check.
380 if ( originalSubmit.apply )
381 originalSubmit.apply( this, arguments );
388 // Remove 'submit' events registered on form element before destroying.(#3988)
389 editor.on( 'destroy', function()
391 form.removeListener( 'submit', onSubmit );
397 function updateCommandsMode()
400 commands = this._.commands,
403 for ( var name in commands )
405 command = commands[ name ];
406 command[ command.startDisabled ? 'disable' : command.modes[ mode ] ? 'enable' : 'disable' ]();
411 * Initializes the editor instance. This function is called by the editor
412 * contructor (editor_basic.js).
415 CKEDITOR.editor.prototype._init = function()
417 // Get the properties that have been saved in the editor_base
419 var element = CKEDITOR.dom.element.get( this._.element ),
420 instanceConfig = this._.instanceConfig;
421 delete this._.element;
422 delete this._.instanceConfig;
424 this._.commands = {};
428 * The DOM element that has been replaced by this editor instance. This
429 * element holds the editor data on load and post.
430 * @name CKEDITOR.editor.prototype.element
431 * @type CKEDITOR.dom.element
433 * var editor = CKEDITOR.instances.editor1;
434 * alert( <b>editor.element</b>.getName() ); "textarea"
436 this.element = element;
439 * The editor instance name. It hay be the replaced element id, name or
440 * a default name using a progressive counter (editor1, editor2, ...).
441 * @name CKEDITOR.editor.prototype.name
444 * var editor = CKEDITOR.instances.editor1;
445 * alert( <b>editor.name</b> ); "editor1"
447 this.name = ( element && ( this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
448 && ( element.getId() || element.getNameAtt() ) )
451 if ( this.name in CKEDITOR.instances )
452 throw '[CKEDITOR.editor] The instance "' + this.name + '" already exists.';
455 * A unique random string assigned to each editor instance in the page.
456 * @name CKEDITOR.editor.prototype.id
459 this.id = CKEDITOR.tools.getNextId();
462 * The configurations for this editor instance. It inherits all
463 * settings defined in (@link CKEDITOR.config}, combined with settings
464 * loaded from custom configuration files and those defined inline in
465 * the page when creating the editor.
466 * @name CKEDITOR.editor.prototype.config
469 * var editor = CKEDITOR.instances.editor1;
470 * alert( <b>editor.config.theme</b> ); "default" e.g.
472 this.config = CKEDITOR.tools.prototypedCopy( CKEDITOR.config );
475 * Namespace containing UI features related to this editor instance.
476 * @name CKEDITOR.editor.prototype.ui
480 this.ui = new CKEDITOR.ui( this );
483 * Controls the focus state of this editor instance. This property
484 * is rarely used for normal API operations. It is mainly
485 * destinated to developer adding UI elements to the editor interface.
486 * @name CKEDITOR.editor.prototype.focusManager
487 * @type CKEDITOR.focusManager
490 this.focusManager = new CKEDITOR.focusManager( this );
492 CKEDITOR.fire( 'instanceCreated', null, this );
494 this.on( 'mode', updateCommandsMode, null, null, 1 );
496 initConfig( this, instanceConfig );
500 CKEDITOR.tools.extend( CKEDITOR.editor.prototype,
501 /** @lends CKEDITOR.editor.prototype */
504 * Adds a command definition to the editor instance. Commands added with
505 * this function can be later executed with {@link #execCommand}.
506 * @param {String} commandName The indentifier name of the command.
507 * @param {CKEDITOR.commandDefinition} commandDefinition The command definition.
509 * editorInstance.addCommand( 'sample',
511 * exec : function( editor )
513 * alert( 'Executing a command for the editor name "' + editor.name + '"!' );
517 addCommand : function( commandName, commandDefinition )
519 return this._.commands[ commandName ] = new CKEDITOR.command( this, commandDefinition );
523 * Add a trunk of css text to the editor which will be applied to the wysiwyg editing document.
524 * Note: This function should be called before editor is loaded to take effect.
525 * @param css {String} CSS text.
527 * editorInstance.addCss( 'body { background-color: grey; }' );
529 addCss : function( css )
531 this._.styles.push( css );
535 * Destroys the editor instance, releasing all resources used by it.
536 * If the editor replaced an element, the element will be recovered.
537 * @param {Boolean} [noUpdate] If the instance is replacing a DOM
538 * element, this parameter indicates whether or not to update the
539 * element with the instance contents.
541 * alert( CKEDITOR.instances.editor1 ); e.g "object"
542 * <b>CKEDITOR.instances.editor1.destroy()</b>;
543 * alert( CKEDITOR.instances.editor1 ); "undefined"
545 destroy : function( noUpdate )
548 this.updateElement();
550 this.fire( 'destroy' );
551 this.theme && this.theme.destroy( this );
553 CKEDITOR.remove( this );
554 CKEDITOR.fire( 'instanceDestroyed', null, this );
558 * Executes a command.
559 * @param {String} commandName The indentifier name of the command.
560 * @param {Object} [data] Data to be passed to the command
561 * @returns {Boolean} "true" if the command has been successfuly
562 * executed, otherwise "false".
564 * editorInstance.execCommand( 'Bold' );
566 execCommand : function( commandName, data )
568 var command = this.getCommand( commandName );
577 if ( command && command.state != CKEDITOR.TRISTATE_DISABLED )
579 if ( this.fire( 'beforeCommandExec', eventData ) !== true )
581 eventData.returnValue = command.exec( eventData.commandData );
583 // Fire the 'afterCommandExec' immediately if command is synchronous.
584 if ( !command.async && this.fire( 'afterCommandExec', eventData ) !== true )
585 return eventData.returnValue;
589 // throw 'Unknown command name "' + commandName + '"';
594 * Gets one of the registered commands. Note that, after registering a
595 * command definition with addCommand, it is transformed internally
596 * into an instance of {@link CKEDITOR.command}, which will be then
597 * returned by this function.
598 * @param {String} commandName The name of the command to be returned.
599 * This is the same used to register the command with addCommand.
600 * @returns {CKEDITOR.command} The command object identified by the
603 getCommand : function( commandName )
605 return this._.commands[ commandName ];
609 * Gets the editor data. The data will be in raw format. It is the same
610 * data that is posted by the editor.
612 * @returns (String) The editor data.
614 * if ( CKEDITOR.instances.editor1.<b>getData()</b> == '' )
615 * alert( 'There is no data available' );
619 this.fire( 'beforeGetData' );
621 var eventData = this._.data;
623 if ( typeof eventData != 'string' )
625 var element = this.element;
626 if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
627 eventData = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
632 eventData = { dataValue : eventData };
634 // Fire "getData" so data manipulation may happen.
635 this.fire( 'getData', eventData );
637 return eventData.dataValue;
641 * Gets the "raw data" currently available in the editor. This is a
642 * fast method which return the data as is, without processing, so it's
643 * not recommended to use it on resulting pages. It can be used instead
644 * combined with the {@link #loadSnapshot} so one can automatic save
645 * the editor data from time to time while the user is using the
646 * editor, to avoid data loss, without risking performance issues.
648 * alert( editor.getSnapshot() );
650 getSnapshot : function()
652 var data = this.fire( 'getSnapshot' );
654 if ( typeof data != 'string' )
656 var element = this.element;
657 if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
658 data = element.is( 'textarea' ) ? element.getValue() : element.getHtml();
665 * Loads "raw data" in the editor. This data is loaded with processing
666 * straight to the editing area. It should not be used as a way to load
667 * any kind of data, but instead in combination with
668 * {@link #getSnapshot} produced data.
670 * var data = editor.getSnapshot();
671 * editor.<b>loadSnapshot( data )</b>;
673 loadSnapshot : function( snapshot )
675 this.fire( 'loadSnapshot', snapshot );
679 * Sets the editor data. The data must be provided in raw format (HTML).<br />
681 * Note that this menthod is asynchronous. The "callback" parameter must
682 * be used if interaction with the editor is needed after setting the data.
683 * @param {String} data HTML code to replace the curent content in the
685 * @param {Function} callback Function to be called after the setData
687 *@param {Boolean} internal Whether suppress any event firing when copying data internally inside editor.
689 * CKEDITOR.instances.editor1.<b>setData</b>( '<p>This is the editor data.</p>' );
691 * CKEDITOR.instances.editor1.<b>setData</b>( '<p>Some other editor data.</p>', function()
693 * this.checkDirty(); // true
696 setData : function( data , callback, internal )
700 this.on( 'dataReady', function( evt )
702 evt.removeListener();
703 callback.call( evt.editor );
707 // Fire "setData" so data manipulation may happen.
708 var eventData = { dataValue : data };
709 !internal && this.fire( 'setData', eventData );
711 this._.data = eventData.dataValue;
713 !internal && this.fire( 'afterSetData', eventData );
717 * Inserts HTML into the currently selected position in the editor.
718 * @param {String} data HTML code to be inserted into the editor.
720 * CKEDITOR.instances.editor1.<b>insertHtml( '<p>This is a new paragraph.</p>' )</b>;
722 insertHtml : function( data )
724 this.fire( 'insertHtml', data );
728 * Insert text content into the currently selected position in the
729 * editor, in WYSIWYG mode, styles of the selected element will be applied to the inserted text,
730 * spaces around the text will be leaving untouched.
731 * <strong>Note:</strong> two subsequent line-breaks will introduce one paragraph, which element depends on {@link CKEDITOR.config.enterMode};
732 * A single line-break will be instead translated into one <br />.
734 * @param {String} text Text to be inserted into the editor.
736 * CKEDITOR.instances.editor1.<b>insertText( ' line1 \n\n line2' )</b>;
738 insertText : function( text )
740 this.fire( 'insertText', text );
744 * Inserts an element into the currently selected position in the
746 * @param {CKEDITOR.dom.element} element The element to be inserted
749 * var element = CKEDITOR.dom.element.createFromHtml( '<img src="hello.png" border="0" title="Hello" />' );
750 * CKEDITOR.instances.editor1.<b>insertElement( element )</b>;
752 insertElement : function( element )
754 this.fire( 'insertElement', element );
758 * Checks whether the current editor contents present changes when
759 * compared to the contents loaded into the editor at startup, or to
760 * the contents available in the editor when {@link #resetDirty} has
762 * @returns {Boolean} "true" is the contents present changes.
764 * function beforeUnload( e )
766 * if ( CKEDITOR.instances.editor1.<b>checkDirty()</b> )
767 * return e.returnValue = "You'll loose the changes made in the editor.";
770 * if ( window.addEventListener )
771 * window.addEventListener( 'beforeunload', beforeUnload, false );
773 * window.attachEvent( 'onbeforeunload', beforeUnload );
775 checkDirty : function()
777 return ( this.mayBeDirty && this._.previousValue !== this.getSnapshot() );
781 * Resets the "dirty state" of the editor so subsequent calls to
782 * {@link #checkDirty} will return "false" if the user will not make
783 * further changes to the contents.
785 * alert( editor.checkDirty() ); // "true" (e.g.)
786 * editor.<b>resetDirty()</b>;
787 * alert( editor.checkDirty() ); // "false"
789 resetDirty : function()
791 if ( this.mayBeDirty )
792 this._.previousValue = this.getSnapshot();
796 * Updates the <textarea> element that has been replaced by the editor with
797 * the current data available in the editor.
799 * CKEDITOR.instances.editor1.updateElement();
800 * alert( document.getElementById( 'editor1' ).value ); // The current editor data.
802 updateElement : function()
804 var element = this.element;
805 if ( element && this.elementMode == CKEDITOR.ELEMENT_MODE_REPLACE )
807 var data = this.getData();
809 if ( this.config.htmlEncodeOutput )
810 data = CKEDITOR.tools.htmlEncode( data );
812 if ( element.is( 'textarea' ) )
813 element.setValue( data );
815 element.setHtml( data );
820 CKEDITOR.on( 'loaded', function()
822 // Run the full initialization for pending editors.
823 var pending = CKEDITOR.editor._pending;
826 delete CKEDITOR.editor._pending;
828 for ( var i = 0 ; i < pending.length ; i++ )
829 pending[ i ]._init();
834 * Whether escape HTML when editor update original input element.
835 * @name CKEDITOR.config.htmlEncodeOutput
840 * config.htmlEncodeOutput = true;
844 * Fired when a CKEDITOR instance is created, but still before initializing it.
845 * To interact with a fully initialized instance, use the
846 * {@link CKEDITOR#instanceReady} event instead.
847 * @name CKEDITOR#instanceCreated
849 * @param {CKEDITOR.editor} editor The editor instance that has been created.
853 * Fired when a CKEDITOR instance is destroyed.
854 * @name CKEDITOR#instanceDestroyed
856 * @param {CKEDITOR.editor} editor The editor instance that has been destroyed.
860 * Fired when all plugins are loaded and initialized into the editor instance.
861 * @name CKEDITOR.editor#pluginsLoaded
863 * @param {CKEDITOR.editor} editor This editor instance.
867 * Fired before the command execution when {@link #execCommand} is called.
868 * @name CKEDITOR.editor#beforeCommandExec
870 * @param {CKEDITOR.editor} editor This editor instance.
871 * @param {String} data.name The command name.
872 * @param {Object} data.commandData The data to be sent to the command. This
873 * can be manipulated by the event listener.
874 * @param {CKEDITOR.command} data.command The command itself.
878 * Fired after the command execution when {@link #execCommand} is called.
879 * @name CKEDITOR.editor#afterCommandExec
881 * @param {CKEDITOR.editor} editor This editor instance.
882 * @param {String} data.name The command name.
883 * @param {Object} data.commandData The data sent to the command.
884 * @param {CKEDITOR.command} data.command The command itself.
885 * @param {Object} data.returnValue The value returned by the command execution.
889 * Fired every custom configuration file is loaded, before the final
890 * configurations initialization.<br />
892 * Custom configuration files can be loaded thorugh the
893 * {@link CKEDITOR.config.customConfig} setting. Several files can be loading
894 * by chaning this setting.
895 * @name CKEDITOR.editor#customConfigLoaded
897 * @param {CKEDITOR.editor} editor This editor instance.
902 * Fired once the editor configuration is ready (loaded and processed).
903 * @name CKEDITOR.editor#configLoaded
905 * @param {CKEDITOR.editor} editor This editor instance.
907 * if( editor.config.fullPage )
908 * alert( 'This is a full page editor' );
912 * Fired when this editor instance is destroyed. The editor at this
913 * point isn't usable and this event should be used to perform clean up
915 * @name CKEDITOR.editor#destroy
920 * Internal event to get the current data.
921 * @name CKEDITOR.editor#beforeGetData
926 * Internal event to perform the #getSnapshot call.
927 * @name CKEDITOR.editor#getSnapshot
932 * Internal event to perform the #loadSnapshot call.
933 * @name CKEDITOR.editor#loadSnapshot
939 * Event fired before the #getData call returns allowing additional manipulation.
940 * @name CKEDITOR.editor#getData
942 * @param {CKEDITOR.editor} editor This editor instance.
943 * @param {String} data.dataValue The data that will be returned.
947 * Event fired before the #setData call is executed allowing additional manipulation.
948 * @name CKEDITOR.editor#setData
950 * @param {CKEDITOR.editor} editor This editor instance.
951 * @param {String} data.dataValue The data that will be used.
955 * Event fired at the end of the #setData call is executed. Usually it's better to use the
956 * {@link CKEDITOR.editor.prototype.dataReady} event.
957 * @name CKEDITOR.editor#afterSetData
959 * @param {CKEDITOR.editor} editor This editor instance.
960 * @param {String} data.dataValue The data that has been set.
964 * Internal event to perform the #insertHtml call
965 * @name CKEDITOR.editor#insertHtml
967 * @param {CKEDITOR.editor} editor This editor instance.
968 * @param {String} data The HTML to insert.
972 * Internal event to perform the #insertText call
973 * @name CKEDITOR.editor#insertText
975 * @param {CKEDITOR.editor} editor This editor instance.
976 * @param {String} text The text to insert.
980 * Internal event to perform the #insertElement call
981 * @name CKEDITOR.editor#insertElement
983 * @param {CKEDITOR.editor} editor This editor instance.
984 * @param {Object} element The element to insert.