Index: /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2725)
+++ /CKEditor/branches/prototype/_source/plugins/dialog/plugin.js	(revision 2726)
@@ -780,4 +780,10 @@
 	},
 
+	/**
+	 * Saves the current selection position in the editor.
+	 * This function is automatically called when a non-nested dialog is opened,
+	 * but it may also be called by event handlers in dialog definition.
+	 * @example
+	 */
 	saveSelection : function()
 	{
@@ -789,4 +795,11 @@
 	},
 
+	/**
+	 * Restores the editor's selection from the previously saved position in this
+	 * dialog.
+	 * This function is automatically called when a non-nested dialog is closed, 
+	 * but it may also be called by event handlers in dialog definition.
+	 * @example
+	 */
 	restoreSelection : function()
 	{
@@ -902,4 +915,5 @@
 		 * The margin here means the area between the dialog's container <div> and the visual boundary of the dialog.
 		 * Typically this area is used for dialog shadows.
+		 * This function is typically called in a skin's JavaScript files.
 		 * @param {Number} top The top margin in pixels.
 		 * @param {Number} right The right margin in pixels.
@@ -1542,4 +1556,42 @@
 		 * The base class of all dialog UI elements.
 		 * @constructor
+		 * @param {CKEDITOR.dialog} dialog Parent dialog object.
+		 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element
+		 * definition. Accepted fields:
+		 * <ul>
+		 * 	<li><strong>id</strong> (Required) The id of the UI element. See {@link
+		 * 	CKEDITOR.dialog#getContentElement}</li>
+		 * 	<li><strong>type</strong> (Required) The type of the UI element. The
+		 * 	value to this field specifies which UI element class will be used to
+		 * 	generate the final widget.</li>
+		 * 	<li><strong>title</strong> (Optional) The popup tooltip for the UI
+		 * 	element.</li>
+		 * 	<li><strong>className</strong> (Optional) Additional CSS class names
+		 * 	to add to the UI element. Separated by space.</li>
+		 * 	<li><strong>style</strong> (Optional) Additional CSS inline styles
+		 * 	to add to the UI element. A semicolon (;) is required after the last
+		 * 	style declaration.</li>
+		 * 	<li><strong>on*</strong> (Optional) Any UI element definition field that
+		 * 	starts with <em>on</em> followed immediately by a capital letter and
+		 * 	probably more letters is an event handler. Event handlers may be further
+		 * 	divided into registered event handlers and DOM event handlers. Please
+		 * 	refer to {@link CKEDITOR.ui.dialog.uiElement#registerEvents} and
+		 * 	{@link CKEDITOR.ui.dialog.uiElement#eventProcessors} for more
+		 * 	information.</li>
+		 * </ul>
+		 * @param {Array} htmlList
+		 * List of HTML code to be added to the dialog's content area.
+		 * @param {Function|String} nodeNameArg 
+		 * A function returning a string, or a simple string for the node name for
+		 * the root DOM node. Default is 'div'.
+		 * @param {Function|Object} stylesArg
+		 * A function returning an object, or a simple object for CSS styles applied
+		 * to the DOM node. Default is empty object.
+		 * @param {Function|Object} attributesArg
+		 * A fucntion returning an object, or a simple object for attributes applied
+		 * to the DOM node. Default is empty object.
+		 * @param {Function|String} contentsArg
+		 * A function returning a string, or a simple string for the HTML code inside
+		 * the root DOM node. Default is empty string.
 		 * @example
 		 */
@@ -1819,4 +1871,26 @@
 	},
 
+	/**
+	 * Registers the on* event handlers defined in the element definition.
+	 * The default behavior of this function is:
+	 * <ol>
+	 *  <li>
+	 *  	If the on* event is defined in the class's eventProcesors list,
+	 *  	then the registration is delegated to the corresponding function
+	 *  	in the eventProcessors list.
+	 *  </li>
+	 *  <li>
+	 *  	If the on* event is not defined in the eventProcessors list, then
+	 *  	register the event handler under the corresponding DOM event of
+	 *  	the UI element's input DOM element (as defined by the return value
+	 *  	of {@link CKEDITOR.ui.dialog.uiElement#getInputElement}).
+	 *  </li>
+	 * </ol>
+	 * This function is only called at UI element instantiation, but can
+	 * be overridded in child classes if they require more flexibility.
+	 * @param {CKEDITOR.dialog.uiElementDefinition} definition The UI element
+	 * definition.
+	 * @example
+	 */
 	registerEvents : function( definition )
 	{
@@ -1842,4 +1916,24 @@
 	},
 
+	/**
+	 * The event processor list used by
+	 * {@link CKEDITOR.ui.dialog.uiElement#getInputElement} at UI element
+	 * instantiation. The default list defines three on* events:
+	 * <ol>
+	 *  <li>onLoad - Called when the element's parent dialog opens for the
+	 *  first time</li>
+	 *  <li>onShow - Called whenever the element's parent dialog opens.</li>
+	 *  <li>onHide - Called whenever the element's parent dialog closes.</li>
+	 * </ol>
+	 * @field
+	 * @type Object
+	 * @example
+	 * // This connects the 'click' event in CKEDITOR.ui.dialog.button to onClick
+	 * // handlers in the UI element's definitions.
+	 * CKEDITOR.ui.dialog.button.eventProcessors = CKEDITOR.tools.extend( {},
+	 * &nbsp;&nbsp;CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
+	 * &nbsp;&nbsp;{ onClick : function( dialog, func ) { this.on( 'click', func ); } },
+	 * &nbsp;&nbsp;true );
+	 */
 	eventProcessors : 
 	{
@@ -1860,4 +1954,14 @@
 	},
 
+	/**
+	 * The default handler for a UI element's access key down event, which
+	 * tries to put focus to the UI element.<br />
+	 * Can be overridded in child classes for more sophisticaed behavior.
+	 * @param {CKEDITOR.dialog} dialog The parent dialog object.
+	 * @param {String} key The key combination pressed. Since access keys
+	 * are defined to always include the CTRL key, its value should always
+	 * include a 'CTRL+' prefix.
+	 * @example
+	 */
 	accessKeyDown : function( dialog, key )
 	{
@@ -1865,4 +1969,14 @@
 	},
 
+	/**
+	 * The default handler for a UI element's access key up event, which
+	 * does nothing.<br />
+	 * Can be overridded in child classes for more sophisticated behavior.
+	 * @param {CKEDITOR.dialog} dialog The parent dialog object.
+	 * @param {String} key The key combination pressed. Since access keys
+	 * are defined to always include the CTRL key, its value should always
+	 * include a 'CTRL+' prefix.
+	 * @example
+	 */
 	accessKeyUp : function( dialog, key )
 	{
Index: /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2725)
+++ /CKEditor/branches/prototype/_source/plugins/dialogui/plugin.js	(revision 2726)
@@ -551,10 +551,4 @@
 			},
 
-			/**
-			 * A dialog element made from raw HTML code.
-			 * @extends CKEDITOR.ui.dialog.uiElement
-			 * @example
-			 * @constructor
-			 */
 			html : (function()
 			{
@@ -562,4 +556,18 @@
 					theirHtmlRe = /^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,
 					emptyTagRe = /\/$/;
+				/**
+				 * A dialog element made from raw HTML code.
+				 * @extends CKEDITOR.ui.dialog.uiElement
+				 * @name CKEDITOR.ui.dialog.html
+				 * @param {CKEDITOR.dialog} dialog Parent dialog object.
+				 * @param {CKEDITOR.dialog.uiElementDefinition} elementDefinition Element definition.
+				 * Accepted fields:
+				 * <ul>
+				 * 	<li><strong>html</strong> (Required) HTML code of this element.</li>
+				 * </ul>
+				 * @param {Array} htmlList List of HTML code to be added to the dialog's content area.
+				 * @example
+				 * @constructor
+				 */
 				return function( dialog, elementDefinition, htmlList )
 				{
@@ -597,5 +605,12 @@
 
 	CKEDITOR.ui.dialog.labeledElement.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.uiElement,
-			{
+			/** @lends CKEDITOR.ui.dialog.labeledElement.prototype */
+			{
+				/** 
+				 * Sets the label text of the element.
+				 * @param {String} label The new label text.
+				 * @returns {CKEDITOR.ui.dialog.labeledElement} The current labeled element.
+				 * @example
+				 */
 				setLabel : function( label )
 				{
@@ -608,4 +623,9 @@
 				},
 
+				/**
+				 * Retrieves the current label text of the elment.
+				 * @returns {String} The current label text.
+				 * @example
+				 */
 				getLabel : function()
 				{
@@ -617,4 +637,10 @@
 				},
 
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
 				eventProcessors : commonEventProcessors
 			}, true );
@@ -654,4 +680,10 @@
 				},
 
+				/**
+				 * Defines the onChange event and onClick for button element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
 				eventProcessors : CKEDITOR.tools.extend( {}, CKEDITOR.ui.dialog.uiElement.prototype.eventProcessors,
 					{
@@ -662,4 +694,9 @@
 					}, true ),
 
+				/**
+				 * Handler for the element's access key up event. Simulates a click to
+				 * the button.
+				 * @example
+				 */
 				accessKeyUp : function()
 				{
@@ -668,4 +705,9 @@
 				},
 
+				/**
+				 * Handler for the element's access key down event. Simulates a mouse
+				 * down to the button.
+				 * @example
+				 */
 				accessKeyDown : function()
 				{
@@ -697,4 +739,9 @@
 				},
 
+				/**
+				 * Handler for the text input's access key up event. Makes a select()
+				 * call to the text input.
+				 * @example
+				 */
 				accessKeyUp : function( dialog, key )
 				{
@@ -708,4 +755,9 @@
 			/** @lends CKEDITOR.ui.dialog.select.prototype */
 			{
+				/**
+				 * Gets the DOM element of the select box.
+				 * @returns {CKEDITOR.dom.element} The &lt;select&gt; element of this UI
+				 * element.
+				 */
 				getInputElement : function()
 				{
@@ -748,4 +800,8 @@
 				},
 
+				/**
+				 * Handler for the access key up event. Toggles the checkbox.
+				 * @example
+				 */
 				accessKeyUp : function()
 				{
@@ -753,4 +809,10 @@
 				},
 
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
 				eventProcessors : commonEventProcessors
 			}, commonPrototype, true );
@@ -789,4 +851,10 @@
 				},
 
+				/**
+				 * Handler for the access key up event. Focuses the currently
+				 * selected radio button, or the first radio button if none is
+				 * selected.
+				 * @example
+				 */
 				accessKeyUp : function()
 				{
@@ -803,4 +871,10 @@
 				},
 
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
 				eventProcessors : commonEventProcessors
 			}, commonPrototype, true );
@@ -808,5 +882,11 @@
 	CKEDITOR.ui.dialog.file.prototype = CKEDITOR.tools.extend( new CKEDITOR.ui.dialog.labeledElement,
 			commonPrototype,
-			{
+			/** @lends CKEDITOR.ui.dialog.file.prototype */
+			{
+				/**
+				 * Gets the &lt;input&gt; element of this file input.
+				 * @returns {CKEDITOR.dom.element} The file input element.
+				 * @example
+				 */
 				getInputElement : function()
 				{
@@ -815,9 +895,21 @@
 				},
 
+				/**
+				 * Uploads the file in the file input.
+				 * @returns {CKEDITOR.ui.dialog.file} This object.
+				 * @example
+				 */
 				submit : function()
 				{
-					return this.getInputElement().getParent().$.submit();
-				},
-
+					this.getInputElement().getParent().$.submit();
+					return this;
+				},
+
+				/**
+				 * Redraws the file input and resets the file path in the file input.
+				 * The redraw logic is necessary because non-IE browsers tend to clear
+				 * the &lt;iframe&gt; containing the file input after closing the dialog.
+				 * @example
+				 */
 				reset : function()
 				{
@@ -842,5 +934,13 @@
 					for ( var i = 0 ; i < buttons.length ; i++ )
 						buttons[i].enable();
-				}
+				},
+
+				/**
+				 * Defines the onChange event for UI element definitions.
+				 * @field
+				 * @type Object
+				 * @example
+				 */
+				eventProcessors : commonEventProcessors
 			}, true );
 
Index: /CKEditor/branches/prototype/_source/plugins/link/plugin.js
===================================================================
--- /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2725)
+++ /CKEditor/branches/prototype/_source/plugins/link/plugin.js	(revision 2726)
@@ -108,6 +108,5 @@
 								[ editor.lang.linkToEmail, 'email' ]
 							],
-							onChange : linkTypeChanged,
-							onLoad : linkTypeChanged
+							onChange : linkTypeChanged
 						},
 						{
@@ -246,6 +245,5 @@
 										[ editor.lang.linkTargetParent, 'parent' ]
 									],
-									onChange : targetChanged,
-									onLoad : targetChanged
+									onChange : targetChanged
 								},
 								{
