<?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%2FAbbr_Plugin_Part_1</id>
		<title>CKEditor 3.x/Tutorials/Abbr 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%2FAbbr_Plugin_Part_1"/>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_1&amp;action=history"/>
		<updated>2026-05-16T14:19:41Z</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/Abbr_Plugin_Part_1&amp;diff=6901&amp;oldid=prev</id>
		<title>Anna: &amp;lt;abbr&amp;gt; escaped</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_1&amp;diff=6901&amp;oldid=prev"/>
				<updated>2012-05-09T12:39:00Z</updated>
		
		<summary type="html">&lt;p&gt;&amp;lt;abbr&amp;gt; escaped&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 12:39, 9 May 2012&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-l3&quot; &gt;Line 3:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 3:&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 aim of this tutorial is to demonstrate how to create a basic CKEditor plugin.&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 aim of this tutorial is to demonstrate how to create a basic CKEditor plugin.&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;#160; &amp;#160;&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;#160; &amp;#160;&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;We are going to develop an '''abbreviation plugin''' that lets the user insert abbreviations into their documents. The abbreviations will be using the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; HTML element and will be added through a dialog window that is opened after clicking a dedicated toolbar button.&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;We are going to develop an '''abbreviation plugin''' that lets the user insert abbreviations into their documents. The abbreviations will be using the &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;abbr&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; HTML element and will be added through a dialog window that is opened after clicking a dedicated toolbar button.&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 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 plugin will be named &amp;lt;code&amp;gt;'''abbr'''&amp;lt;/code&amp;gt;, just like the name of the corresponding HTML element that we are going to use in its implementation.&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 plugin will be named &amp;lt;code&amp;gt;'''abbr'''&amp;lt;/code&amp;gt;, just like the name of the corresponding HTML element that we are going to use in its implementation.&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-l195&quot; &gt;Line 195:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 195:&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 presentation layer of the plugin is now ready, so we can define the plugin behavior to actually make it work.&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 presentation layer of the plugin is now ready, so we can define the plugin behavior to actually make it work.&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 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;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 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. Since the plugin adds a new &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element to the DOM tree, we can use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.document.html#createElement&amp;#160; createElement]&amp;lt;/code&amp;gt; function to create a new DOM element.&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;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 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. Since the plugin adds a new &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;abbr&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; element to the DOM tree, we can use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.document.html#createElement&amp;#160; createElement]&amp;lt;/code&amp;gt; function to create a new DOM element.&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 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;With the new DOM element created, we can now retrieve the values of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and (optional) &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; fields with the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#getValueOf getValueOf]&amp;lt;/code&amp;gt; function and pass them to appropriate &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element attributes by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setAttribute&amp;#160; setAttribute]&amp;lt;/code&amp;gt; function.&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;With the new DOM element created, we can now retrieve the values of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and (optional) &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; fields with the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#getValueOf getValueOf]&amp;lt;/code&amp;gt; function and pass them to appropriate &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;abbr&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; element attributes by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setAttribute&amp;#160; setAttribute]&amp;lt;/code&amp;gt; function.&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 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;Finally, we will pass the text entered in the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; text field as the contents of the &amp;lt;code&amp;gt;abbr&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#setText setText]&amp;lt;/code&amp;gt; function.&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;Finally, we will pass the text entered in the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; text field as the contents of the &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;abbr&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&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#setText setText]&amp;lt;/code&amp;gt; function.&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 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;With the contents of the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element ready, we can insert it into the document at the location of the cursor by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertElement insertElement]&amp;lt;/code&amp;gt; function.&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;With the contents of the &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;abbr&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; element ready, we can insert it into the document at the location of the cursor by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertElement insertElement]&amp;lt;/code&amp;gt; function.&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 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;Add the following &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function code to your dialog window definition, below the code that creates the contents of the dialog.&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;Add the following &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function code to your dialog window definition, below the code that creates the contents of the dialog.&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-l321&quot; &gt;Line 321:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 321:&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 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;== Further Enhancements ==&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;== Further Enhancements ==&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;The Abbreviation plugin is now able to add a new &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element to the document, but does not make it possible to edit an already existing element. For this feature along with the context menu support check the [[CKEditor 3.x/Tutorials/Abbr_Plugin_Part_2|second part of the tutorial]].&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;The Abbreviation plugin is now able to add a new &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;lt;&lt;/ins&gt;abbr&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;amp;gt;&lt;/ins&gt;&amp;lt;/code&amp;gt; element to the document, but does not make it possible to edit an already existing element. For this feature along with the context menu support check the [[CKEditor 3.x/Tutorials/Abbr_Plugin_Part_2|second part of the tutorial]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

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

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_1&amp;diff=6445&amp;oldid=prev</id>
		<title>Fredck: /* Creating an Editor Command */</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_1&amp;diff=6445&amp;oldid=prev"/>
				<updated>2011-08-10T11:01:56Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Creating an Editor Command&lt;/span&gt;&lt;/span&gt;&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 11:01, 10 August 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-l39&quot; &gt;Line 39:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 39:&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 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;=== Creating an Editor Command ===&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;=== Creating an Editor Command ===&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;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, &lt;del class=&quot;diffchange diffchange-inline&quot;&gt; &lt;/del&gt;we will need to use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#addCommand&amp;#160; addCommand]&amp;lt;/code&amp;gt; function &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;opening &lt;/del&gt;the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;window &lt;/del&gt;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; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;function&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;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&amp;#160; addCommand]&amp;lt;/code&amp;gt; function &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;to register &lt;/ins&gt;the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;command. That command opens the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; dialog &lt;/ins&gt;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; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;class&lt;/ins&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 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;−&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;editor.addCommand( 'abbrDialog',new CKEDITOR.dialogCommand( 'abbrDialog' ) );&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;editor.addCommand( 'abbrDialog', new CKEDITOR.dialogCommand( 'abbrDialog' ) );&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;!-- diff cache key ckeditor_docsold:diff:version:1.11a:oldid:6181:newid:6445 --&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/Abbr_Plugin_Part_1&amp;diff=6181&amp;oldid=prev</id>
		<title>Saare: Fixing a tutorial link</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_1&amp;diff=6181&amp;oldid=prev"/>
				<updated>2011-04-14T14:16:22Z</updated>
		
		<summary type="html">&lt;p&gt;Fixing a tutorial link&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 14:16, 14 April 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-l321&quot; &gt;Line 321:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 321:&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 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;== Further Enhancements ==&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;== Further Enhancements ==&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;The Abbreviation plugin is now able to add a new &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element to the document, but does not make it possible to edit an already existing element. For this feature along with the context menu support check the [[CKEditor 3.x/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Developers Guide&lt;/del&gt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Customization/Plugins/Abbr Plugin Part 2&lt;/del&gt;|second part of the tutorial]].&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;The Abbreviation plugin is now able to add a new &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element to the document, but does not make it possible to edit an already existing element. For this feature along with the context menu support check the [[CKEditor 3.x/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Tutorials&lt;/ins&gt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Abbr_Plugin_Part_2&lt;/ins&gt;|second part of the tutorial]].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

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

	<entry>
		<id>https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_1&amp;diff=6169&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/Abbr_Plugin_Part_1&amp;diff=6169&amp;oldid=prev"/>
				<updated>2011-04-14T13:06:02Z</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 Simple CKEditor Plugin}}&lt;br /&gt;
__TOC__&lt;br /&gt;
The aim of this tutorial is to demonstrate how to create a basic CKEditor plugin.&lt;br /&gt;
 &lt;br /&gt;
We are going to develop an '''abbreviation plugin''' that lets the user insert abbreviations into their documents. The abbreviations will be using the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; HTML element and will be added through a 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;'''abbr'''&amp;lt;/code&amp;gt;, just like the name of the corresponding HTML element that we are going to use in its implementation.&lt;br /&gt;
&lt;br /&gt;
== Plugin Files ==&lt;br /&gt;
Firstly, we will need to create the &amp;lt;code&amp;gt;abbr&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;abbr&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;abbr&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;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
CKEDITOR.plugins.add( 'abbr',&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;
&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;'abbr'&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;abbrDialog&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;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
editor.addCommand( 'abbrDialog',new CKEDITOR.dialogCommand( 'abbrDialog' ) );&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;'Abbr'&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;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
editor.ui.addButton( 'Abbr',&lt;br /&gt;
{&lt;br /&gt;
	label: 'Insert Abbreviation',&lt;br /&gt;
	command: 'abbrDialog',&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 Abbreviation 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;
&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&lt;br /&gt;
	// instance, using default configuration.&lt;br /&gt;
	CKEDITOR.replace( 'editor1',&lt;br /&gt;
		{&lt;br /&gt;
			extraPlugins : 'abbr',&lt;br /&gt;
			toolbar :&lt;br /&gt;
			[&lt;br /&gt;
				['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'],&lt;br /&gt;
				['About','-','Abbr']&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:abbr_button_added.png|center|frame|Abbreviation plugin button added to CKEditor toolbar]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugin Dialog Window ===&lt;br /&gt;
Clicking the button should open the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; dialog window. First, however, we need to return to the Abbreviation plugin source file and 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 the [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;'abbrDialog'&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 Tabs ====&lt;br /&gt;
The dialog window should also contain some [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.dialogDefinition.html#contents  contents], so we will begin with [http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.contentDefinition.html adding] two tabs along with their labels. Note that by default CKEditor also adds the standard '''OK''' and '''Cancel''' buttons.&lt;br /&gt;
&lt;br /&gt;
In order to create the Abbreviation plugin dialog window along with two tabs, 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( 'abbrDialog', function ( editor )&lt;br /&gt;
{&lt;br /&gt;
	return {&lt;br /&gt;
		title : 'Abbreviation Properties',&lt;br /&gt;
		minWidth : 400,&lt;br /&gt;
		minHeight : 200,&lt;br /&gt;
&lt;br /&gt;
		contents :&lt;br /&gt;
		[&lt;br /&gt;
			{&lt;br /&gt;
				id : 'tab1',&lt;br /&gt;
				label : 'Basic Settings',&lt;br /&gt;
				elements :&lt;br /&gt;
				[&lt;br /&gt;
					// UI elements of the first tab	will be defined here &lt;br /&gt;
				]&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				id : 'tab2',&lt;br /&gt;
				label : 'Advanced Settings',&lt;br /&gt;
				elements :&lt;br /&gt;
				[&lt;br /&gt;
					// UI elements of the second tab will be defined here&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 Abbreviation''' toolbar button in order to open the newly created '''Abbreviation Properties''' dialog window containing two (empty) tabs.&lt;br /&gt;
&lt;br /&gt;
[[Image:abbr_empty_tabs.png|center|frame|A plugin dialog window with two tabs added]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Dialog Window Tabs 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;
The '''Basic Settings''' tab will contain two mandatory text fields (&amp;lt;code&amp;gt;type : 'text'&amp;lt;/code&amp;gt;) with the abbreviation and its explanation. Since both fields are obligatory, it is useful to add a simple validation mechanism in order to ensure that the user fills them.&lt;br /&gt;
&lt;br /&gt;
The '''Advanced Settings''' tab will contain a single optional text field that allows the user to assign an &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; to the abbreviation element.&lt;br /&gt;
&lt;br /&gt;
The code snippet presented below shows a full definition of the contents of both plugin tabs.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
contents :&lt;br /&gt;
[&lt;br /&gt;
	{&lt;br /&gt;
		id : 'tab1',&lt;br /&gt;
		label : 'Basic Settings',&lt;br /&gt;
		elements :&lt;br /&gt;
		[&lt;br /&gt;
			{&lt;br /&gt;
				type : 'text',&lt;br /&gt;
				id : 'abbr',&lt;br /&gt;
				label : 'Abbreviation',&lt;br /&gt;
				validate : CKEDITOR.dialog.validate.notEmpty( &amp;quot;Abbreviation field cannot be empty&amp;quot; )&lt;br /&gt;
			},&lt;br /&gt;
			{&lt;br /&gt;
				type : 'text',&lt;br /&gt;
				id : 'title',&lt;br /&gt;
				label : 'Explanation',&lt;br /&gt;
				validate : CKEDITOR.dialog.validate.notEmpty( &amp;quot;Explanation field cannot be empty&amp;quot; )&lt;br /&gt;
			}	 &lt;br /&gt;
		]&lt;br /&gt;
	},&lt;br /&gt;
	{&lt;br /&gt;
		id : 'tab2',&lt;br /&gt;
		label : 'Advanced Settings',&lt;br /&gt;
		elements :&lt;br /&gt;
		[&lt;br /&gt;
			{&lt;br /&gt;
				type : 'text',&lt;br /&gt;
				id : 'id',&lt;br /&gt;
				label : 'Id'&lt;br /&gt;
			}&lt;br /&gt;
		]&lt;br /&gt;
	}&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When you reload the editor instance and open the '''Abbreviation Properties''' dialog window, the '''Basic Settings''' tab will now contain two mandatory text fields.&lt;br /&gt;
&lt;br /&gt;
[[Image:abbr_basic_settings_tab.png|center|frame|Basic Settings tab of the Abbreviation plugin]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The '''Advanced Settings''' tab only contains a single &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; text field that can be left empty.&lt;br /&gt;
&lt;br /&gt;
[[Image:abbr_advanced_settings_tab.png|center|frame|Advanced Settings tab of the Abbreviation plugin]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Plugin Behavior ===&lt;br /&gt;
The presentation layer of the plugin is now ready, so we can define the plugin behavior to actually make it work.&lt;br /&gt;
&lt;br /&gt;
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 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. Since the plugin adds a new &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element to the DOM tree, we can use 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 to create a new DOM element.&lt;br /&gt;
&lt;br /&gt;
With the new DOM element created, we can now retrieve the values of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; and (optional) &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; fields with the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#getValueOf getValueOf]&amp;lt;/code&amp;gt; function and pass them to appropriate &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element attributes 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.&lt;br /&gt;
&lt;br /&gt;
Finally, we will pass the text entered in the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; text field as the contents of the &amp;lt;code&amp;gt;abbr&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#setText setText]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
With the contents of the &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element ready, we can insert it into the document at the location of the cursor by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertElement insertElement]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
Add the following &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function code to your dialog window definition, below the code that creates the contents of the dialog.&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;
	var dialog = this;&lt;br /&gt;
	var abbr = editor.document.createElement( 'abbr' );&lt;br /&gt;
&lt;br /&gt;
	abbr.setAttribute( 'title', dialog.getValueOf( 'tab1', 'title' ) );&lt;br /&gt;
	abbr.setText( dialog.getValueOf( 'tab1', 'abbr' ) );&lt;br /&gt;
&lt;br /&gt;
	var id = dialog.getValueOf( 'tab2', 'id' );&lt;br /&gt;
	if ( id )&lt;br /&gt;
		abbr.setAttribute( 'id', id );&lt;br /&gt;
&lt;br /&gt;
	editor.insertElement( abbr );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;note&amp;gt;Please note that another way to insert HTML code into CKEditor is using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertHtml insertHtml]&amp;lt;/code&amp;gt; function that adds HTML code at the location of the cursor in the document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
editor.insertHtml( '&amp;lt;h2&amp;gt;This is a sample header&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;This is a sample paragraph.&amp;lt;/p&amp;gt;' );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;/note&amp;gt;&lt;br /&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;abbr_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:abbr.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;abbr_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( 'abbr',&lt;br /&gt;
{&lt;br /&gt;
	init: function( editor )&lt;br /&gt;
	{&lt;br /&gt;
		editor.addCommand( 'abbrDialog',new CKEDITOR.dialogCommand( 'abbrDialog' ) );&lt;br /&gt;
		editor.ui.addButton( 'Abbr',&lt;br /&gt;
		{&lt;br /&gt;
			label: 'Insert Abbreviation',&lt;br /&gt;
			command: 'abbrDialog',&lt;br /&gt;
			icon: this.path + 'images/icon.png'&lt;br /&gt;
		} );&lt;br /&gt;
		CKEDITOR.dialog.add( 'abbrDialog', function( editor )&lt;br /&gt;
		{&lt;br /&gt;
			return {&lt;br /&gt;
				title : 'Abbreviation 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 : 'tab1',&lt;br /&gt;
						label : 'Basic Settings',&lt;br /&gt;
						elements :&lt;br /&gt;
						[&lt;br /&gt;
							{&lt;br /&gt;
								type : 'text',&lt;br /&gt;
								id : 'abbr',&lt;br /&gt;
								label : 'Abbreviation',&lt;br /&gt;
								validate : CKEDITOR.dialog.validate.notEmpty( &amp;quot;Abbreviation field cannot be empty&amp;quot; )&lt;br /&gt;
							},&lt;br /&gt;
							{&lt;br /&gt;
								type : 'text',&lt;br /&gt;
								id : 'title',&lt;br /&gt;
								label : 'Explanation',&lt;br /&gt;
								validate : CKEDITOR.dialog.validate.notEmpty( &amp;quot;Explanation field cannot be empty&amp;quot; )&lt;br /&gt;
							}	 &lt;br /&gt;
						]&lt;br /&gt;
					},&lt;br /&gt;
					{&lt;br /&gt;
						id : 'tab2',&lt;br /&gt;
						label : 'Advanced Settings',&lt;br /&gt;
						elements :&lt;br /&gt;
						[&lt;br /&gt;
							{&lt;br /&gt;
								type : 'text',&lt;br /&gt;
								id : 'id',&lt;br /&gt;
								label : 'Id'&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;
&lt;br /&gt;
					var abbr = editor.document.createElement( 'abbr' );&lt;br /&gt;
					abbr.setAttribute( 'title', dialog.getValueOf( 'tab1', 'title' ) );&lt;br /&gt;
					abbr.setText( dialog.getValueOf( 'tab1', 'abbr' ) );&lt;br /&gt;
					var id = dialog.getValueOf( 'tab2', 'id' );&lt;br /&gt;
					if ( id )&lt;br /&gt;
						abbr.setAttribute( 'id', id );&lt;br /&gt;
					editor.insertElement( abbr );&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 Abbreviation''' toolbar button, the '''Abbreviation Properties''' dialog window will open. Fill in the obligatory '''Abbreviation''' and '''Explanation''' fields and click the '''OK''' button.&lt;br /&gt;
&lt;br /&gt;
[[Image:abbr_example1.png|center|frame|Abbreviation added in the dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The newly added abbreviation will be inserted into the document and will be displayed using the default styling of your browser. In Firefox, for example, the abbreviation will be underlined using a dotted line and the explanation will be displayed in a tooltip.&lt;br /&gt;
&lt;br /&gt;
[[Image:abbr_example2.png|center|frame|Abbreviation added in the dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Further Enhancements ==&lt;br /&gt;
The Abbreviation plugin is now able to add a new &amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt; element to the document, but does not make it possible to edit an already existing element. For this feature along with the context menu support check the [[CKEditor 3.x/Developers Guide/Customization/Plugins/Abbr Plugin Part 2|second part of the tutorial]].&lt;/div&gt;</summary>
		<author><name>Anna</name></author>	</entry>

	</feed>