<?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_2</id>
		<title>CKEditor 3.x/Tutorials/Abbr Plugin Part 2 - 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_2"/>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_2&amp;action=history"/>
		<updated>2026-05-16T13:30:21Z</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_2&amp;diff=6900&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_2&amp;diff=6900&amp;oldid=prev"/>
				<updated>2012-05-09T12:33:54Z</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:33, 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-l171&quot; &gt;Line 171:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 171:&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 Element ===&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 Element ===&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 first conditional statement again uses the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.node.html#getAscendant getAscendant]&amp;lt;/code&amp;gt; function to get to the closest &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element that contains the selection. The second one will check whether a selected element exists, its name is not &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; and it is a real element, as opposed to a fake object. If any of these conditions are met, we will have to create a new &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element 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;/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 first conditional statement again uses the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.node.html#getAscendant getAscendant]&amp;lt;/code&amp;gt; function to get to the closest &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 that contains the selection. The second one will check whether a selected element exists, its name is not &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; and it is a real element, as opposed to a fake object. If any of these conditions are met, we will have to create 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 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;/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;To differentiate between adding a new element and editing an existing one, we will create a new &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag. It will be set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; in the &amp;quot;add new element&amp;quot; scenario. If an &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element already exists, the &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag will be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;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;To differentiate between adding a new element and editing an existing one, we will create a new &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag. It will be set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; in the &amp;quot;add new element&amp;quot; scenario. If an &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 already exists, the &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag will be set to &amp;lt;code&amp;gt;false&amp;lt;/code&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 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;if ( element )&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;if ( element )&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-l186&quot; &gt;Line 186:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 186:&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;	this.insertMode = false;&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;	this.insertMode = false;&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;−&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 will now store a reference to the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&amp;lt;&lt;/del&gt;/code&amp;gt; element in the &amp;lt;code&amp;gt;element&amp;lt;/code&amp;gt; variable since we will need to access it in the new version of the &amp;lt;code&amp;gt;onOK&amp;lt;/code&amp;gt; function later.&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 will now store a reference to 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;/code&amp;gt; element in the &amp;lt;code&amp;gt;element&amp;lt;/code&amp;gt; variable since we will need to access it in the new version of the &amp;lt;code&amp;gt;onOK&amp;lt;/code&amp;gt; function later.&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 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;this.element = element;&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;this.element = element;&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-l199&quot; &gt;Line 199:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 199:&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;For the above code to work we will however first need to define the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.uiElement.html#setup setup]&amp;lt;/code&amp;gt; functions themselves. In order to do that, we will revisit the code of the dialog window UI elements.&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;For the above code to work we will however first need to define the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.uiElement.html#setup setup]&amp;lt;/code&amp;gt; functions themselves. In order to do that, we will revisit the code of the dialog window UI elements.&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 setup function for the '''Abbreviation''' text field needs to get the contents of the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&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#getText getText]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setValue setValue]&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;The setup function for the '''Abbreviation''' text field needs to get 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#getText getText]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setValue setValue]&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;A similar approach can be used for the '''Explanation''' field, although in this case we will need to get the contents of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&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#getAttribute getAttribute]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;setValue&amp;lt;/code&amp;gt; function again.&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;A similar approach can be used for the '''Explanation''' field, although in this case we will need to get the contents of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; attribute 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#getAttribute getAttribute]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;setValue&amp;lt;/code&amp;gt; function again.&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 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;elements :&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;elements :&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-l258&quot; &gt;Line 258:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 258:&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;/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;Why is that so? It is because the current edition of the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function does not differentiate between adding an element and modifying it, so it simply inserts the values supplied in the dialog window fields into the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; that it creates and adds this element to the document.&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;Why is that so? It is because the current edition of the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function does not differentiate between adding an element and modifying it, so it simply inserts the values supplied in the dialog window fields into 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; that it creates and adds this element to the document.&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;=== Commit Functions ===&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;=== Commit Functions ===&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-l264&quot; &gt;Line 264:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 264:&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 function can now, in fact, be stripped to the minimum.&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 function can now, in fact, be stripped to the minimum.&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;Firstly, we will define the variables for the dialog window (&amp;lt;code&amp;gt;dialog&amp;lt;/code&amp;gt;) and the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element (&amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;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;Firstly, we will define the variables for the dialog window (&amp;lt;code&amp;gt;dialog&amp;lt;/code&amp;gt;) and 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 (&amp;lt;code&amp;gt;abbr&amp;lt;/code&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 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;insertMode&amp;lt;/code&amp;gt; flag created in the &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function can then be used to switch between the creation of a new element and modification of the existing one. If we are in the insert mode, we add a new &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element to the document. We then 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 to populate the element with values entered by the user. Every parameter that is passed to the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function will also be passed on to the commit functions themselves.&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;insertMode&amp;lt;/code&amp;gt; flag created in the &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function can then be used to switch between the creation of a new element and modification of the existing one. If we are in the insert mode, we 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. We then 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 to populate the element with values entered by the user. Every parameter that is passed to the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function will also be passed on to the commit functions themselves.&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 colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l280&quot; &gt;Line 280:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 280:&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;To make the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; method work we will however first need to define the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.uiElement.html#commit commit]&amp;lt;/code&amp;gt; functions themselves. In order to do that, we will have to revise the code of the dialog window UI elements again.&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;To make the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; method work we will however first need to define the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.uiElement.html#commit commit]&amp;lt;/code&amp;gt; functions themselves. In order to do that, we will have to revise the code of the dialog window UI elements again.&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 commit function for the '''Abbreviation''' text field needs 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 in order to set the contents of the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&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&amp;#160; 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;The commit function for the '''Abbreviation''' text field needs 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 in order to set 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&amp;#160; 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;A similar approach can be used for the retrieval of the '''Explanation''' field contents, although in this case we will need to set the contents of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&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.&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;A similar approach can be used for the retrieval of the '''Explanation''' field contents, although in this case we will need to set the contents of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; attribute 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#setAttribute 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;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;elements :&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;elements :&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;!-- diff cache key ckeditor_docsold:diff:version:1.11a:oldid:6899:newid:6900 --&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_2&amp;diff=6899&amp;oldid=prev</id>
		<title>Anna: /* Context Menu Support */ &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_2&amp;diff=6899&amp;oldid=prev"/>
				<updated>2012-05-09T12:31:45Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Context Menu Support: &lt;/span&gt; &amp;lt;abbr&amp;gt; escaped&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 12:31, 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-l117&quot; &gt;Line 117:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 117:&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;&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;−&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;However, when we reload the CKEditor instance and add an abbreviation, the context menu does not contain the newly created '''Edit Abbreviation''' item. We now need to enable the Abbreviation context menu for each selected &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element. Using the &amp;lt;code&amp;gt;addListener&amp;lt;/code&amp;gt; function we will add an event listener that listens to the &amp;lt;code&amp;gt;contextmenu&amp;lt;/code&amp;gt; event when such an element is selected.&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;However, when we reload the CKEditor instance and add an abbreviation, the context menu does not contain the newly created '''Edit Abbreviation''' item. We now need to enable the Abbreviation context menu for each selected &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. Using the &amp;lt;code&amp;gt;addListener&amp;lt;/code&amp;gt; function we will add an event listener that listens to the &amp;lt;code&amp;gt;contextmenu&amp;lt;/code&amp;gt; event when such an element is selected.&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 listener should cater for two scenarios and should act differently for an &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element and for all other elements.&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 listener should cater for two scenarios and should act differently for an &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 and for all other elements.&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 first conditional statement uses the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.node.html#getAscendant getAscendant]&amp;lt;/code&amp;gt; function to get to the closest &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element that contains the selection. The second conditional statement checks whether the &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element exists, is not read-only and is not a fake element. If all these conditions are met, the listener returns an object in the format of &amp;lt;code&amp;gt;''contextMenuButtonName'' : CKEDITOR.TRISTATE_OFF&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.TRISTATE_OFF TRISTATE_OFF]&amp;lt;/code&amp;gt; setting means that the menu context option is enabled, but it is not being used at the moment. If the conditions are not met, the listener returns nothing.&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 first conditional statement uses the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.node.html#getAscendant getAscendant]&amp;lt;/code&amp;gt; function to get to the closest &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 that contains the selection. The second conditional statement checks whether 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 exists, is not read-only and is not a fake element. If all these conditions are met, the listener returns an object in the format of &amp;lt;code&amp;gt;''contextMenuButtonName'' : CKEDITOR.TRISTATE_OFF&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.TRISTATE_OFF TRISTATE_OFF]&amp;lt;/code&amp;gt; setting means that the menu context option is enabled, but it is not being used at the moment. If the conditions are not met, the listener returns nothing.&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 colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l137&quot; &gt;Line 137:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 137:&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;&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;−&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 '''Edit Abbreviation''' item is now visible in the context menu of an &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element. Once selected, it opens the '''Abbreviation Properties''' dialog window due to the use of the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; command.&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 '''Edit Abbreviation''' item is now visible in the context menu of an &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. Once selected, it opens the '''Abbreviation Properties''' dialog window due to the use of the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; command.&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;[[File:abbr2_context_menu_added.png|center|frame|Edit Abbreviation context menu item added to CKEditor]]&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;[[File:abbr2_context_menu_added.png|center|frame|Edit Abbreviation context menu item added to CKEditor]]&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-l147&quot; &gt;Line 147:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 147:&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;/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;If you try to enter some values into these fields and accept the changes, a new &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/del&gt;abbr&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/del&gt;&amp;lt;/code&amp;gt; element will be added on the position of the cursor in the document. &amp;#160;&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;If you try to enter some values into these fields and accept the changes, 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 will be added on the position of the cursor in the document. &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;/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;[[File:abbr2_editing_error_3.png|center|frame|New abbreviation element inserted into the document]]&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;[[File:abbr2_editing_error_3.png|center|frame|New abbreviation element inserted into the document]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&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_2&amp;diff=6293&amp;oldid=prev</id>
		<title>Anna: /* Setup Functions */ Setup function links to API added</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_2&amp;diff=6293&amp;oldid=prev"/>
				<updated>2011-05-17T16:56:39Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Setup Functions: &lt;/span&gt; Setup function links to API added&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 16:56, 17 May 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-l192&quot; &gt;Line 192:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 192:&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;=== Setup Functions ===&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;=== Setup Functions ===&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 &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function will finish with a call to the &amp;lt;code&amp;gt;setupContent&amp;lt;/code&amp;gt; function that will invoke the setup functions for the element. Each parameter that will be passed on to the &amp;lt;code&amp;gt;setupContent&amp;lt;/code&amp;gt; function will also be passed on to the setup functions.&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;onShow&amp;lt;/code&amp;gt; function will finish with a call to the &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#&lt;/ins&gt;setupContent &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;setupContent]&lt;/ins&gt;&amp;lt;/code&amp;gt; function that will invoke the setup functions for the element. Each parameter that will be passed on to the &amp;lt;code&amp;gt;setupContent&amp;lt;/code&amp;gt; function will also be passed on to the setup functions.&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;&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;this.setupContent( this.element );&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;this.setupContent( this.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;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;−&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;For the above code to work we will however first need to define the setup functions themselves. In order to do that, we will revisit the code of the dialog window UI elements.&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;For the above code to work we will however first need to define the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.uiElement.html#&lt;/ins&gt;setup &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;setup]&amp;lt;/code&amp;gt; &lt;/ins&gt;functions themselves. In order to do that, we will revisit the code of the dialog window UI elements.&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 setup function for the '''Abbreviation''' text field needs to get the contents of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#getText getText]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setValue setValue]&amp;lt;/code&amp;gt; function.&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 setup function for the '''Abbreviation''' text field needs to get the contents of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#getText getText]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setValue setValue]&amp;lt;/code&amp;gt; function.&lt;/div&gt;&lt;/td&gt;&lt;/tr&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_2&amp;diff=6292&amp;oldid=prev</id>
		<title>Anna: /* Commit Functions */ Commit links to API added</title>
		<link rel="alternate" type="text/html" href="https://docs-old.ckeditor.com/index.php?title=CKEditor_3.x/Tutorials/Abbr_Plugin_Part_2&amp;diff=6292&amp;oldid=prev"/>
				<updated>2011-05-17T16:54:56Z</updated>
		
		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Commit Functions: &lt;/span&gt; Commit links to API added&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 16:54, 17 May 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-l266&quot; &gt;Line 266:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 266:&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;Firstly, we will define the variables for the dialog window (&amp;lt;code&amp;gt;dialog&amp;lt;/code&amp;gt;) and the &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element (&amp;lt;code&amp;gt;abbr&amp;lt;/code&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;Firstly, we will define the variables for the dialog window (&amp;lt;code&amp;gt;dialog&amp;lt;/code&amp;gt;) and the &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element (&amp;lt;code&amp;gt;abbr&amp;lt;/code&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 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;insertMode&amp;lt;/code&amp;gt; flag created in the &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function can then be used to switch between the creation of a new element and modification of the existing one. If we are in the insert mode, we add a new &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element to the document. We then use the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function to populate the element with values entered by the user. Every parameter that is passed to the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function will also be passed on to the commit functions themselves.&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;insertMode&amp;lt;/code&amp;gt; flag created in the &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function can then be used to switch between the creation of a new element and modification of the existing one. If we are in the insert mode, we add a new &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element to the document. We then use the &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#&lt;/ins&gt;commitContent &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;commitContent]&lt;/ins&gt;&amp;lt;/code&amp;gt; function to populate the element with values entered by the user. Every parameter that is passed to the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function will also be passed on to the commit functions themselves.&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 colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l278&quot; &gt;Line 278:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 278:&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;&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;−&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;To make the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; method 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;/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;To make the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; method work we will however first need to define the &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.definition.uiElement.html#&lt;/ins&gt;commit &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;commit]&amp;lt;/code&amp;gt; &lt;/ins&gt;functions themselves. In order to do that, we will have to revise the code of the dialog window UI elements again.&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 commit function for the '''Abbreviation''' text field needs 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 in order to set the contents of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#setText&amp;#160; setText]&amp;lt;/code&amp;gt; function.&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 commit function for the '''Abbreviation''' text field needs 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 in order to set the contents of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#setText&amp;#160; setText]&amp;lt;/code&amp;gt; function.&lt;/div&gt;&lt;/td&gt;&lt;/tr&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_2&amp;diff=6179&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_2&amp;diff=6179&amp;oldid=prev"/>
				<updated>2011-04-14T13:16:24Z</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, Part 2}}&lt;br /&gt;
__TOC__&lt;br /&gt;
The aim of this tutorial is to demonstrate how to extend an existing CKEditor plugin with context menu support as well as the possibility to edit a previously inserted element. Instead of creating a new plugin, this time we are going to expand on the functionality of the '''Abbreviation''' plugin created in the [[CKEditor 3.x/Tutorials/Abbr Plugin Part 1|previous installment]] of the tutorial series.&lt;br /&gt;
&lt;br /&gt;
We need to start where we previously left off &amp;amp;mdash; to see the full source code of the '''Abbreviation''' plugin, &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;
If you have any doubts about the contents of the plugin and its configuration, refer to the [[CKEditor 3.x/Tutorials/Abbr Plugin Part 1|Creating a Simple CKEditor Plugin, Part 1]] tutorial.&lt;br /&gt;
&lt;br /&gt;
== Minor Code Refactoring ==&lt;br /&gt;
Since we are  going to use the plugin toolbar button path more than once, it makes sense to refactor the code in order to place the icon path in a variable. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.html#addButton  addButton]&amp;lt;/code&amp;gt; function will then be modified to use the newly created &amp;lt;code&amp;gt;iconPath&amp;lt;/code&amp;gt; variable.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var iconPath = this.path + 'images/icon.png';&lt;br /&gt;
&lt;br /&gt;
editor.addCommand( 'abbrDialog',new CKEDITOR.dialogCommand( 'abbrDialog' ) );&lt;br /&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: iconPath&lt;br /&gt;
} );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Context Menu Support ==&lt;br /&gt;
The context menu implementation should be 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, below the command and button definitions.&lt;br /&gt;
&lt;br /&gt;
Context menu support in CKEditor is implemented in the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/src/plugins_contextmenu_plugin.js.html contextmenu]&amp;lt;/code&amp;gt; plugin, which, in turn, is based on the &amp;lt;code&amp;gt;contextmenu&amp;lt;/code&amp;gt; event.&lt;br /&gt;
&lt;br /&gt;
Since we want the context menu option for the Abbreviation plugin to be separated from standard context menu items, we will need to use the &amp;lt;code&amp;gt;addMenuGroup&amp;lt;/code&amp;gt; function to register a new menu group called &amp;lt;code&amp;gt;myGroup&amp;lt;/code&amp;gt;. Using the &amp;lt;code&amp;gt;addMenuItem&amp;lt;/code&amp;gt; function we can now register a new menu item that will belong to the newly created group. The &amp;lt;code&amp;gt;label&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;icon&amp;lt;/code&amp;gt; properties let us set the context menu item name and its icon, respectively. To make the context menu item open the '''Abbreviation Properties''' dialog window, we need to set the &amp;lt;code&amp;gt;command&amp;lt;/code&amp;gt; property to use the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ( editor.contextMenu )&lt;br /&gt;
{&lt;br /&gt;
	editor.addMenuGroup( 'myGroup' );&lt;br /&gt;
	editor.addMenuItem( 'abbrItem',&lt;br /&gt;
	{&lt;br /&gt;
		label : 'Edit Abbreviation',&lt;br /&gt;
		icon : iconPath,&lt;br /&gt;
		command : 'abbrDialog',&lt;br /&gt;
		group : 'myGroup'&lt;br /&gt;
	});&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
However, when we reload the CKEditor instance and add an abbreviation, the context menu does not contain the newly created '''Edit Abbreviation''' item. We now need to enable the Abbreviation context menu for each selected &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element. Using the &amp;lt;code&amp;gt;addListener&amp;lt;/code&amp;gt; function we will add an event listener that listens to the &amp;lt;code&amp;gt;contextmenu&amp;lt;/code&amp;gt; event when such an element is selected.&lt;br /&gt;
&lt;br /&gt;
The listener should cater for two scenarios and should act differently for an &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element and for all other elements.&lt;br /&gt;
&lt;br /&gt;
The first conditional statement uses the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.node.html#getAscendant getAscendant]&amp;lt;/code&amp;gt; function to get to the closest &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element that contains the selection. The second conditional statement checks whether the &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element exists, is not read-only and is not a fake element. If all these conditions are met, the listener returns an object in the format of &amp;lt;code&amp;gt;''contextMenuButtonName'' : CKEDITOR.TRISTATE_OFF&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.html#.TRISTATE_OFF TRISTATE_OFF]&amp;lt;/code&amp;gt; setting means that the menu context option is enabled, but it is not being used at the moment. If the conditions are not met, the listener returns nothing.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ( editor.contextMenu )&lt;br /&gt;
{&lt;br /&gt;
	// Code creating context menu items goes here.&lt;br /&gt;
	editor.contextMenu.addListener( function( element )&lt;br /&gt;
	{&lt;br /&gt;
		if ( element )&lt;br /&gt;
			element = element.getAscendant( 'abbr', true );&lt;br /&gt;
		if ( element &amp;amp;&amp;amp; !element.isReadOnly() &amp;amp;&amp;amp; !element.data( 'cke-realelement' ) )&lt;br /&gt;
 			return { abbrItem : CKEDITOR.TRISTATE_OFF };&lt;br /&gt;
		return null;&lt;br /&gt;
	});&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
The '''Edit Abbreviation''' item is now visible in the context menu of an &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element. Once selected, it opens the '''Abbreviation Properties''' dialog window due to the use of the &amp;lt;code&amp;gt;abbrDialog&amp;lt;/code&amp;gt; command.&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_context_menu_added.png|center|frame|Edit Abbreviation context menu item added to CKEditor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The context menu works &amp;amp;mdash; but only partially. It opens the '''Abbreviation Properties''' dialog window for the abbreviation, but the editing feature does not really work.  The '''Abbreviation''' and '''Explanation''' fields are empty:&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_editing_error_1.png|center|frame|Abbreviation Properties is empty in editing mode]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you try to enter some values into these fields and accept the changes, a new &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element will be added on the position of the cursor in the document. &lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_editing_error_3.png|center|frame|New abbreviation element inserted into the document]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is time to work on the selection logic so that editing an inserted element would not create a new one, but use the previously entered values.&lt;br /&gt;
&lt;br /&gt;
== Dialog Window Logic ==&lt;br /&gt;
The editing behavior for a previously inserted element will use the &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function that is defined for the plugin dialog window and is executed when the dialog window is opened. This function will be defined above the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function that we will also need to refactor later.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
onShow : function()&lt;br /&gt;
{&lt;br /&gt;
	// The code that will be executed when a dialog window is loaded.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Selecting an Element ===&lt;br /&gt;
We will need to start with the selection logic. To get to the element that is selected by the user (either highlighted with a mouse or keyboard, or selected by placing the cursor inside), we will need to use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#getSelection getSelection]&amp;lt;/code&amp;gt; function. This function returns the current selection from CKEditor editing area when in WYSIWYG mode. We will also use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.selection.html#getStartElement getStartElement]&amp;lt;/code&amp;gt; to get the element in which the selection starts, and assign it to the &amp;lt;code&amp;gt;element&amp;lt;/code&amp;gt; variable.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var sel = editor.getSelection(),&lt;br /&gt;
	element = sel.getStartElement();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating an Element ===&lt;br /&gt;
The first conditional statement again uses the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.node.html#getAscendant getAscendant]&amp;lt;/code&amp;gt; function to get to the closest &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element that contains the selection. The second one will check whether a selected element exists, its name is not &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; and it is a real element, as opposed to a fake object. If any of these conditions are met, we will have to create a new &amp;lt;code&amp;gt;&amp;lt;abbr&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.document.html#createElement createElement]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
To differentiate between adding a new element and editing an existing one, we will create a new &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag. It will be set to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; in the &amp;quot;add new element&amp;quot; scenario. If an &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element already exists, the &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag will be set to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
if ( element )&lt;br /&gt;
	element = element.getAscendant( 'abbr', true );&lt;br /&gt;
 &lt;br /&gt;
if ( !element || element.getName() != 'abbr' || element.data( 'cke-realelement' ) )&lt;br /&gt;
{&lt;br /&gt;
	element = editor.document.createElement( 'abbr' );&lt;br /&gt;
	this.insertMode = true;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
	this.insertMode = false;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
We will now store a reference to the &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element in the &amp;lt;code&amp;gt;element&amp;lt;/code&amp;gt; variable since we will need to access it in the new version of the &amp;lt;code&amp;gt;onOK&amp;lt;/code&amp;gt; function later.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
this.element = element;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Setup Functions ===&lt;br /&gt;
The &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function will finish with a call to the &amp;lt;code&amp;gt;setupContent&amp;lt;/code&amp;gt; function that will invoke the setup functions for the element. Each parameter that will be passed on to the &amp;lt;code&amp;gt;setupContent&amp;lt;/code&amp;gt; function will also be passed on to the setup functions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
this.setupContent( this.element );&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
For the above code to work we will however first need to define the setup functions themselves. In order to do that, we will revisit the code of the dialog window UI elements.&lt;br /&gt;
&lt;br /&gt;
The setup function for the '''Abbreviation''' text field needs to get the contents of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#getText getText]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#setValue setValue]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
A similar approach can be used for the '''Explanation''' field, although in this case we will need to get the contents of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#getAttribute getAttribute]&amp;lt;/code&amp;gt; function in order to populate the field with its value by using the &amp;lt;code&amp;gt;setValue&amp;lt;/code&amp;gt; function again.&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 : 'text',&lt;br /&gt;
		id : 'abbr',&lt;br /&gt;
		label : 'Abbreviation',&lt;br /&gt;
		validate : CKEDITOR.dialog.validate.notEmpty( &amp;quot;Abbreviation cannot be empty&amp;quot; ),&lt;br /&gt;
		setup : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			this.setValue( element.getText() );&lt;br /&gt;
		}&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;Title cannot be empty&amp;quot; ),&lt;br /&gt;
		setup : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			this.setValue( element.getAttribute( &amp;quot;title&amp;quot; ) );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Since the '''Advanced Settings''' tab contains a single '''Id''' text field that reflects the contents of the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; attribute, we will use the same combination of the &amp;lt;code&amp;gt;getAttribute&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;setValue&amp;lt;/code&amp;gt; function as in case of the '''Explanation''' text field.&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 : 'text',&lt;br /&gt;
		id : 'id',&lt;br /&gt;
		label : 'Id',&lt;br /&gt;
		setup : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			this.setValue( element.getAttribute( &amp;quot;id&amp;quot; ) );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
When you reload the page, add an abbreviation, and then attempt to modify it by opening the context menu and selecting '''Edit Abbreviation''', the '''Abbreviation Properties''' dialog window will now re-open with the '''Abbreviation''' and '''Explanation''' fields already filled in with the contents of the edited element.&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_editing_example1.png|center|frame|Modifying an abbreviation in CKEditor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Suppose you were to change the abbreviation spelling into lower case. Replace the contents of the text fields as follows and click the '''OK''' button.&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_editing_example2.png|center|frame|Modifying an abbreviation in CKEditor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This operation fails! The modified values do not replace the contents of the first abbreviation, but are used to create a new abbreviation element inserted inside the first one, at the position of the cursor.&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_editing_error_3.png|center|frame|Abbreviation duplicate added in CKEditor]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Why is that so? It is because the current edition of the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function does not differentiate between adding an element and modifying it, so it simply inserts the values supplied in the dialog window fields into the &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; that it creates and adds this element to the document.&lt;br /&gt;
&lt;br /&gt;
=== Commit Functions ===&lt;br /&gt;
To correct this error, we will need to re-write the code of the &amp;lt;code&amp;gt;onOk&amp;lt;/code&amp;gt; function to account for both scenarios. &lt;br /&gt;
The function can now, in fact, be stripped to the minimum.&lt;br /&gt;
&lt;br /&gt;
Firstly, we will define the variables for the dialog window (&amp;lt;code&amp;gt;dialog&amp;lt;/code&amp;gt;) and the &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element (&amp;lt;code&amp;gt;abbr&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;insertMode&amp;lt;/code&amp;gt; flag created in the &amp;lt;code&amp;gt;onShow&amp;lt;/code&amp;gt; function can then be used to switch between the creation of a new element and modification of the existing one. If we are in the insert mode, we add a new &amp;lt;code&amp;gt;&amp;lt;abbr&amp;gt;&amp;lt;/code&amp;gt; element to the document. We then use the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function to populate the element with values entered by the user. Every parameter that is passed to the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; function will also be passed on to the commit functions themselves.&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;
		abbr = this.element;&lt;br /&gt;
	if ( this.insertMode )&lt;br /&gt;
		editor.insertElement( abbr );&lt;br /&gt;
	this.commitContent( abbr );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
To make the &amp;lt;code&amp;gt;commitContent&amp;lt;/code&amp;gt; method 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 function for the '''Abbreviation''' text field needs 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 in order to set the contents of the &amp;lt;code&amp;gt;&amp;lt;abbr&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#setText  setText]&amp;lt;/code&amp;gt; function.&lt;br /&gt;
&lt;br /&gt;
A similar approach can be used for the retrieval of the '''Explanation''' field contents, although in this case we will need to set the contents of the &amp;lt;code&amp;gt;title&amp;lt;/code&amp;gt; attribute of the &amp;lt;code&amp;gt;&amp;lt;abbr&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.&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 : 'text',&lt;br /&gt;
		id : 'abbr',&lt;br /&gt;
		label : 'Abbreviation',&lt;br /&gt;
		validate : CKEDITOR.dialog.validate.notEmpty( &amp;quot;Abbreviation cannot be empty&amp;quot; ),&lt;br /&gt;
		setup : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			this.setValue( element.getText() );&lt;br /&gt;
		},&lt;br /&gt;
		commit : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			element.setText( this.getValue() );&lt;br /&gt;
		}&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;Title cannot be empty&amp;quot; ),&lt;br /&gt;
		setup : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			this.setValue( element.getAttribute( &amp;quot;title&amp;quot; ) );&lt;br /&gt;
		},&lt;br /&gt;
		commit : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			element.setAttribute( &amp;quot;title&amp;quot;, this.getValue() );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
Similarly, since the '''Advanced Settings''' tab contains an '''Id''' text field that reflects the contents of the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; attribute, we will use the same combination of the &amp;lt;code&amp;gt;getValue&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;setAttribute&amp;lt;/code&amp;gt; function as in case of the '''Explanation''' text field. This time, however, we will also need to account for the possibility of removing the attribute value by the user during the modification of the element. If we are not in the insert mode (which means we are editing an existing element) and the '''Id''' field is empty, we will use the &amp;lt;code&amp;gt;[http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#removeAttribute removeAttribute]&amp;lt;/code&amp;gt; method to delete the &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt; element of an existing abbreviation. &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 : 'text',&lt;br /&gt;
		id : 'id',&lt;br /&gt;
		label : 'Id',&lt;br /&gt;
		setup : function( element )&lt;br /&gt;
		{&lt;br /&gt;
			this.setValue( element.getAttribute( &amp;quot;id&amp;quot; ) );&lt;br /&gt;
		},&lt;br /&gt;
		commit : function ( element )&lt;br /&gt;
		{&lt;br /&gt;
			var id = this.getValue();&lt;br /&gt;
			if ( id )&lt;br /&gt;
				element.setAttribute( 'id', id );&lt;br /&gt;
			else if ( !this.insertMode )&lt;br /&gt;
				element.removeAttribute( 'id' );&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
]&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 updated &amp;lt;code&amp;gt;plugin.js&amp;lt;/code&amp;gt; file, &amp;lt;hide target=&amp;quot;abbr2_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:abbr2.zip|download the whole modified plugin folder]] inluding the icon and the fully commented updated 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;abbr2_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;
		var iconPath = this.path + 'images/icon.png';&lt;br /&gt;
		&lt;br /&gt;
		editor.addCommand( 'abbrDialog',new CKEDITOR.dialogCommand( 'abbrDialog' ) );&lt;br /&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: iconPath&lt;br /&gt;
		} );&lt;br /&gt;
		&lt;br /&gt;
		if ( editor.contextMenu )&lt;br /&gt;
		{&lt;br /&gt;
			editor.addMenuGroup( 'myGroup' );&lt;br /&gt;
			editor.addMenuItem( 'abbrItem',&lt;br /&gt;
			{&lt;br /&gt;
				label : 'Edit Abbreviation',&lt;br /&gt;
				icon : iconPath,&lt;br /&gt;
				command : 'abbrDialog',&lt;br /&gt;
				group : 'myGroup'&lt;br /&gt;
			});&lt;br /&gt;
			editor.contextMenu.addListener( function( element )&lt;br /&gt;
			{&lt;br /&gt;
				if ( element )&lt;br /&gt;
					element = element.getAscendant( 'abbr', true );&lt;br /&gt;
				if ( element &amp;amp;&amp;amp; !element.isReadOnly() &amp;amp;&amp;amp; !element.data( 'cke-realelement' ) )&lt;br /&gt;
 					return { abbrItem : CKEDITOR.TRISTATE_OFF };&lt;br /&gt;
				return null;&lt;br /&gt;
			});&lt;br /&gt;
		}&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;
								setup : function( element )&lt;br /&gt;
								{&lt;br /&gt;
									this.setValue( element.getText() );&lt;br /&gt;
								},&lt;br /&gt;
								commit : function( element )&lt;br /&gt;
								{&lt;br /&gt;
									element.setText( this.getValue() );&lt;br /&gt;
								}&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;
								setup : function( element )&lt;br /&gt;
								{&lt;br /&gt;
									this.setValue( element.getAttribute( &amp;quot;title&amp;quot; ) );&lt;br /&gt;
								},&lt;br /&gt;
								commit : function( element )&lt;br /&gt;
								{&lt;br /&gt;
									element.setAttribute( &amp;quot;title&amp;quot;, this.getValue() );&lt;br /&gt;
								}&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;
								setup : function( element )&lt;br /&gt;
								{&lt;br /&gt;
									this.setValue( element.getAttribute( &amp;quot;id&amp;quot; ) );&lt;br /&gt;
								},&lt;br /&gt;
								commit : function ( element )&lt;br /&gt;
								{&lt;br /&gt;
									var id = this.getValue();&lt;br /&gt;
									if ( id )&lt;br /&gt;
										element.setAttribute( 'id', id );&lt;br /&gt;
									else if ( !this.insertMode )&lt;br /&gt;
										element.removeAttribute( 'id' );&lt;br /&gt;
								}&lt;br /&gt;
							}&lt;br /&gt;
						]&lt;br /&gt;
					}&lt;br /&gt;
				],&lt;br /&gt;
				onShow : function()&lt;br /&gt;
				{&lt;br /&gt;
					var sel = editor.getSelection(),&lt;br /&gt;
						element = sel.getStartElement();&lt;br /&gt;
					if ( element )&lt;br /&gt;
						element = element.getAscendant( 'abbr', true );&lt;br /&gt;
 &lt;br /&gt;
					if ( !element || element.getName() != 'abbr' || element.data( 'cke-realelement' ) )&lt;br /&gt;
					{&lt;br /&gt;
						element = editor.document.createElement( 'abbr' );&lt;br /&gt;
						this.insertMode = true;&lt;br /&gt;
					}&lt;br /&gt;
					else&lt;br /&gt;
						this.insertMode = false;&lt;br /&gt;
					&lt;br /&gt;
					this.element = element;&lt;br /&gt;
					&lt;br /&gt;
					this.setupContent( this.element );&lt;br /&gt;
				},&lt;br /&gt;
				onOk : function()&lt;br /&gt;
				{&lt;br /&gt;
					var dialog = this,&lt;br /&gt;
						abbr = this.element;&lt;br /&gt;
&lt;br /&gt;
					if ( this.insertMode )&lt;br /&gt;
						editor.insertElement( abbr );&lt;br /&gt;
					this.commitContent( 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 code of the extended Abbreviation plugin 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;
[[File: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;
[[File:abbr_example2.png|center|frame|Abbreviation added in the dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you want to edit the abbreviation, select it and open its context menu. Choose the '''Edit Abbreviation''' option to open the dialog window again, filled in with the contents of the element. Modify the abbreviation and click '''OK'''.&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_example3.png|center|frame|Abbreviation edited in the dialog window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Voilà! The abbreviation was updated and its contents replaced with texts entered in the dialog window.&lt;br /&gt;
&lt;br /&gt;
[[File:abbr2_example4.png|center|frame|Abbreviation edited in the dialog window]]&lt;/div&gt;</summary>
		<author><name>Anna</name></author>	</entry>

	</feed>