<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://docs-old.ckeditor.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TobiaszCudnik</id>
		<title>CKSource Docs - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://docs-old.ckeditor.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=TobiaszCudnik"/>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/Special:Contributions/TobiaszCudnik"/>
		<updated>2026-05-02T17:29:28Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2836</id>
		<title>CKEditor 3.x/Developers Guide/jQuery Adapter</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2836"/>
				<updated>2010-01-20T09:04:30Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;CKEditor offers native jQuery integration through its jQuery Adapter (a jQuery plugin basically). It provides deep integration of CKEditor into jQuery, using its native features.&lt;br /&gt;
&lt;br /&gt;
== Creating editor instances ==&lt;br /&gt;
&lt;br /&gt;
To create editor instances, other than the usual CKEditor core script, you need to load the jQuery Adapter file in the page, in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source language=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/ckeditor.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/adapters/jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, any textarea, p or div element can be transformed into a rich text editor by simply using the ckeditor() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( 'textarea.editor' ).ckeditor();&amp;lt;/source&amp;gt;&lt;br /&gt;
jQuery chaining can also be used:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( '.section-x' )&lt;br /&gt;
    .find( 'textarea.editor' )&lt;br /&gt;
        .ckeditor()&lt;br /&gt;
    .end()&lt;br /&gt;
    .find( 'a' )&lt;br /&gt;
        .addClass( 'mylink' )&lt;br /&gt;
    .end();&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ckeditor() is the main method in the jQuery adapter. It accepts two optional parameters:&lt;br /&gt;
* A '''callback function''' to be execute when the editor is ready.&lt;br /&gt;
* '''Configuration options''' specific to the created editor instance.&lt;br /&gt;
&lt;br /&gt;
The [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html configurations options] are passed through a simple object containing properties, each one related to a specific editor setting.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$('.jquery_ckeditor')&lt;br /&gt;
    .ckeditor( function() { /* callback code */ }, { skin : 'office2003' } );&lt;br /&gt;
    .ckeditor( callback2 );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Code above won't create 2 editors - it will discover that one is already during creation and wait with the second callback. Each of those callbacks will be executed in context of the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object (so &amp;quot;this&amp;quot; will be the editor) and the DOM element object will be passed as parameter.&lt;br /&gt;
&lt;br /&gt;
== Code interaction with editor instances== &lt;br /&gt;
As soon as an editor instance is ready (after the above callback call), the ckeditorGet() method can then be used to retrieve a [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object that represents an editor instance. For example:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;var editor = $('.jquery_ckeditor').ckeditorGet();&lt;br /&gt;
alert( editor.checkDirty() );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because setting and retrieving the editor data is a common operation, the jQuery Adapter also provides the dedicated val() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;// Get the editor data.&lt;br /&gt;
var data = $( 'textarea.editor' ).val();&lt;br /&gt;
// Set the editor data.&lt;br /&gt;
$( 'textarea.editor' ).val( 'my new content' );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature can be disabled by setting CKEDITOR.config.jqueryOverrideVal to false, before loading the adapter code.&lt;br /&gt;
&lt;br /&gt;
For textareas, the editor will automatically return it's content back to the form when it is submitted. CKEditor also works with the official [http://jquery.malsup.com/form/ jQuery Form Plugin] for AJAX based forms. It doesn't require anything from the developer side.&lt;br /&gt;
&lt;br /&gt;
== Events handling ==&lt;br /&gt;
Although CKEditor uses its own event system, there are four main events which we're exposing to the jQuery event system. All events use the event namespace, which is simply named &amp;amp;quot;.ckeditor&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The following events are available:&lt;br /&gt;
* &amp;lt;strong&amp;gt;instanceReady.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor is created, but before any callback being passed to the ckeditor() method.&lt;br /&gt;
* &amp;lt;strong&amp;gt;setData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is set into the editor.&lt;br /&gt;
* &amp;lt;strong&amp;gt;getData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is fetched from the editor. The current editor data is also passed in the arguments.&lt;br /&gt;
* &amp;lt;strong&amp;gt;destroy.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor gets destroyed. It can be used, for example, to execute some cleanup on the page.&lt;br /&gt;
&lt;br /&gt;
The editor instance is always passed as the first data argument for the listener. Both getData and setData are often used internally so listening to them should be done with care.&lt;br /&gt;
&lt;br /&gt;
jQuery events DO bubble up through the DOM, so they can be listened selectively on certain parts of the document.&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2831</id>
		<title>CKEditor 3.x/Developers Guide/jQuery Adapter</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2831"/>
				<updated>2010-01-19T15:04:17Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The CKEditor jQuery Adapter provides deep integration into the jQuery JavaScript Library of the CKEditor, using native library's features.&lt;br /&gt;
&lt;br /&gt;
== Creating editor instances ==&lt;br /&gt;
To create editor instances, other than the usual CKEditor core script, you need to load the jQuery Adapter file in the page, in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source language=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/ckeditor.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/adapters/jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, any textarea, p or div element can be transformed into a rich text editor by simply using the ckeditor() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( 'textarea.editor' ).ckeditor();&amp;lt;/source&amp;gt;&lt;br /&gt;
jQuery chaining can also be used:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( '.section-x' )&lt;br /&gt;
    .find( 'textarea.editor' )&lt;br /&gt;
        .ckeditor()&lt;br /&gt;
    .end()&lt;br /&gt;
    .find( 'a' )&lt;br /&gt;
        .addClass( 'mylink' )&lt;br /&gt;
    .end();&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ckeditor() is the main method in the jQuery adapter. It accepts two optional parameters:&lt;br /&gt;
 * A '''callback function''' to be execute when the editor is ready.&lt;br /&gt;
 * '''Configuration options''' specific to the created editor instance.&lt;br /&gt;
&lt;br /&gt;
The [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html configurations options] are passed through a simple object containing properties, each one related to a specific editor setting.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$('.jquery_ckeditor')&lt;br /&gt;
    .ckeditor( function() { /* callback code */ }, { skin : 'office2003' } );&lt;br /&gt;
    .ckeditor( callback2 );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Code above won't create 2 editors - it will discover that one is already during creation and wait with the second callback. Each of those callbacks will be executed in context of the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object (so &amp;quot;this&amp;quot; will be the editor) and the DOM element object will be passed as parameter.&lt;br /&gt;
&lt;br /&gt;
== Code interaction with editor instances== &lt;br /&gt;
As soon as an editor instance is ready (after the above callback call), the ckeditorGet() method can then be used to retrieve a [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object that represents an editor instance. For example:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;var editor = $('.jquery_ckeditor').ckeditorGet();&lt;br /&gt;
alert( editor.checkDirty() );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because setting and retrieving the editor data is a common operation, the jQuery Adapter also provides the dedicated val() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;// Get the editor data.&lt;br /&gt;
var data = $( 'textarea.editor' ).val();&lt;br /&gt;
// Set the editor data.&lt;br /&gt;
$( 'textarea.editor' ).val( 'my new content' );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature can be disabled by setting CKEDITOR.config.jqueryOverrideVal to false, before loading the adapter code.&lt;br /&gt;
&lt;br /&gt;
For textareas, the editor will automatically return it's content back to the form when it is submitted. CKEditor also works with the official [http://jquery.malsup.com/form/ jQuery Form Plugin] for AJAX based forms. It doesn't require anything from the developer side.&lt;br /&gt;
&lt;br /&gt;
== Events handling ==&lt;br /&gt;
Although CKEditor uses its own event system, there are four main events which we're exposing to the jQuery event system. All events use the event namespace, which is simply named &amp;amp;quot;.ckeditor&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The following events are available:&lt;br /&gt;
 * &amp;lt;strong&amp;gt;instanceReady.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor is created, but before any callback being passed to the ckeditor() method.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;setData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is set into the editor.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;getData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is fetched from the editor. The current editor data is also passed in the arguments.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;destroy.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor gets destroyed. It can be used, for example, to execute some cleanup on the page.&lt;br /&gt;
&lt;br /&gt;
The editor instance is always passed as the first data argument for the listener. Both getData and setData are often used internally so listening to them should be done with care.&lt;br /&gt;
&lt;br /&gt;
jQuery events DO bubble up through the DOM, so they can be listened selectively on certain parts of the document.&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide&amp;diff=2830</id>
		<title>CKEditor 3.x/Developers Guide</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide&amp;diff=2830"/>
				<updated>2010-01-19T15:03:37Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#CUSTOMTITLE:CKEditor 3.x - Developer's Guide}} &lt;br /&gt;
&lt;br /&gt;
*[[CKEditor 3.x/Developers Guide/Installation|Installation]] &lt;br /&gt;
*[[CKEditor 3.x/Developers Guide/Integration|Integration]] &lt;br /&gt;
** [[CKEditor 3.x/Developers Guide/Integration/jQuery_Adapter|jQuery_Adapter]]&lt;br /&gt;
*Configuration &lt;br /&gt;
**[[CKEditor 3.x/Developers Guide/Setting Configurations|Setting Configurations]] &lt;br /&gt;
**[[CKEditor 3.x/Developers Guide/Toolbar|Toolbar]] &lt;br /&gt;
**[[CKEditor_3.x/Developers_Guide/Styles|Styles]] &lt;br /&gt;
**[[CKEditor 3.x/Developers Guide/Output Formatting|Output Formatting]] &lt;br /&gt;
**[[CKEditor 3.x/Developers Guide/Templates|Templates]]&lt;br /&gt;
**Spell Checker &lt;br /&gt;
**[[CKEditor 3.x/Developers Guide/File Browser (Uploader)|File Browser/Uploader ]] &lt;br /&gt;
*Customization &lt;br /&gt;
**Plugins &lt;br /&gt;
**Skins &lt;br /&gt;
*Advanced Tasks&lt;br /&gt;
**[[CKEditor_3.x/Developers_Guide/Editor_Core_URLs_Manipulation|Editor Core URLs Manipulation]]&lt;br /&gt;
*Deployment &lt;br /&gt;
*[http://docs.cksource.com/ckeditor_api/ JavaScript API] &lt;br /&gt;
*[[FCKeditor 3.x/Design and Architecture|Design and Architecture]]&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/jQuery_Adapter&amp;diff=2829</id>
		<title>CKEditor 3.x/jQuery Adapter</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/jQuery_Adapter&amp;diff=2829"/>
				<updated>2010-01-19T15:01:05Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: moved CKEditor 3.x/jQuery Adapter to CKEditor 3.x/Developers Guide/Integration/jQuery Adapter:&amp;amp;#32;Fixed category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[CKEditor 3.x/Developers Guide/Integration/jQuery Adapter]]&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2828</id>
		<title>CKEditor 3.x/Developers Guide/jQuery Adapter</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2828"/>
				<updated>2010-01-19T15:01:05Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: moved CKEditor 3.x/jQuery Adapter to CKEditor 3.x/Developers Guide/Integration/jQuery Adapter:&amp;amp;#32;Fixed category.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The CKEditor jQuery Adapter provides deep integration into the jQuery JavaScript Library of the CKEditor, using native library's features&lt;br /&gt;
&lt;br /&gt;
== Creating editor instances ==&lt;br /&gt;
To create editor instances, other than the usual CKEditor core script, you need to load the jQuery Adapter file in the page, in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source language=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/ckeditor.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/adapters/jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, any textarea, p or div element can be transformed into a rich text editor by simply using the ckeditor() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( 'textarea.editor' ).ckeditor();&amp;lt;/source&amp;gt;&lt;br /&gt;
jQuery chaining can also be used:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( '.section-x' )&lt;br /&gt;
    .find( 'textarea.editor' )&lt;br /&gt;
        .ckeditor()&lt;br /&gt;
    .end()&lt;br /&gt;
    .find( 'a' )&lt;br /&gt;
        .addClass( 'mylink' )&lt;br /&gt;
    .end();&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ckeditor() is the main method in the jQuery adapter. It accepts two optional parameters:&lt;br /&gt;
 * A '''callback function''' to be execute when the editor is ready.&lt;br /&gt;
 * '''Configuration options''' specific to the created editor instance.&lt;br /&gt;
&lt;br /&gt;
The [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html configurations options] are passed through a simple object containing properties, each one related to a specific editor setting.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$('.jquery_ckeditor')&lt;br /&gt;
    .ckeditor( function() { /* callback code */ }, { skin : 'office2003' } );&lt;br /&gt;
    .ckeditor( callback2 );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Code above won't create 2 editors - it will discover that one is already during creation and wait with the second callback. Each of those callbacks will be executed in context of the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object (so &amp;quot;this&amp;quot; will be the editor) and the DOM element object will be passed as parameter.&lt;br /&gt;
&lt;br /&gt;
== Code interaction with editor instances== &lt;br /&gt;
As soon as an editor instance is ready (after the above callback call), the ckeditorGet() method can then be used to retrieve a [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object that represents an editor instance. For example:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;var editor = $('.jquery_ckeditor').ckeditorGet();&lt;br /&gt;
alert( editor.checkDirty() );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because setting and retrieving the editor data is a common operation, the jQuery Adapter also provides the dedicated val() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;// Get the editor data.&lt;br /&gt;
var data = $( 'textarea.editor' ).val();&lt;br /&gt;
// Set the editor data.&lt;br /&gt;
$( 'textarea.editor' ).val( 'my new content' );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature can be disabled by setting CKEDITOR.config.jqueryOverrideVal to false, before loading the adapter code.&lt;br /&gt;
&lt;br /&gt;
For textareas, the editor will automatically return it's content back to the form when it is submitted. CKEditor also works with the official [http://jquery.malsup.com/form/ jQuery Form Plugin] for AJAX based forms. It doesn't require anything from the developer side.&lt;br /&gt;
&lt;br /&gt;
== Events handling ==&lt;br /&gt;
Although CKEditor uses its own event system, there are four main events which we're exposing to the jQuery event system. All events use the event namespace, which is simply named &amp;amp;quot;.ckeditor&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The following events are available:&lt;br /&gt;
 * &amp;lt;strong&amp;gt;instanceReady.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor is created, but before any callback being passed to the ckeditor() method.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;setData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is set into the editor.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;getData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is fetched from the editor. The current editor data is also passed in the arguments.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;destroy.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor gets destroyed. It can be used, for example, to execute some cleanup on the page.&lt;br /&gt;
&lt;br /&gt;
The editor instance is always passed as the first data argument for the listener. Both getData and setData are often used internally so listening to them should be done with care.&lt;br /&gt;
&lt;br /&gt;
jQuery events DO bubble up through the DOM, so they can be listened selectively on certain parts of the document.&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2827</id>
		<title>CKEditor 3.x/Developers Guide/jQuery Adapter</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/jQuery_Adapter&amp;diff=2827"/>
				<updated>2010-01-19T14:59:13Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: jQuery adapter for CKEditor.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The CKEditor jQuery Adapter provides deep integration into the jQuery JavaScript Library of the CKEditor, using native library's features&lt;br /&gt;
&lt;br /&gt;
== Creating editor instances ==&lt;br /&gt;
To create editor instances, other than the usual CKEditor core script, you need to load the jQuery Adapter file in the page, in the following order:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source language=&amp;quot;html&amp;quot;&amp;gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/ckeditor.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/ckeditor/adapters/jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At this point, any textarea, p or div element can be transformed into a rich text editor by simply using the ckeditor() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( 'textarea.editor' ).ckeditor();&amp;lt;/source&amp;gt;&lt;br /&gt;
jQuery chaining can also be used:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$( '.section-x' )&lt;br /&gt;
    .find( 'textarea.editor' )&lt;br /&gt;
        .ckeditor()&lt;br /&gt;
    .end()&lt;br /&gt;
    .find( 'a' )&lt;br /&gt;
        .addClass( 'mylink' )&lt;br /&gt;
    .end();&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ckeditor() is the main method in the jQuery adapter. It accepts two optional parameters:&lt;br /&gt;
 * A '''callback function''' to be execute when the editor is ready.&lt;br /&gt;
 * '''Configuration options''' specific to the created editor instance.&lt;br /&gt;
&lt;br /&gt;
The [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html configurations options] are passed through a simple object containing properties, each one related to a specific editor setting.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;$('.jquery_ckeditor')&lt;br /&gt;
    .ckeditor( function() { /* callback code */ }, { skin : 'office2003' } );&lt;br /&gt;
    .ckeditor( callback2 );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Code above won't create 2 editors - it will discover that one is already during creation and wait with the second callback. Each of those callbacks will be executed in context of the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object (so &amp;quot;this&amp;quot; will be the editor) and the DOM element object will be passed as parameter.&lt;br /&gt;
&lt;br /&gt;
== Code interaction with editor instances== &lt;br /&gt;
As soon as an editor instance is ready (after the above callback call), the ckeditorGet() method can then be used to retrieve a [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html CKEDITOR.editor] object that represents an editor instance. For example:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;var editor = $('.jquery_ckeditor').ckeditorGet();&lt;br /&gt;
alert( editor.checkDirty() );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Because setting and retrieving the editor data is a common operation, the jQuery Adapter also provides the dedicated val() method:&lt;br /&gt;
&amp;lt;source language=&amp;quot;js&amp;quot;&amp;gt;// Get the editor data.&lt;br /&gt;
var data = $( 'textarea.editor' ).val();&lt;br /&gt;
// Set the editor data.&lt;br /&gt;
$( 'textarea.editor' ).val( 'my new content' );&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This feature can be disabled by setting CKEDITOR.config.jqueryOverrideVal to false, before loading the adapter code.&lt;br /&gt;
&lt;br /&gt;
For textareas, the editor will automatically return it's content back to the form when it is submitted. CKEditor also works with the official [http://jquery.malsup.com/form/ jQuery Form Plugin] for AJAX based forms. It doesn't require anything from the developer side.&lt;br /&gt;
&lt;br /&gt;
== Events handling ==&lt;br /&gt;
Although CKEditor uses its own event system, there are four main events which we're exposing to the jQuery event system. All events use the event namespace, which is simply named &amp;amp;quot;.ckeditor&amp;amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The following events are available:&lt;br /&gt;
 * &amp;lt;strong&amp;gt;instanceReady.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor is created, but before any callback being passed to the ckeditor() method.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;setData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is set into the editor.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;getData.ckeditor&amp;lt;/strong&amp;gt;: fired when data is fetched from the editor. The current editor data is also passed in the arguments.&lt;br /&gt;
 * &amp;lt;strong&amp;gt;destroy.ckeditor&amp;lt;/strong&amp;gt;: fired when the editor gets destroyed. It can be used, for example, to execute some cleanup on the page.&lt;br /&gt;
&lt;br /&gt;
The editor instance is always passed as the first data argument for the listener. Both getData and setData are often used internally so listening to them should be done with care.&lt;br /&gt;
&lt;br /&gt;
jQuery events DO bubble up through the DOM, so they can be listened selectively on certain parts of the document.&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/Setting_Configurations&amp;diff=2826</id>
		<title>CKEditor 3.x/Developers Guide/Setting Configurations</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/Setting_Configurations&amp;diff=2826"/>
				<updated>2010-01-19T14:19:27Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The editor comes with a rich set of configurations that makes it possible to customize its appearance, features and behavior. The main configuration file is named &amp;quot;config.js&amp;quot;. You can find this file in the root of the CKEditor installation folder. &lt;br /&gt;
&lt;br /&gt;
== Available Configuration Options  ==&lt;br /&gt;
&lt;br /&gt;
All available configuration options can be found inside our API documentation, inside the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html CKEDITOR.config] object definition. &lt;br /&gt;
&lt;br /&gt;
== Defining Configurations In-Page  ==&lt;br /&gt;
&lt;br /&gt;
The best way to set your configurations is in-page, when creating editor instances. In this way you avoid touching the original distribution files in the CKEditor installation folder, making the upgrade task easier. &lt;br /&gt;
&lt;br /&gt;
In-page settings can be passed to any of the editor instance creation functions, namely [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replace CKEDITOR.replace] and [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.appendTo CKEDITOR.appendTo]. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.replace( 'editor1',&lt;br /&gt;
    {&lt;br /&gt;
        toolbar : 'Basic',&lt;br /&gt;
        uiColor : '#9AB8F3'&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
Note that the configurations are passed through a literal object definition (starting with &amp;quot;{&amp;quot; and ending with &amp;quot;}&amp;quot;). Because of this, the proper syntax for each option is (configuration name) + &amp;quot;:&amp;quot; + (configuration value). Be sure to not use the equal sign (&amp;quot;=&amp;quot;) sign. &lt;br /&gt;
&lt;br /&gt;
== Using the config.js File  ==&lt;br /&gt;
&lt;br /&gt;
You can also place your settings inside the config.js file also. You will note that the file is mostly empty by default. You simply need to add the configurations that you want to change. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.editorConfig = function( config )&lt;br /&gt;
{&lt;br /&gt;
    config.language = 'fr';&lt;br /&gt;
    config.uiColor = '#AADC6E';&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The above CKEDITOR.editorConfig function definition must be always defined so the settings can be applied. This configuration file will be executed in your page scope, so you can also make references to variables defined in-page or even in another JavaScript files. &lt;br /&gt;
&lt;br /&gt;
== Using a Custom Configuration File  ==&lt;br /&gt;
&lt;br /&gt;
This is another recommended way to set your configurations. Instead of using the default config.js file, you create a copy of that file anywhere in your web site and simply point your editor instances to load it. The advantage of it is that you avoid changing the original file, making it easy to upgrade CKEditor later, by simply overwriting all files. &lt;br /&gt;
&lt;br /&gt;
Suppose you have copied config,js inside a folder named &amp;quot;custom&amp;quot; in the root of your web site. You have also renamed the file to &amp;quot;ckeditor_config.js&amp;quot;. At that point, you must only set the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.customConfig customConfig] setting when creating the editor instances. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.replace( 'editor1',&lt;br /&gt;
    {&lt;br /&gt;
        customConfig : '/custom/ckeditor_config.js'&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your custom configuration file must look just like the default config.js file. &lt;br /&gt;
&lt;br /&gt;
== Configurations Overload Order  ==&lt;br /&gt;
&lt;br /&gt;
You're not required to use only one of the above configuration options. You can mix all of them, and the configurations will be overloaded properly. The following is configurations loading order when creating an editor instance: &lt;br /&gt;
&lt;br /&gt;
#The editor instance is created. At this point all its default configurations are set. &lt;br /&gt;
#If the customConfig setting has been set &amp;quot;in-page&amp;quot;, that file is loaded, otherwise the default config.js file is loaded. All settings in this file override the current instance settings. &lt;br /&gt;
#If the settings loaded in point &amp;quot;2&amp;quot; also define a new customConfig value, this new file is loaded and its settings overload the current instance settings. This happens recursively for all files until no customConfig is defined. &lt;br /&gt;
#Finally the settings defined &amp;quot;in-page&amp;quot; override the current instance settings (except customConfig, which has been used at point &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Avoiding Loading External Settings Files ==&lt;br /&gt;
&lt;br /&gt;
It is also possible to completely avoid loading an external configuration file, reducing the number of files loaded. To do that, it's enough to set the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.customConfig customConfig] setting to an empty string. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.replace( 'editor1',&lt;br /&gt;
    {&lt;br /&gt;
        customConfig : ''&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This setting is definitely recommended if you are not setting configurations in the config.js file nor a custom configuration file.&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/Setting_Configurations&amp;diff=2825</id>
		<title>CKEditor 3.x/Developers Guide/Setting Configurations</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Developers_Guide/Setting_Configurations&amp;diff=2825"/>
				<updated>2010-01-19T13:22:01Z</updated>
		
		<summary type="html">&lt;p&gt;TobiaszCudnik: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The editor comes with a rich set of configurations that makes it possible to customize its appearance, features and behavior. The main configuration file is named &amp;quot;config.js&amp;quot;. You can find this file in the root of the CKEditor installation folder. &lt;br /&gt;
&lt;br /&gt;
== Available Configuration Options  ==&lt;br /&gt;
&lt;br /&gt;
All available configuration options can be found inside our API documentation, inside the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html CKEDITOR.config] object definition. &lt;br /&gt;
&lt;br /&gt;
== Defining Configurations In-Page  ==&lt;br /&gt;
&lt;br /&gt;
The best way to set your configurations is in-page, when creating editor instances. In this way you avoid touching the original distribution files in the CKEditor installation folder, making the upgrade task easier. &lt;br /&gt;
&lt;br /&gt;
In-page settings can be passed to any of the editor instance creation functions, namely [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.replace CKEDITOR.replace] and [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.appendTo CKEDITOR.appendTo]. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.replace( 'editor1',&lt;br /&gt;
    {&lt;br /&gt;
        toolbar&amp;amp;nbsp;: 'Basic',&lt;br /&gt;
        uiColor&amp;amp;nbsp;: '#9AB8F3'&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/source&amp;gt; &lt;br /&gt;
Note that the configurations are passed through a literal object definition (starting with &amp;quot;{&amp;quot; and ending with &amp;quot;}&amp;quot;). Because of this, the proper syntax for each option is (configuration name) + &amp;quot;:&amp;quot; + (configuration value). Be sure to not use the equal sign (&amp;quot;=&amp;quot;) sign. &lt;br /&gt;
&lt;br /&gt;
== Using the config.js File  ==&lt;br /&gt;
&lt;br /&gt;
You can also place your settings inside the config.js file also. You will note that the file is mostly empty by default. You simply need to add the configurations that you want to change. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.editorConfig = function( config )&lt;br /&gt;
{&lt;br /&gt;
    config.language = 'fr';&lt;br /&gt;
    config.uiColor = '#AADC6E';&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The above CKEDITOR.editorConfig function definition must be always defined so the settings can be applied. This configuration file will be executed in your page scope, so you can also make references to variables defined in-page or even in another JavaScript files. &lt;br /&gt;
&lt;br /&gt;
== Using a Custom Configuration File  ==&lt;br /&gt;
&lt;br /&gt;
This is another recommended way to set your configurations. Instead of using the default config.js file, you create a copy of that file anywhere in your web site and simply point your editor instances to load it. The advantage of it is that you avoid changing the original file, making it easy to upgrade CKEditor later, by simply overwriting all files. &lt;br /&gt;
&lt;br /&gt;
Suppose you have copied config,js inside a folder named &amp;quot;custom&amp;quot; in the root of your web site. You have also renamed the file to &amp;quot;ckeditor_config.js&amp;quot;. At that point, you must only set the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.customConfig customConfig] setting when creating the editor instances. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.replace( 'editor1',&lt;br /&gt;
    {&lt;br /&gt;
        customConfig&amp;amp;nbsp;: '/custom/ckeditor_config.js'&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Your custom configuration file must look just like the default config.js file. &lt;br /&gt;
&lt;br /&gt;
== Configurations Overload Order  ==&lt;br /&gt;
&lt;br /&gt;
You're not required to use only one of the above configuration options. You can mix all of them, and the configurations will be overloaded properly. The following is configurations loading order when creating an editor instance: &lt;br /&gt;
&lt;br /&gt;
#The editor instance is created. At this point all its default configurations are set. &lt;br /&gt;
#If the customConfig setting has been set &amp;quot;in-page&amp;quot;, that file is loaded, otherwise the default config.js file is loaded. All settings in this file override the current instance settings. &lt;br /&gt;
#If the settings loaded in point &amp;quot;2&amp;quot; also define a new customConfig value, this new file is loaded and its settings overload the current instance settings. This happens recursively for all files until no customConfig is defined. &lt;br /&gt;
#Finally the settings defined &amp;quot;in-page&amp;quot; override the current instance settings (except customConfig, which has been used at point &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
== Avoiding Loading External Settings Files ==&lt;br /&gt;
&lt;br /&gt;
It is also possible to completely avoid loading an external configuration file, reducing the number of files loaded. To do that, it's enough to set the [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.customConfig customConfig] setting to an empty string. For example: &lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;CKEDITOR.replace( 'editor1',&lt;br /&gt;
    {&lt;br /&gt;
        customConfig&amp;amp;nbsp;: ''&lt;br /&gt;
    });&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
This setting is definitely recommended if you are not setting configurations in the config.js file nor a custom configuration file.&lt;/div&gt;</summary>
		<author><name>TobiaszCudnik</name></author>	</entry>

	</feed>