<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://docs-old.ckeditor.com/index.php?action=history&amp;feed=atom&amp;title=CKEditor_3.x%2FTutorials%2FSimpleLink_Plugin_Part_1</id>
		<title>CKEditor 3.x/Tutorials/SimpleLink Plugin Part 1 - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://docs-old.ckeditor.com/index.php?action=history&amp;feed=atom&amp;title=CKEditor_3.x%2FTutorials%2FSimpleLink_Plugin_Part_1"/>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/SimpleLink_Plugin_Part_1&amp;action=history"/>
		<updated>2026-05-17T20:26:16Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/SimpleLink_Plugin_Part_1&amp;diff=6473&amp;oldid=prev</id>
		<title>Fredck: Minor code fixes.</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/SimpleLink_Plugin_Part_1&amp;diff=6473&amp;oldid=prev"/>
				<updated>2011-09-13T09:03:39Z</updated>
		
		<summary type="html">&lt;p&gt;Minor code fixes.&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 09:03, 13 September 2011&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l32&quot; &gt;Line 32:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 32:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// Plugin logic goes here...&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		// Plugin logic goes here...&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;} );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All CKEditor plugins are created by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.resourceManager.html#add CKEDITOR.plugins.add]&amp;lt;/code&amp;gt; function. This function should contain the plugin name (&amp;lt;code&amp;gt;'simpleLink'&amp;lt;/code&amp;gt;) and the plugin logic placed inside the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.pluginDefinition.html#init init]&amp;lt;/code&amp;gt; function that is called upon the initialization of the editor instance.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;All CKEditor plugins are created by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.resourceManager.html#add CKEDITOR.plugins.add]&amp;lt;/code&amp;gt; function. This function should contain the plugin name (&amp;lt;code&amp;gt;'simpleLink'&amp;lt;/code&amp;gt;) and the plugin logic placed inside the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.pluginDefinition.html#init init]&amp;lt;/code&amp;gt; function that is called upon the initialization of the editor instance.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l52&quot; &gt;Line 52:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 52:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	command: 'simpleLinkDialog',&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	command: 'simpleLinkDialog',&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	icon: this.path + 'images/icon.png'&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	icon: this.path + 'images/icon.png'&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;} );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l63&quot; &gt;Line 63:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 63:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;//&amp;lt;![CDATA[&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	// Replace the &amp;lt;textarea id=&amp;quot;editor1&amp;quot;&amp;gt; with a CKEditor instance using default configuration.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	// Replace the &amp;lt;textarea id=&amp;quot;editor1&amp;quot;&amp;gt; with a CKEditor instance using default configuration.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	CKEDITOR.replace( 'editor1',&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	CKEDITOR.replace( 'editor1',&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l74&quot; &gt;Line 74:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 74:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		});&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;//]]&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/script&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l121&quot; &gt;Line 121:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 121:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;,&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	};&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	};&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;} );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The result of this change can be seen immediately. Click the '''Insert a Link''' toolbar button in order to open the newly created (and so far empty) '''Link Properties''' dialog window.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The result of this change can be seen immediately. Click the '''Insert a Link''' toolbar button in order to open the newly created (and so far empty) '''Link Properties''' dialog window.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l500&quot; &gt;Line 500:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 500:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;				}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			};&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;			};&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		} );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;		});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;	}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;} );&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;});&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/source&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ckeditor_docsold:diff:version:1.11a:oldid:6316:newid:6473 --&gt;
&lt;/table&gt;</summary>
		<author><name>Fredck</name></author>	</entry>

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/SimpleLink_Plugin_Part_1&amp;diff=6316&amp;oldid=prev</id>
		<title>Anna: Article contents added</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/SimpleLink_Plugin_Part_1&amp;diff=6316&amp;oldid=prev"/>
				<updated>2011-05-20T13:44:38Z</updated>
		
		<summary type="html">&lt;p&gt;Article contents added&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{#CUSTOMTITLE:Creating a CKEditor Plugin with a Custom Dialog Window}}&lt;br /&gt;
__TOC__&lt;br /&gt;
The aim of this tutorial is to demonstrate how to create a custom plugin dialog window that contains various types of fields.&lt;br /&gt;
 &lt;br /&gt;
We are going to develop a '''Simple Link plugin''' that can replace the more feature-rich default [[CKEditor_3.x/Users_Guide/Rich_Text/Links|Link]] feature of CKEditor with a simplified solution. The plugin dialog window will let the user insert a link through a customized dialog window that is opened after clicking a dedicated toolbar button.&lt;br /&gt;
&lt;br /&gt;
The plugin will be named &amp;lt;code&amp;gt;'''simpleLink'''&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Plugin Files ==&lt;br /&gt;
Firstly, we will need to create the &amp;lt;code&amp;gt;simpleLink&amp;lt;/code&amp;gt; folder inside the &amp;lt;code&amp;gt;plugins&amp;lt;/code&amp;gt; directory of the CKEditor installation.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;Remember that for CKEditor the name of the plugin folder is important and has to be the same as the name of the plugin, otherwise the editor will not be able to recognize it.&amp;lt;/note&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Inside the newly created &amp;lt;code&amp;gt;simpleLink&amp;lt;/code&amp;gt; folder we are going to place the &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; file that will contain the plugin logic. Apart from that, since we will also need a toolbar icon for our plugin, we are going to add an &amp;lt;code&amp;gt;images&amp;lt;/code&amp;gt; folder and subsequently place the &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt; file inside.&lt;br /&gt;
&lt;br /&gt;
To sum up, we will need the following file structure for our plugin to work:&lt;br /&gt;
* &amp;lt;code&amp;gt;''ckeditor root''&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;plugins&amp;lt;/code&amp;gt;&lt;br /&gt;
*** &amp;lt;code&amp;gt;simpleLink&amp;lt;/code&amp;gt;&lt;br /&gt;
**** &amp;lt;code&amp;gt;images&amp;lt;/code&amp;gt;&lt;br /&gt;
***** &amp;lt;code&amp;gt;icon.png&amp;lt;/code&amp;gt;&lt;br /&gt;
**** &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Plugin Source Code ==&lt;br /&gt;
With the following structure ready, it is time to open the &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; file in a text editor and to start creating the source code of the plugin.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
CKEDITOR.plugins.add( 'simpleLink',&lt;br /&gt;
{&lt;br /&gt;
	init: function( editor )&lt;br /&gt;
	{&lt;br /&gt;
		// Plugin logic goes here...&lt;br /&gt;
	}&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
All CKEditor plugins are created by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.resourceManager.html#add CKEDITOR.plugins.add]&amp;lt;/code&amp;gt; function. This function should contain the plugin name (&amp;lt;code&amp;gt;'simpleLink'&amp;lt;/code&amp;gt;) and the plugin logic placed inside the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.pluginDefinition.html#init init]&amp;lt;/code&amp;gt; function that is called upon the initialization of the editor instance.&lt;br /&gt;
&lt;br /&gt;
=== Creating an Editor Command ===&lt;br /&gt;
We want our plugin to have a dialog window, so we need to define an editor command that opens a new dialog window. To do this,  we will need to use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#addCommand  addCommand]&amp;lt;/code&amp;gt; function opening the &amp;lt;code&amp;gt;simpleLinkDialog&amp;lt;/code&amp;gt; window that we are going to define in a moment by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialogCommand.html CKEDITOR.dialogCommand]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
editor.addCommand( 'simpleLinkDialog', new CKEDITOR.dialogCommand( 'simpleLinkDialog' ) );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating a Toolbar Button ===&lt;br /&gt;
The plugin dialog window is to be opened by using a toolbar button. To this end, we need to define a button that will be associated with the dialog window. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.html#addButton CKEditor.ui.addButton]&amp;lt;/code&amp;gt; function accepts a button name (&amp;lt;code&amp;gt;'SimpleLink'&amp;lt;/code&amp;gt;) along with the definition of the tooltip text (&amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;) and the button icon (&amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt;). Note that &amp;lt;code&amp;gt;this.path&amp;lt;/code&amp;gt; is the directory where the &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; file resides.&lt;br /&gt;
&lt;br /&gt;
These parameters are responsible for the button presentation. To make the button actually work, we need to connect it to the plugin command name defined above by using the &amp;lt;code&amp;gt;command&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
editor.ui.addButton( 'SimpleLink',&lt;br /&gt;
{&lt;br /&gt;
	label: 'Insert a Link',&lt;br /&gt;
	command: 'simpleLinkDialog',&lt;br /&gt;
	icon: this.path + 'images/icon.png'&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CKEditor Initialization ===&lt;br /&gt;
It is now time to initialize a CKEditor instance that will use the Simple Link plugin along with its toolbar button.&lt;br /&gt;
&lt;br /&gt;
To register the plugin with CKEditor, we have to add it to the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.extraPlugins extraPlugins]&amp;lt;/code&amp;gt; list. We also need to enhance the toolbar definition and add the plugin button by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.toolbar toolbar]&amp;lt;/code&amp;gt; parameter. &lt;br /&gt;
&lt;br /&gt;
Open the page that will contain CKEditor in a text editor, and insert a CKEditor instance using the following toolbar and plugin configuration.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
//&amp;lt;![CDATA[&lt;br /&gt;
	// Replace the &amp;lt;textarea id=&amp;quot;editor1&amp;quot;&amp;gt; with a CKEditor instance using default configuration.&lt;br /&gt;
	CKEDITOR.replace( 'editor1',&lt;br /&gt;
		{&lt;br /&gt;
			extraPlugins : 'simpleLink',&lt;br /&gt;
			toolbar :&lt;br /&gt;
			[&lt;br /&gt;
				['Source', '-', 'Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],&lt;br /&gt;
				['About','-','SimpleLink']&lt;br /&gt;
			]&lt;br /&gt;
		});&lt;br /&gt;
//]]&amp;gt;&lt;br /&gt;
&amp;lt;/script&amp;gt;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After you load the page containing the above CKEditor instance you should be able to see the new plugin toolbar button along with its tooltip.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_button_added.png|center|frame|SimpleLink plugin button added to CKEditor toolbar]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugin Dialog Window ===&lt;br /&gt;
Up till now, most of the actions that we performed were equivalent to what we did while creating the [[CKEditor_3.x/Developers_Guide/Customization/Plugins/Abbr_Plugin_Part_1|Abbreviation]] plugin. Here is, however, where the really interesting part begins. We will now move on to creating a custom dialog window along with its contents.&lt;br /&gt;
&lt;br /&gt;
Clicking the button should open the &amp;lt;code&amp;gt;simpleLinkDialog&amp;lt;/code&amp;gt; dialog window. First, however, we need to return to the Simple Link plugin source file and [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html define the dialog window] by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#.add CKEDITOR.dialog.add]&amp;lt;/code&amp;gt; function. To see all dialog window definition elements, refer to [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html CKEditor JavaScript API].&lt;br /&gt;
&lt;br /&gt;
In our case we will give the dialog window a name (&amp;lt;code&amp;gt;'simpleLinkDialog'&amp;lt;/code&amp;gt;) and use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html#title title]&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html#minWidth minWidth]&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html#minHeight minHeight]&amp;lt;/code&amp;gt; parameters to define its title and minimum dimensions, respectively.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;The name selected for the dialog window is the name that appears in the &amp;lt;code&amp;gt;addCommand&amp;lt;/code&amp;gt; function above.&lt;br /&gt;
&amp;lt;/note&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Dialog Window Tab ====&lt;br /&gt;
The dialog window should also contain some contents, so we will begin with adding a tab along with its label. In all CKEditor dialog windows the contents of a dialog window are defined iside the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html#contents contents]&amp;lt;/code&amp;gt; array. This array contains &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.contentDefinition.html CKEDITOR.dialog.contentDefinition]&amp;lt;/code&amp;gt; objects that consititute the tabs (or &amp;quot;content pages&amp;quot;) of a dialog window.&lt;br /&gt;
&lt;br /&gt;
We will give our dialog window tab an &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.contentDefinition.html#id id]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.contentDefinition.html#label label]&amp;lt;/code&amp;gt;. Please note that since in our case the dialog window contains just one tab (or &amp;quot;page&amp;quot;), the tab's name (label) will not be visible. However, even though the &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; property is not required, it is a good practice to include it since it plays its role in accessibility support as it will be read aloud by screen readers.&lt;br /&gt;
&lt;br /&gt;
Note that by default CKEditor also adds the standard '''OK''' and '''Cancel''' buttons. If you want to customize them (i.e. remove both or just one, add custom ones), you can use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.html#buttons buttons]&amp;lt;/code&amp;gt; array to add new &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.button.html button]&amp;lt;/code&amp;gt; elements.&lt;br /&gt;
&lt;br /&gt;
A dialog window tab created in this way should also contain some real content, like text fields, checkboxes, or drop-down lists. These will be added in the next step inside the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.contentDefinition.html#elements elements]&amp;lt;/code&amp;gt; property.&lt;br /&gt;
&lt;br /&gt;
In order to create the Simple Link plugin dialog window, add the following code in the &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; file below the plugin toolbar button definition.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
CKEDITOR.dialog.add( 'simpleLinkDialog', function( editor )&lt;br /&gt;
{&lt;br /&gt;
	return {&lt;br /&gt;
		title : 'Link Properties',&lt;br /&gt;
		minWidth : 400,&lt;br /&gt;
		minHeight : 200,&lt;br /&gt;
		contents :&lt;br /&gt;
		[&lt;br /&gt;
			{&lt;br /&gt;
				id : 'general',&lt;br /&gt;
				label : 'Settings',&lt;br /&gt;
				elements :&lt;br /&gt;
				[&lt;br /&gt;
				 	// UI elements of the Settings tab.&lt;br /&gt;
				]&lt;br /&gt;
			}&lt;br /&gt;
		],&lt;br /&gt;
	};&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The result of this change can be seen immediately. Click the '''Insert a Link''' toolbar button in order to open the newly created (and so far empty) '''Link Properties''' dialog window.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_empty_tab.png|center|frame|A SimpleLink plugin dialog window with one tab added]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Dialog Window Tab Elements ====&lt;br /&gt;
User interface elements that can be added to a dialog window tab are defined in the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.contentDefinition.html#elements elements]&amp;lt;/code&amp;gt; parameter, which is an array of &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.uiElementDefinition.html CKEDITOR.dialog.uiElementDefinition]&amp;lt;/code&amp;gt; objects.&lt;br /&gt;
&lt;br /&gt;
Since we want to try a number of different types of dialog window UI elements, in this case the dialog window tab will consist of a larger textarea, smaller text field, a selection field (drop-down list), and a checkbox. We will also use HTML to create the tab description.&lt;br /&gt;
&lt;br /&gt;
Each UI element is added inside the &amp;lt;code&amp;gt;elements&amp;lt;/code&amp;gt; array, with the definition placed inside the curly braces (&amp;lt;code&amp;gt;{}&amp;lt;/code&amp;gt;), separated from one another with a comma. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.uiElementDefinition.html#type type]&amp;lt;/code&amp;gt; parameter is a required one and defines the type of the element.&lt;br /&gt;
&lt;br /&gt;
===== UI Elements: HTML =====&lt;br /&gt;
The first UI element we are going to use is the HTML type. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.html.html html]&amp;lt;/code&amp;gt; type allows you to define the contents of a dialog window page by using pure HTML code. The HTML code to be placed inside the page is entered in the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.html.html#constructor html]&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
elements :&lt;br /&gt;
[&lt;br /&gt;
	{&lt;br /&gt;
		type : 'html',&lt;br /&gt;
		html : 'This dialog window lets you create simple links for your website.'		&lt;br /&gt;
	}&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After adding the above code to the plugin source, the '''Link Properties''' dialog window looks like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_tab_html.png|center|frame|HTML element added in the SimpleLink plugin dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== UI Elements: Textarea =====&lt;br /&gt;
The element to be placed underneath the description is the textarea element that will be obligatory to fill in. We will use it to add the text that is displayed in the document and points to the inserted link.&lt;br /&gt;
&lt;br /&gt;
In order to create a textarea we will use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.textarea.html textarea]&amp;lt;/code&amp;gt; UI element type and assign it an &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.uiElementDefinition.html#id id]&amp;lt;/code&amp;gt;. The textarea will also need a label that will describe its purpose and can be added using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.labeledElement.html#constructor label]&amp;lt;/code&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
Since filling in the contents of the textarea will be obligatory, we will set the &amp;lt;code&amp;gt;required&amp;lt;/code&amp;gt; parameter to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and inside the &amp;lt;code&amp;gt;validate&amp;lt;/code&amp;gt; parameter add some simple validation that checks whether the field is empty. If it is, the validator will return an error message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	type : 'textarea',&lt;br /&gt;
	id : 'contents',&lt;br /&gt;
	label : 'Displayed Text',&lt;br /&gt;
	validate : CKEDITOR.dialog.validate.notEmpty( 'The Displayed Text field cannot be empty.' ),&lt;br /&gt;
	required : true&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is the appearance of the '''Link Properties''' dialog window after we apply the changes.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_tab_textarea.png|center|frame|Textarea element added in the SimpleLink plugin dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The size of the textarea can obviously be customized. If you want to change the element's dimensions, use the &amp;lt;code&amp;gt;cols&amp;lt;/code&amp;gt; amd &amp;lt;code&amp;gt;rows&amp;lt;/code&amp;gt; parameters as defined in the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.textarea.html#constructor textarea]&amp;lt;/code&amp;gt; constructor.&lt;br /&gt;
&lt;br /&gt;
===== UI Elements: Text Field =====&lt;br /&gt;
Another UI element that we are going to use in the plugin is the text field (text input) element. We will use it to enter the Internet address of the linked page.&lt;br /&gt;
&lt;br /&gt;
A text field lets you enter text into a single-line field and is meant for shorter entries. Its definition is very similar to the textarea &amp;amp;mdash; the main difference lies in the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; parameter that is set to &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.textInput.html text]&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; parameters will be defined as done above. In our case this field is obligatory, so we will set its &amp;lt;code&amp;gt;required&amp;lt;/code&amp;gt; parameter to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt;. The validation code inside the &amp;lt;code&amp;gt;validate&amp;lt;/code&amp;gt; parameter will also be used to check whether the field was filled in. If it is empty, the validator will return an error message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	type : 'text',&lt;br /&gt;
	id : 'url',&lt;br /&gt;
	label : 'URL',&lt;br /&gt;
	validate : CKEDITOR.dialog.validate.notEmpty( 'The link must have a URL.' ),&lt;br /&gt;
	required : true&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the latest addition of the text field the '''Link Properties''' dialog window will look like this.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_tab_text.png|center|frame|Text field element added in the SimpleLink plugin dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== UI Elements: Selection Field =====&lt;br /&gt;
Another type of UI elements that we are going to try out is the selection field (drop-down list). In this case we will use it to allow the user to choose one of the pre-defined styles for the link text.&lt;br /&gt;
&lt;br /&gt;
To create a selection field we need to set the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; parameter of the element to &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.select.html select]&amp;lt;/code&amp;gt;. As before, we will add the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; parameters appropriate for this field. The items to be chosen from the selection list are defined inside the obligatory &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.select.html#constructor items]&amp;lt;/code&amp;gt; array that contains the values along with their displayed text. The first item defined in the list will be used by default; you can also use the &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; parameter to change this setting.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	type : 'select',&lt;br /&gt;
	id : 'style',&lt;br /&gt;
	label : 'Style',&lt;br /&gt;
	items : &lt;br /&gt;
	[&lt;br /&gt;
		[ '&amp;lt;none&amp;gt;', '' ],&lt;br /&gt;
		[ 'Bold', 'b' ],&lt;br /&gt;
		[ 'Underline', 'u' ],&lt;br /&gt;
		[ 'Italics', 'i' ]&lt;br /&gt;
	]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After the selection field is added to the plugin dialog window and is expanded by the user, the style that was selected by default (the first one, if not defined otherwise) is highlighted.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_tab_select.png|center|frame|Selection field element added in the SimpleLink plugin dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===== UI Elements: Checkbox =====&lt;br /&gt;
The final UI element to be added to the plugin dialog window is the checkbox. In this case the user will be able to select it if the link is to be opened in a new window.&lt;br /&gt;
&lt;br /&gt;
In order to create a checkbox we need to set the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; parameter of the element to &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.dialog.checkbox.html checkbox]&amp;lt;/code&amp;gt;. As before, the field will also get a standard &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt;. Since we want opening in a new page to be a default behavior, we will set the &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; parameter to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; in order to have the checkbox selected when the plugin dialog window is opened.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;Please note that the &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; parameter needs to be placed in single quotes since it is a reserved JavaScript word.&lt;br /&gt;
&amp;lt;/note&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	type : 'checkbox',&lt;br /&gt;
	id : 'newPage',&lt;br /&gt;
	label : 'Opens in a new page',&lt;br /&gt;
	'default' : true&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The figure below shows the '''Link Properties''' dialog window complete with all the UI elements added above.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_tab_checkbox.png|center|frame|Checkbox element added in the SimpleLink plugin dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugin Behavior ===&lt;br /&gt;
The plugin now ''looks'' good &amp;amp;mdash; the toolbar button is in place and the dialog window is complete with a couple of sample UI elements. There is, however, one problem: it does not really ''do'' anything.&lt;br /&gt;
&lt;br /&gt;
We will start with creating the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html#onOk onOk]&amp;lt;/code&amp;gt; method that is invoked once the user accepts the changes introduced in the dialog window by clicking the '''OK''' button or pressing the ''Enter'' key on the keyboard. The method will be defined inside the &amp;lt;code&amp;gt;CKEDITOR.dialog.add&amp;lt;/code&amp;gt; function, below the definition of dialog window contents.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
onOk : function()&lt;br /&gt;
{&lt;br /&gt;
	// The code that will be executed when the user accepts the changes.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We shall start the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function from creating a link element and a &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; object that will store the data entered in the dialog window fields. The link will be based on a standard HTML &amp;lt;code&amp;gt;&amp;lt;a&amp;gt;&amp;lt;/code&amp;gt; element and as a new DOM element it will be created by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.document.html#createElement createElement]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var dialog = this,&lt;br /&gt;
	data = {},&lt;br /&gt;
	link = editor.document.createElement( 'a' );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to populate the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; object with the contents of the dialog window fields we will use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#commitContent commitContent]&amp;lt;/code&amp;gt; function. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
this.commitContent( data );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To make the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function work we will however first need to define the commit functions themselves. In order to do that, we will have to revise the code of the dialog window UI elements again.&lt;br /&gt;
&lt;br /&gt;
The commit functions will have to be added to all user input elements of the plugin dialog window &amp;amp;mdash; the textarea, the text field, the selection field, and the checkbox. In each case the functions need to get the value entered by the user by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#getValue getValue]&amp;lt;/code&amp;gt; function and assign it to an appropriate attribute of the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
elements :&lt;br /&gt;
[&lt;br /&gt;
	{&lt;br /&gt;
		type : 'html',&lt;br /&gt;
		html : 'This dialog window lets you create simple links for your website.'		&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		type : 'textarea',&lt;br /&gt;
		id : 'contents',&lt;br /&gt;
		label : 'Displayed Text',&lt;br /&gt;
		validate : CKEDITOR.dialog.validate.notEmpty( 'The Displayed Text field cannot be empty.' ),&lt;br /&gt;
		required : true,&lt;br /&gt;
		commit : function( data )&lt;br /&gt;
		{&lt;br /&gt;
			data.contents = this.getValue();&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		type : 'text',&lt;br /&gt;
		id : 'url',&lt;br /&gt;
		label : 'URL',&lt;br /&gt;
		validate : CKEDITOR.dialog.validate.notEmpty( 'The link must have a URL.' ),&lt;br /&gt;
		required : true,&lt;br /&gt;
		commit : function( data )&lt;br /&gt;
		{&lt;br /&gt;
			data.url = this.getValue();&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		type : 'select',&lt;br /&gt;
		id : 'style',&lt;br /&gt;
		label : 'Style',&lt;br /&gt;
		items : &lt;br /&gt;
		[&lt;br /&gt;
			[ '&amp;lt;none&amp;gt;', '' ],&lt;br /&gt;
			[ 'Bold', 'b' ],&lt;br /&gt;
			[ 'Underline', 'u' ],&lt;br /&gt;
			[ 'Italics', 'i' ]&lt;br /&gt;
		],&lt;br /&gt;
		commit : function( data )&lt;br /&gt;
		{&lt;br /&gt;
			data.style = this.getValue();&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		type : 'checkbox',&lt;br /&gt;
		id : 'newPage',&lt;br /&gt;
		label : 'Opens in a new page',&lt;br /&gt;
		'default' : true,&lt;br /&gt;
		commit : function( data )&lt;br /&gt;
		{&lt;br /&gt;
			data.newPage = this.getValue();&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now have the values entered in the plugin dialog window in the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; object. It is time to return to the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function and start building the contents of the &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; variable that contains the &amp;lt;code&amp;gt;&amp;lt;a&amp;gt;&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
The URL of the linked page will be added to the &amp;lt;code&amp;gt;&amp;lt;a&amp;gt;&amp;lt;/code&amp;gt; element by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setAttribute setAttribute]&amp;lt;/code&amp;gt; function to update the &amp;lt;code&amp;gt;href&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; object with the contents of the &amp;lt;code&amp;gt;url&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
link.setAttribute( 'href', data.url );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the checkbox setting the link to open in a new page (&amp;lt;code&amp;gt;newPage&amp;lt;/code&amp;gt;) was selected, we also need to set the &amp;lt;code&amp;gt;target&amp;lt;/code&amp;gt; attribute of the link to &amp;lt;code&amp;gt;_blank&amp;lt;/code&amp;gt; by using the &amp;lt;code&amp;gt;setAttribute&amp;lt;/code&amp;gt; function again.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ( data.newPage )&lt;br /&gt;
	link.setAttribute( 'target', '_blank' );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the user decided to apply one of the styles from the drop-down list to the link, we have to add this setting to the link element. We will use a JavaScript &amp;lt;code&amp;gt;switch&amp;lt;/code&amp;gt; statement to define the style setting based on the user's choice and use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setStyle setStyle]&amp;lt;/code&amp;gt; function to add an appropriate CSS stylesheet rule to the inline &amp;lt;code&amp;gt;style&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;link&amp;lt;/code&amp;gt; element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
switch( data.style )&lt;br /&gt;
{&lt;br /&gt;
	case 'b' :&lt;br /&gt;
		link.setStyle( 'font-weight', 'bold' );&lt;br /&gt;
	break;&lt;br /&gt;
	case 'u' :&lt;br /&gt;
		link.setStyle( 'text-decoration', 'underline' );&lt;br /&gt;
	break;&lt;br /&gt;
	case 'i' :&lt;br /&gt;
		link.setStyle( 'font-style', 'italic' );&lt;br /&gt;
	break;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We now need to insert the '''Displayed Text''' data (&amp;lt;code&amp;gt;contents&amp;lt;/code&amp;gt;) into the link, in between the &amp;lt;code&amp;gt;&amp;lt;a&amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;lt;/a&amp;gt;&amp;lt;/code&amp;gt; tags. In order to achieve this we will use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setHtml setHtml]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
link.setHtml( data.contents );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, the link object has to be inserted into the document, at the position of the cursor. We will use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertElement insertElement]&amp;lt;/code&amp;gt; function for that.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
editor.insertElement( link );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Full Source Code ==&lt;br /&gt;
To see the full contents of the &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; file, &amp;lt;hide target=&amp;quot;simpleLink_full&amp;quot;&amp;gt;click here&amp;lt;/hide&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;You can also [[Media:simpleLink.zip|download the whole plugin folder]] inluding the icon and the fully commented source code.&lt;br /&gt;
&amp;lt;/note&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div id=&amp;quot;simpleLink_full&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
CKEDITOR.plugins.add( 'simpleLink',&lt;br /&gt;
{&lt;br /&gt;
	init: function( editor )&lt;br /&gt;
	{&lt;br /&gt;
		editor.addCommand( 'simpleLinkDialog', new CKEDITOR.dialogCommand( 'simpleLinkDialog' ) );&lt;br /&gt;
		&lt;br /&gt;
		editor.ui.addButton( 'SimpleLink',&lt;br /&gt;
		{&lt;br /&gt;
			label: 'Insert a Link',&lt;br /&gt;
			command: 'simpleLinkDialog',&lt;br /&gt;
			icon: this.path + 'images/icon.png'&lt;br /&gt;
		} );&lt;br /&gt;
		&lt;br /&gt;
		CKEDITOR.dialog.add( 'simpleLinkDialog', function( editor )&lt;br /&gt;
		{&lt;br /&gt;
			return {&lt;br /&gt;
				title : 'Link Properties',&lt;br /&gt;
				minWidth : 400,&lt;br /&gt;
				minHeight : 200,&lt;br /&gt;
				contents :&lt;br /&gt;
				[&lt;br /&gt;
					{&lt;br /&gt;
						id : 'general',&lt;br /&gt;
						label : 'Settings',&lt;br /&gt;
						elements :&lt;br /&gt;
						[&lt;br /&gt;
							{&lt;br /&gt;
								type : 'html',&lt;br /&gt;
								html : 'This dialog window lets you create simple links for your website.'		&lt;br /&gt;
							},&lt;br /&gt;
							{&lt;br /&gt;
								type : 'textarea',&lt;br /&gt;
								id : 'contents',&lt;br /&gt;
								label : 'Displayed Text',&lt;br /&gt;
								validate : CKEDITOR.dialog.validate.notEmpty( 'The Displayed Text field cannot be empty.' ),&lt;br /&gt;
								required : true,&lt;br /&gt;
								commit : function( data )&lt;br /&gt;
								{&lt;br /&gt;
									data.contents = this.getValue();&lt;br /&gt;
								}&lt;br /&gt;
							},&lt;br /&gt;
							{&lt;br /&gt;
								type : 'text',&lt;br /&gt;
								id : 'url',&lt;br /&gt;
								label : 'URL',&lt;br /&gt;
								validate : CKEDITOR.dialog.validate.notEmpty( 'The link must have a URL.' ),&lt;br /&gt;
								required : true,&lt;br /&gt;
								commit : function( data )&lt;br /&gt;
								{&lt;br /&gt;
									data.url = this.getValue();&lt;br /&gt;
								}&lt;br /&gt;
							},&lt;br /&gt;
							{&lt;br /&gt;
								type : 'select',&lt;br /&gt;
								id : 'style',&lt;br /&gt;
								label : 'Style',&lt;br /&gt;
								items : &lt;br /&gt;
								[&lt;br /&gt;
									[ '&amp;lt;none&amp;gt;', '' ],&lt;br /&gt;
									[ 'Bold', 'b' ],&lt;br /&gt;
									[ 'Underline', 'u' ],&lt;br /&gt;
									[ 'Italics', 'i' ]&lt;br /&gt;
								],&lt;br /&gt;
								commit : function( data )&lt;br /&gt;
								{&lt;br /&gt;
									data.style = this.getValue();&lt;br /&gt;
								}&lt;br /&gt;
							},&lt;br /&gt;
							{&lt;br /&gt;
								type : 'checkbox',&lt;br /&gt;
								id : 'newPage',&lt;br /&gt;
								label : 'Opens in a new page',&lt;br /&gt;
								'default' : true,&lt;br /&gt;
								commit : function( data )&lt;br /&gt;
								{&lt;br /&gt;
									data.newPage = this.getValue();&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
						]&lt;br /&gt;
					}&lt;br /&gt;
				],&lt;br /&gt;
				onOk : function()&lt;br /&gt;
				{&lt;br /&gt;
					var dialog = this,&lt;br /&gt;
						data = {},&lt;br /&gt;
						link = editor.document.createElement( 'a' );&lt;br /&gt;
					this.commitContent( data );&lt;br /&gt;
					&lt;br /&gt;
					link.setAttribute( 'href', data.url );&lt;br /&gt;
					&lt;br /&gt;
					if ( data.newPage )&lt;br /&gt;
						link.setAttribute( 'target', '_blank' );&lt;br /&gt;
					&lt;br /&gt;
					switch( data.style )&lt;br /&gt;
					{&lt;br /&gt;
						case 'b' :&lt;br /&gt;
							link.setStyle( 'font-weight', 'bold' );&lt;br /&gt;
						break;&lt;br /&gt;
						case 'u' :&lt;br /&gt;
							link.setStyle( 'text-decoration', 'underline' );&lt;br /&gt;
						break;&lt;br /&gt;
						case 'i' :&lt;br /&gt;
							link.setStyle( 'font-style', 'italic' );&lt;br /&gt;
						break;&lt;br /&gt;
					}&lt;br /&gt;
					&lt;br /&gt;
					link.setHtml( data.contents );&lt;br /&gt;
					&lt;br /&gt;
					editor.insertElement( link );&lt;br /&gt;
				}&lt;br /&gt;
			};&lt;br /&gt;
		} );&lt;br /&gt;
	}&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Working Example ==&lt;br /&gt;
The plugin code is now ready. When you click the '''Insert Link''' toolbar button, the custom '''Link Properties''' dialog window will open. Fill in the obligatory '''Displayed Text''' and '''URL''' fields, and click the '''OK''' button. The checkbox configuring the link to open in a new window is checked by default, but you can uncheck it. You can also change the link style by choosing one of the options from the drop-down list.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_example1.png|center|frame|Link added in the plugin dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The newly added link will be inserted into the document and displayed with a style selected in the dialog window.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_example2.png|center|frame|Link added to the document]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you switched to '''Source''' view, you could see all the information from the plugin dialog window added as link contents and attributes.&lt;br /&gt;
&lt;br /&gt;
[[Image:simpleLink_example3.png|center|frame|Link element shown in the Source view]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further Enhancements ==&lt;br /&gt;
The SimpleLink plugin is now able to add a new link element to the document by using a custom and simplified dialog window, but does not make it possible to edit an already existing element by using the plugin dialog window. For tips on how to implement this feature along with the context menu support check the [[CKEditor 3.x/Tutorials/Abbr_Plugin_Part_2|Creating a Simple CKEditor Plugin, Part 2 ]] tutorial.&lt;/div&gt;</summary>
		<author><name>Anna</name></author>	</entry>

	</feed>