Index: /CKReleaser/trunk/_source/includes/samplesprocessor.js
===================================================================
--- /CKReleaser/trunk/_source/includes/samplesprocessor.js	(revision 3709)
+++ /CKReleaser/trunk/_source/includes/samplesprocessor.js	(revision 3710)
@@ -59,9 +59,9 @@
 		node.code = document.getElementById( 'code' );
 
-		if ( !node.html || !node.code )
+		if ( !node.html )
 		{
 			//Not a xml template, probably index.html or documentation.
 			if ( CKRELEASER.verbose )
-				print( "    WARNING: File with .html extension does not contain all necessary elements (html, code): "
+				print( "    WARNING: File with .html extension does not contain all necessary elements (html): "
 						+ sourceLocation.getName() );
 
@@ -72,9 +72,10 @@
 
 		node.html = newDocument.importNode( node.html, true );
-		node.code = newDocument.importNode( node.code, true );
+		if ( node.code )
+			node.code = newDocument.importNode( node.code, true );
 
 		if ( newDocument.getElementById( 'html' ) )
 			CKRELEASER.xml.replaceNodeWithNodes( newDocument, newDocument.getElementById( 'html' ), node.html.getChildNodes() );
-		if ( newDocument.getElementById( 'code' ) )
+		if ( node.code && newDocument.getElementById( 'code' ) )
 			CKRELEASER.xml.replaceNodeWithNodes( newDocument, newDocument.getElementById( 'code' ), node.code.getChildNodes() );
 
@@ -160,5 +161,9 @@
 
 			if ( sourceLocation.getAbsolutePath().toLowerCase().endsWith( ".html" ) )
+			{
 				processXmlFile( sourceLocation, targetLocation );
+				if ( CKRELEASER.verbose )
+					print( 'Processing sample: ' + sourceLocation );
+			}
 			else
 				CKRELEASER.io.copy( sourceLocation, targetLocation );
Index: /CKReleaser/trunk/test/_assets/samples/api_dialog.correct.txt
===================================================================
--- /CKReleaser/trunk/test/_assets/samples/api_dialog.correct.txt	(revision 3710)
+++ /CKReleaser/trunk/test/_assets/samples/api_dialog.correct.txt	(revision 3710)
@@ -0,0 +1,208 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Sample - CKEditor</title>
+	<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+<!-- CKReleaser %REMOVE_LINE%
+	<script type="text/javascript" src="../ckeditor.js"></script>
+CKReleaser %REMOVE_LINE% -->
+	<script src="../ckeditor_source.js" type="text/javascript"></script> <!-- CKReleaser %REMOVE_LINE% -->
+<!--
+	## Uncomment this if loading the "basic" version.
+
+	<script type="text/javascript" src="../_source/core/loader.js"></script>
+	<script type="text/javascript">
+	//<![CDATA[
+
+// Loaded dependencies of sample.js.
+CKEDITOR.loader.load( 'core/ajax' );
+CKEDITOR.loader.load( 'core/env' );
+
+	//]]>
+	</script>
+-->
+	<script src="sample.js" type="text/javascript"></script>
+	<link href="sample.css" rel="stylesheet" type="text/css"/>
+	<style id="styles" type="text/css">
+
+.cke_button_myDialogCmd .cke_icon
+{
+	display : none !important;
+}
+
+.cke_button_myDialogCmd .cke_label
+{
+	display : inline !important;
+}
+
+	</style>
+	<script id="headscript" type="text/javascript">
+	//<![CDATA[
+
+// When opening a dialog, its "definition" is created for it, for
+// each editor instance. The "dialogDefinition" event is then
+// fired. We should use this event to make customizations to the
+// definition of existing dialogs.
+CKEDITOR.on( 'dialogDefinition', function( ev )
+	{
+		// Take the dialog name and its definition from the event
+		// data.
+		var dialogName = ev.data.name;
+		var dialogDefinition = ev.data.definition;
+
+		// Check if the definition is from the dialog we're
+		// interested on (the "Link" dialog).
+		if ( dialogName == 'link' )
+		{
+			// Get a reference to the "Link Info" tab.
+			var infoTab = dialogDefinition.getContents( 'info' );
+
+			// Add a text field to the "info" tab.
+			infoTab.add( {
+					type : 'text',
+					label : 'My Custom Field',
+					id : 'customField',
+					'default' : 'Sample!',
+					validate : function()
+					{
+						if ( /\d/.test( this.getValue() ) )
+							return 'My Custom Field must not contain digits';
+					}
+				});
+
+			// Remove the "Link Type" combo and the "Browser
+			// Server" button from the "info" tab.
+			infoTab.remove( 'linkType' );
+			infoTab.remove( 'browse' );
+
+			// Set the default value for the URL field.
+			var urlField = infoTab.get( 'url' );
+			urlField['default'] = 'www.example.com';
+
+			// Remove the "Target" tab from the "Link" dialog.
+			dialogDefinition.removeContents( 'target' );
+
+			// Add a new tab to the "Link" dialog.
+			dialogDefinition.addContents({
+				id : 'customTab',
+				label : 'My Tab',
+				accessKey : 'M',
+				elements : [
+					{
+						id : 'myField1',
+						type : 'text',
+						label : 'My Text Field'
+					},
+					{
+						id : 'myField2',
+						type : 'text',
+						label : 'Another Text Field'
+					}
+				]
+			});
+		}
+	});
+
+	//]]>
+	</script>
+</head>
+<body>
+	<h1>
+		CKEditor Sample
+	</h1>
+	<!-- This <div> holds alert messages to be display in the sample page. -->
+	<div id="alerts">
+		<noscript>
+			<p>
+				<strong>CKEditor requires JavaScript to run</strong>. In a browser with no JavaScript
+				support, like yours, you should still see the contents (HTML data) and you should
+				be able to edit it normally, without a rich editor interface.
+			</p>
+		</noscript>
+	</div>
+	<!-- This <fieldset> holds the HTML that you will usually find in your
+	     pages. -->
+	<fieldset title="Output">
+		<legend>Output</legend>
+		<p>
+			This sample shows how to use the dialog API to customize dialogs whithout changing
+			the original editor code. The following customizations are being done::</p>
+		<ol>
+			<li><strong>Add dialog pages</strong> ("My Tab" in the Link dialog).</li>
+			<li><strong>Remove a dialog tab</strong> ("Target" tab from the Link dialog).</li>
+			<li><strong>Add dialog fields</strong> ("My Custom Field" into the Link dialog).</li>
+			<li><strong>Remove dialog fields</strong> ("Link Type" and "Browser Server" the Link dialog).</li>
+			<li><strong>Set default values for dialog fields</strong> (for the "URL" field in the
+				Link dialog). </li>
+			<li><strong>Create a custom dialog</strong> ("My Dialog" button).</li>
+		</ol>
+		<textarea cols="80" id="editor1" name="editor1" rows="10">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		<script type="text/javascript">
+		//<![CDATA[
+			// Replace the <textarea id="editor1"> with an CKEditor instance.
+			var editor = CKEDITOR.replace( 'editor1',
+				{
+					// Defines a simpler toolbar to be used in this sample.
+					// Note that we have added out "MyButton" button here.
+					toolbar : [ [ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike','-','Link', '-', 'MyButton' ] ]
+				});
+
+			// Listen for the "pluginsLoaded" event, so we are sure that the
+			// "dialog" plugin has been loaded and we are able to do our
+			// customizations.
+			editor.on( 'pluginsLoaded', function( ev )
+				{
+					// If our custom dialog has not been registered, do that now.
+					if ( !CKEDITOR.dialog.exists( 'myDialog' ) )
+					{
+						// We need to do the following trick to find out the dialog
+						// definition file URL path. In the real world, you would simply
+						// point to an absolute path directly, like "/mydir/mydialog.js".
+						var href = document.location.href.split( '/' );
+						href.pop();
+						href.push( 'api_dialog', 'my_dialog.js' );
+						href = href.join( '/' );
+
+						// Finally, register the dialog.
+						CKEDITOR.dialog.add( 'myDialog', href );
+					}
+
+					// Register the command used to open the dialog.
+					editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
+
+					// Add the a custom toolbar buttons, which fires the above
+					// command..
+					editor.ui.addButton( 'MyButton',
+						{
+							label : 'My Dialog',
+							command : 'myDialogCmd'
+						} );
+				});
+		//]]>
+		</script>
+	</fieldset>
+	<!-- This <fieldset> contains the output readable code that illustrates
+	     how to use the editor, having the results shown in this sample. -->
+	<fieldset title="Code">
+		<legend>Code</legend>
+		<script id="code" type="text/javascript">
+		//<![CDATA[
+			document.write( CKEDITOR.samples.codeData );
+		//]]>
+		</script>
+	</fieldset>
+	<div id="footer">
+		<hr/>
+		<p>
+			CKEditor - The text editor for Internet - <a href="http://ckeditor.com/" shape="rect">http://ckeditor.com</a>
+		</p>
+		<p id="copy">
+			Copyright © 2003-2009, <a href="http://cksource.com/" shape="rect">CKSource</a> - Frederico Knabben. All rights reserved.
+		</p>
+	</div>
+</body>
+</html>
Index: /CKReleaser/trunk/test/_assets/samples/api_dialog.html
===================================================================
--- /CKReleaser/trunk/test/_assets/samples/api_dialog.html	(revision 3710)
+++ /CKReleaser/trunk/test/_assets/samples/api_dialog.html	(revision 3710)
@@ -0,0 +1,153 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
+For licensing, see LICENSE.html or http://ckeditor.com/license
+-->
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>Replace Textarea by Code - CKEditor Sample</title>
+	<script type="text/javascript" src="sample.js"></script>
+	<style id="styles" type="text/css">
+
+.cke_button_myDialogCmd .cke_icon
+{
+	display : none !important;
+}
+
+.cke_button_myDialogCmd .cke_label
+{
+	display : inline !important;
+}
+
+	</style>
+	<script id="headscript" type="text/javascript">
+	//<![CDATA[
+
+// When opening a dialog, its "definition" is created for it, for
+// each editor instance. The "dialogDefinition" event is then
+// fired. We should use this event to make customizations to the
+// definition of existing dialogs.
+CKEDITOR.on( 'dialogDefinition', function( ev )
+	{
+		// Take the dialog name and its definition from the event
+		// data.
+		var dialogName = ev.data.name;
+		var dialogDefinition = ev.data.definition;
+
+		// Check if the definition is from the dialog we're
+		// interested on (the "Link" dialog).
+		if ( dialogName == 'link' )
+		{
+			// Get a reference to the "Link Info" tab.
+			var infoTab = dialogDefinition.getContents( 'info' );
+
+			// Add a text field to the "info" tab.
+			infoTab.add( {
+					type : 'text',
+					label : 'My Custom Field',
+					id : 'customField',
+					'default' : 'Sample!',
+					validate : function()
+					{
+						if ( /\d/.test( this.getValue() ) )
+							return 'My Custom Field must not contain digits';
+					}
+				});
+
+			// Remove the "Link Type" combo and the "Browser
+			// Server" button from the "info" tab.
+			infoTab.remove( 'linkType' );
+			infoTab.remove( 'browse' );
+
+			// Set the default value for the URL field.
+			var urlField = infoTab.get( 'url' );
+			urlField['default'] = 'www.example.com';
+
+			// Remove the "Target" tab from the "Link" dialog.
+			dialogDefinition.removeContents( 'target' );
+
+			// Add a new tab to the "Link" dialog.
+			dialogDefinition.addContents({
+				id : 'customTab',
+				label : 'My Tab',
+				accessKey : 'M',
+				elements : [
+					{
+						id : 'myField1',
+						type : 'text',
+						label : 'My Text Field'
+					},
+					{
+						id : 'myField2',
+						type : 'text',
+						label : 'Another Text Field'
+					}
+				]
+			});
+		}
+	});
+
+	//]]>
+	</script>
+</head>
+<body>
+	<div id="html">
+		<p>
+			This sample shows how to use the dialog API to customize dialogs whithout changing
+			the original editor code. The following customizations are being done::</p>
+		<ol>
+			<li><strong>Add dialog pages</strong> ("My Tab" in the Link dialog).</li>
+			<li><strong>Remove a dialog tab</strong> ("Target" tab from the Link dialog).</li>
+			<li><strong>Add dialog fields</strong> ("My Custom Field" into the Link dialog).</li>
+			<li><strong>Remove dialog fields</strong> ("Link Type" and "Browser Server" the Link dialog).</li>
+			<li><strong>Set default values for dialog fields</strong> (for the "URL" field in the
+				Link dialog). </li>
+			<li><strong>Create a custom dialog</strong> ("My Dialog" button).</li>
+		</ol>
+		<textarea id="editor1" name="editor1" rows="10" cols="80">&lt;p&gt;This is some &lt;strong&gt;sample text&lt;/strong&gt;. You are using &lt;a href="http://www.fckeditor.net/"&gt;CKEditor&lt;/a&gt;.&lt;/p&gt;</textarea>
+		<script type="text/javascript">
+		//<![CDATA[
+			// Replace the <textarea id="editor1"> with an CKEditor instance.
+			var editor = CKEDITOR.replace( 'editor1',
+				{
+					// Defines a simpler toolbar to be used in this sample.
+					// Note that we have added out "MyButton" button here.
+					toolbar : [ [ 'Source', '-', 'Bold', 'Italic', 'Underline', 'Strike','-','Link', '-', 'MyButton' ] ]
+				});
+
+			// Listen for the "pluginsLoaded" event, so we are sure that the
+			// "dialog" plugin has been loaded and we are able to do our
+			// customizations.
+			editor.on( 'pluginsLoaded', function( ev )
+				{
+					// If our custom dialog has not been registered, do that now.
+					if ( !CKEDITOR.dialog.exists( 'myDialog' ) )
+					{
+						// We need to do the following trick to find out the dialog
+						// definition file URL path. In the real world, you would simply
+						// point to an absolute path directly, like "/mydir/mydialog.js".
+						var href = document.location.href.split( '/' );
+						href.pop();
+						href.push( 'api_dialog', 'my_dialog.js' );
+						href = href.join( '/' );
+
+						// Finally, register the dialog.
+						CKEDITOR.dialog.add( 'myDialog', href );
+					}
+
+					// Register the command used to open the dialog.
+					editor.addCommand( 'myDialogCmd', new CKEDITOR.dialogCommand( 'myDialog' ) );
+
+					// Add the a custom toolbar buttons, which fires the above
+					// command..
+					editor.ui.addButton( 'MyButton',
+						{
+							label : 'My Dialog',
+							command : 'myDialogCmd'
+						} );
+				});
+		//]]>
+		</script>
+	</div>
+</body>
+</html>
Index: /CKReleaser/trunk/test/test.js
===================================================================
--- /CKReleaser/trunk/test/test.js	(revision 3709)
+++ /CKReleaser/trunk/test/test.js	(revision 3710)
@@ -7,4 +7,5 @@
 {
 	var releaser = new CKRELEASER.releaser();
+	CKRELEASER.verbose = true;
 
 	// Run tests.
