[freeside-commits] freeside/httemplate/elements/fckeditor/editor/dialog fck_about.html, 1.1, 1.1.6.1 fck_anchor.html, 1.1, 1.1.6.1 fck_button.html, 1.1, 1.1.6.1 fck_checkbox.html, 1.1, 1.1.6.1 fck_colorselector.html, 1.1, 1.1.6.1 fck_div.html, NONE, 1.1.2.2 fck_docprops.html, 1.1, 1.1.6.1 fck_flash.html, 1.1, 1.1.6.1 fck_form.html, 1.1, 1.1.6.1 fck_hiddenfield.html, 1.1, 1.1.6.1 fck_image.html, 1.1, 1.1.6.1 fck_link.html, 1.1, 1.1.6.1 fck_listprop.html, 1.1, 1.1.6.1 fck_paste.html, 1.1, 1.1.6.1 fck_radiobutton.html, 1.1, 1.1.6.1 fck_replace.html, 1.1, 1.1.6.1 fck_scayt.html, NONE, 1.1.2.2 fck_select.html, 1.1, 1.1.6.1 fck_smiley.html, 1.1, 1.1.6.1 fck_source.html, 1.1, 1.1.6.1 fck_specialchar.html, 1.1, 1.1.6.1 fck_spellerpages.html, 1.1, 1.1.6.1 fck_table.html, 1.1, 1.1.6.1 fck_tablecell.html, 1.1, 1.1.6.1 fck_template.html, 1.1, 1.1.6.1 fck_textarea.html, 1.1, 1.1.6.1 fck_textfield.html, 1.1, 1.1.6.1

Mark Wells mark at wavetail.420.am
Tue Mar 16 01:34:52 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog
In directory wavetail.420.am:/tmp/cvs-serv23603/editor/dialog

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	fck_about.html fck_anchor.html fck_button.html 
	fck_checkbox.html fck_colorselector.html fck_docprops.html 
	fck_flash.html fck_form.html fck_hiddenfield.html 
	fck_image.html fck_link.html fck_listprop.html fck_paste.html 
	fck_radiobutton.html fck_replace.html fck_select.html 
	fck_smiley.html fck_source.html fck_specialchar.html 
	fck_spellerpages.html fck_table.html fck_tablecell.html 
	fck_template.html fck_textarea.html fck_textfield.html 
Added Files:
      Tag: FREESIDE_1_9_BRANCH
	fck_div.html fck_scayt.html 
Log Message:
FCKeditor 2.6.6

Index: fck_table.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_table.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_table.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_table.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,14 +29,15 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
-// Gets the document DOM
-var oDOM = oEditor.FCK.EditorDocument ;
+var FCKDomTools = oEditor.FCKDomTools ;
 
 // Gets the table if there is one selected.
 var table ;
-var e = oEditor.FCKSelection.GetSelectedElement() ;
+var e = dialog.Selection.GetSelectedElement() ;
+var hasColumnHeaders ;
 
 if ( ( !e && document.location.search.substr(1) == 'Parent' ) || ( e && e.tagName != 'TABLE' ) )
 	e = oEditor.FCKSelection.MoveToAncestorNode( 'TABLE' ) ;
@@ -83,14 +84,48 @@
 		document.getElementById('txtSummary').value     = GetAttribute( table, 'summary', '' ) ;
 //		document.getElementById('cmbFontStyle').value	= table.className ;
 
-		if (table.caption) document.getElementById('txtCaption').value = table.caption.innerHTML ;
+		var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
+		if ( eCaption ) document.getElementById('txtCaption').value = eCaption.innerHTML ;
+
+		hasColumnHeaders = true ;
+		// Check if all the first cells in every row are TH
+		for (var row=0; row<table.rows.length; row++)
+		{
+			// If just one cell isn't a TH then it isn't a header column
+			if ( table.rows[row].cells[0].nodeName != 'TH' )
+			{
+				hasColumnHeaders = false ;
+
+				break;
+			}
+		}
+
+		// Check if the table contains <thead>
+		if ((table.tHead !== null) )
+		{
+			if (hasColumnHeaders)
+				GetE('selHeaders').value = 'both' ;
+			else
+				GetE('selHeaders').value = 'row' ;
+		}
+		else
+		{
+			if (hasColumnHeaders)
+				GetE('selHeaders').value = 'col' ;
+			else
+				GetE('selHeaders').value = '' ;
+		}
+
 
 		document.getElementById('txtRows').disabled    = true ;
 		document.getElementById('txtColumns').disabled = true ;
+		SelectField( 'txtWidth' ) ;
 	}
+	else
+		SelectField( 'txtRows' ) ;
 
-	window.parent.SetOkButton( true ) ;
-	window.parent.SetAutoSize( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
 }
 
 // Fired when the user press the OK button
@@ -98,8 +133,11 @@
 {
 	var bExists = ( table != null ) ;
 
+	var oDoc = oEditor.FCK.EditorDocument ;
+	oEditor.FCKUndo.SaveUndoStep() ;
+
 	if ( ! bExists )
-		table = oEditor.FCK.EditorDocument.createElement( "TABLE" ) ;
+		table = oDoc.createElement( "TABLE" ) ;
 
 	// Removes the Width and Height styles
 	if ( bExists && table.style.width )		table.style.width = null ; //.removeAttribute("width") ;
@@ -117,48 +155,159 @@
 	SetAttribute( table, 'cellSpacing'	, GetE('txtCellSpacing').value ) ;
 	SetAttribute( table, 'summary'		, GetE('txtSummary').value ) ;
 
-	var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
+	var headers = GetE('selHeaders').value ;
+	if ( bExists )
+	{
+		// Should we make a <thead>?
+		if ( table.tHead==null && (headers=='row' || headers=='both') )
+		{
+			var oThead = table.createTHead() ;
+			var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
+			var theRow= FCKDomTools.GetFirstChild( tbody, 'TR' ) ;
 
-	if ( document.getElementById('txtCaption').value != '')
+			//now change TD to TH:
+			for (var i = 0; i<theRow.childNodes.length ; i++)
 	{
-		if ( !eCaption )
+				var th = RenameNode(theRow.childNodes[i], 'TH') ;
+				if (th != null)
+					th.scope='col' ;
+			}
+			oThead.appendChild( theRow ) ;
+		}
+
+		if ( table.tHead!==null && !(headers=='row' || headers=='both') )
 		{
-			eCaption = oEditor.FCK.EditorDocument.createElement( 'CAPTION' ) ;
-			table.insertBefore( eCaption, table.firstChild ) ;
+			// Move the row out of the THead and put it in the TBody:
+			var tHead = table.tHead ;
+			var tbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
+
+			var previousFirstRow = tbody.firstChild ;
+			while ( tHead.firstChild )
+			{
+				var theRow = tHead.firstChild ;
+				for (var i = 0; i < theRow.childNodes.length ; i++ )
+				{
+					var newCell = RenameNode( theRow.childNodes[i], 'TD' ) ;
+					if ( newCell != null )
+						newCell.removeAttribute( 'scope' ) ;
+				}
+				tbody.insertBefore( theRow, previousFirstRow ) ;
+			}
+			table.removeChild( tHead ) ;
 		}
 
-		eCaption.innerHTML = document.getElementById('txtCaption').value ;
+		// Should we make all first cells in a row TH?
+		if ( (!hasColumnHeaders)  && (headers=='col' || headers=='both') )
+		{
+			for( var row=0 ; row < table.rows.length ; row++ )
+			{
+				var newCell = RenameNode(table.rows[row].cells[0], 'TH') ;
+				if ( newCell != null )
+					newCell.scope = 'row' ;
 	}
-	else if ( bExists && eCaption )
+		}
+
+		// Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)
+		if ( (hasColumnHeaders)  && !(headers=='col' || headers=='both') )
 	{
-		if ( oEditor.FCKBrowserInfo.IsIE )
-			eCaption.innerHTML = '' ;	// TODO: It causes an IE internal error if using removeChild or table.deleteCaption().
-		else
-			eCaption.parentNode.removeChild( eCaption ) ;
+			for( var row=0 ; row < table.rows.length ; row++ )
+			{
+				var oRow = table.rows[row] ;
+				if ( oRow.parentNode.nodeName == 'TBODY' )
+				{
+					var newCell = RenameNode(oRow.cells[0], 'TD') ;
+					if (newCell != null)
+						newCell.removeAttribute( 'scope' ) ;
+				}
+			}
+		}
 	}
 
 	if (! bExists)
 	{
-		var iRows = document.getElementById('txtRows').value ;
-		var iCols = document.getElementById('txtColumns').value ;
+		var iRows = GetE('txtRows').value ;
+		var iCols = GetE('txtColumns').value ;
 
-		for ( var r = 0 ; r < iRows ; r++ )
+		var startRow = 0 ;
+		// Should we make a <thead> ?
+		if (headers=='row' || headers=='both')
 		{
+			startRow++ ;
+			var oThead = table.createTHead() ;
 			var oRow = table.insertRow(-1) ;
+			oThead.appendChild(oRow);
+
 			for ( var c = 0 ; c < iCols ; c++ )
 			{
-				var oCell = oRow.insertCell(-1) ;
+				var oThcell = oDoc.createElement( 'TH' ) ;
+				oThcell.scope = 'col' ;
+				oRow.appendChild( oThcell ) ;
 				if ( oEditor.FCKBrowserInfo.IsGeckoLike )
-					oCell.innerHTML = GECKO_BOGUS ;
-				//oCell.innerHTML = "&nbsp;" ;
+					oEditor.FCKTools.AppendBogusBr( oThcell ) ;
 			}
 		}
 
-		oEditor.FCKUndo.SaveUndoStep() ;
+		// Opera automatically creates a tbody when a thead has been added
+		var oTbody = FCKDomTools.GetFirstChild( table, 'TBODY' ) ;
+		if ( !oTbody )
+		{
+			// make TBODY if it doesn't exist
+			oTbody = oDoc.createElement( 'TBODY' ) ;
+			table.appendChild( oTbody ) ;
+		}
+		for ( var r = startRow ; r < iRows; r++ )
+		{
+			var oRow = oDoc.createElement( 'TR' ) ;
+			oTbody.appendChild(oRow) ;
+
+			var startCol = 0 ;
+			// Is the first column a header?
+			if (headers=='col' || headers=='both')
+			{
+				var oThcell = oDoc.createElement( 'TH' ) ;
+				oThcell.scope = 'row' ;
+				oRow.appendChild( oThcell ) ;
+				if ( oEditor.FCKBrowserInfo.IsGeckoLike )
+					oEditor.FCKTools.AppendBogusBr( oThcell ) ;
+
+				startCol++ ;
+			}
+			for ( var c = startCol ; c < iCols ; c++ )
+			{
+				// IE will leave the TH at the end of the row if we use now oRow.insertCell(-1)
+				var oCell = oDoc.createElement( 'TD' ) ;
+				oRow.appendChild( oCell ) ;
+				if ( oEditor.FCKBrowserInfo.IsGeckoLike )
+					oEditor.FCKTools.AppendBogusBr( oCell ) ;
+			}
+		}
 
 		oEditor.FCK.InsertElement( table ) ;
 	}
 
+	var eCaption = oEditor.FCKDomTools.GetFirstChild( table, 'CAPTION' ) ;
+
+	if ( eCaption && !oEditor.FCKBrowserInfo.IsIE )
+		eCaption.parentNode.removeChild( eCaption ) ;
+
+	if ( document.getElementById('txtCaption').value != '' )
+	{
+		if ( !eCaption || !oEditor.FCKBrowserInfo.IsIE )
+		{
+			eCaption = oDoc.createElement( 'CAPTION' ) ;
+			table.insertBefore( eCaption, table.firstChild ) ;
+		}
+
+		eCaption.innerHTML = document.getElementById('txtCaption').value ;
+	}
+	else if ( bExists && eCaption )
+	{
+		// TODO: It causes an IE internal error if using removeChild or
+		// table.deleteCaption() (see #505).
+		if ( oEditor.FCKBrowserInfo.IsIE )
+			eCaption.innerHTML = '' ;
+	}
+
 	return true ;
 }
 
@@ -171,39 +320,44 @@
 				<table cellspacing="1" cellpadding="1" width="100%" border="0">
 					<tr>
 						<td valign="top">
-							<table cellspacing="0" cellpadding="0" border="0">
+							<table cellspacing="1" cellpadding="0" border="0">
 								<tr>
 									<td>
 										<span fcklang="DlgTableRows">Rows</span>:</td>
 									<td>
-										&nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3" name="txtRows"
+										&nbsp;<input id="txtRows" type="text" maxlength="3" size="2" value="3"
 											onkeypress="return IsDigit(event);" /></td>
 								</tr>
 								<tr>
 									<td>
 										<span fcklang="DlgTableColumns">Columns</span>:</td>
 									<td>
-										&nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2" name="txtColumns"
+										&nbsp;<input id="txtColumns" type="text" maxlength="2" size="2" value="2"
 											onkeypress="return IsDigit(event);" /></td>
 								</tr>
 								<tr>
+									<td><span fcklang="DlgTableHeaders">Headers</span>:</td>
 									<td>
-										&nbsp;</td>
-									<td>
-										&nbsp;</td>
+										&nbsp;<select id="selHeaders">
+											<option fcklang="DlgTableHeadersNone" value="">None</option>
+											<option fcklang="DlgTableHeadersRow" value="row">First row</option>
+											<option fcklang="DlgTableHeadersColumn" value="col">First column</option>
+											<option fcklang="DlgTableHeadersBoth" value="both">Both</option>
+										</select>
+									</td>
 								</tr>
 								<tr>
 									<td>
 										<span fcklang="DlgTableBorder">Border size</span>:</td>
 									<td>
-										&nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1" name="txtBorder"
+										&nbsp;<input id="txtBorder" type="text" maxlength="2" size="2" value="1"
 											onkeypress="return IsDigit(event);" /></td>
 								</tr>
 								<tr>
 									<td>
 										<span fcklang="DlgTableAlign">Alignment</span>:</td>
 									<td>
-										&nbsp;<select id="selAlignment" name="selAlignment">
+										&nbsp;<select id="selAlignment">
 											<option fcklang="DlgTableAlignNotSet" value="" selected="selected">&lt;Not set&gt;</option>
 											<option fcklang="DlgTableAlignLeft" value="left">Left</option>
 											<option fcklang="DlgTableAlignCenter" value="center">Center</option>
@@ -220,10 +374,10 @@
 									<td>
 										<span fcklang="DlgTableWidth">Width</span>:</td>
 									<td>
-										&nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200" name="txtWidth"
+										&nbsp;<input id="txtWidth" type="text" maxlength="4" size="3" value="200"
 											onkeypress="return IsDigit(event);" /></td>
 									<td>
-										&nbsp;<select id="selWidthType" name="selWidthType">
+										&nbsp;<select id="selWidthType">
 											<option fcklang="DlgTableWidthPx" value="pixels" selected="selected">pixels</option>
 											<option fcklang="DlgTableWidthPc" value="percent">percent</option>
 										</select></td>
@@ -232,23 +386,18 @@
 									<td>
 										<span fcklang="DlgTableHeight">Height</span>:</td>
 									<td>
-										&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" /></td>
+										&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" onkeypress="return IsDigit(event);" /></td>
 									<td>
 										&nbsp;<span fcklang="DlgTableWidthPx">pixels</span></td>
 								</tr>
 								<tr>
-									<td>
-										&nbsp;</td>
-									<td>
-										&nbsp;</td>
-									<td>
-										&nbsp;</td>
+									<td colspan="3">&nbsp;</td>
 								</tr>
 								<tr>
 									<td nowrap="nowrap">
 										<span fcklang="DlgTableCellSpace">Cell spacing</span>:</td>
 									<td>
-										&nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1" name="txtCellSpacing"
+										&nbsp;<input id="txtCellSpacing" type="text" maxlength="2" size="2" value="1"
 											onkeypress="return IsDigit(event);" /></td>
 									<td>
 										&nbsp;</td>
@@ -257,7 +406,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgTableCellPad">Cell padding</span>:</td>
 									<td>
-										&nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1" name="txtCellPadding"
+										&nbsp;<input id="txtCellPadding" type="text" maxlength="2" size="2" value="1"
 											onkeypress="return IsDigit(event);" /></td>
 									<td>
 										&nbsp;</td>

Index: fck_template.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_template.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_template.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_template.html	16 Mar 2010 08:34:49 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -191,7 +191,7 @@
 	oEditor.FCKUndo.SaveUndoStep() ;
 
 	if ( GetE('xChkReplaceAll').checked )
-		FCK.SetHTML( FCK._Templates[index].Html ) ;
+		FCK.SetData( FCK._Templates[index].Html ) ;
 	else
 		FCK.InsertHtml( FCK._Templates[index].Html ) ;
 

Index: fck_radiobutton.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_radiobutton.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_radiobutton.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_radiobutton.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,12 +29,13 @@
 		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+var oActiveEl = dialog.Selection.GetSelectedElement() ;
 
 window.onload = function()
 {
@@ -50,20 +51,16 @@
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
 {
-	if ( !oActiveEl )
-	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
-		oActiveEl.type = 'radio' ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-	}
+	oEditor.FCKUndo.SaveUndoStep() ;
 
-	if ( GetE('txtName').value.length > 0 )
-		oActiveEl.name = GetE('txtName').value ;
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'radio' } ) ;
 
 	if ( oEditor.FCKBrowserInfo.IsIE )
 		oActiveEl.value = GetE('txtValue').value ;

Index: fck_hiddenfield.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_hiddenfield.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_hiddenfield.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_hiddenfield.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,14 +29,16 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
+
 var FCK = oEditor.FCK ;
 
 // Gets the document DOM
 var oDOM = FCK.EditorDocument ;
 
 // Get the selected flash embed (if available).
-var oFakeImage = FCK.Selection.GetSelectedElement() ;
+var oFakeImage = dialog.Selection.GetSelectedElement() ;
 var oActiveEl ;
 
 if ( oFakeImage )
@@ -58,34 +60,31 @@
 		GetE('txtValue').value		= oActiveEl.value ;
 	}
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 
 function Ok()
 {
-	if ( !oActiveEl )
-	{
-		oActiveEl = FCK.EditorDocument.createElement( 'INPUT' ) ;
-		oActiveEl.type = 'hidden' ;
+	oEditor.FCKUndo.SaveUndoStep() ;
 
-		oFakeImage = null ;
-	}
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'hidden' } ) ;
 
-	oActiveEl.name = GetE('txtName').value ;
 	SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
 	if ( !oFakeImage )
 	{
 		oFakeImage	= oEditor.FCKDocumentProcessor_CreateFakeImage( 'FCK__InputHidden', oActiveEl ) ;
 		oFakeImage.setAttribute( '_fckinputhidden', 'true', 0 ) ;
-		oFakeImage	= FCK.InsertElementAndGetIt( oFakeImage ) ;
+
+		oActiveEl.parentNode.insertBefore( oFakeImage, oActiveEl ) ;
+		oActiveEl.parentNode.removeChild( oActiveEl ) ;
 	}
 	else
 		oEditor.FCKUndo.SaveUndoStep() ;
 
-	oEditor.FCKFlashProcessor.RefreshView( oFakeImage, oActiveEl ) ;
-
 	return true ;
 }
 

Index: fck_link.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_link.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_link.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_link.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -108,7 +108,9 @@
 				<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
 				<br />
 				<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
-				<iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe>
+				<script type="text/javascript">
+					document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
+				</script>
 			</form>
 		</div>
 		<div id="divTarget" style="DISPLAY: none">

--- NEW FILE: fck_scayt.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
-->
<html>
	<head>
		<title>SCAYT Properties</title>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta content="noindex, nofollow" name="robots">
		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
		<link type="text/css" href="fck_scayt/scayt_dialog.css" rel="stylesheet" />
		<script type="text/javascript">

			var dialog	= window.parent ;
			var oEditor	= dialog.InnerDialogLoaded() ;
			var FCKLang = oEditor.FCKLang;
			var scayt = oEditor.scayt;
			var scayt_control = oEditor.scayt_control;
			var lang_list = {};
            var	sLang;
			var	fckLang;
            var chosed_lang;
			var options;
			var	tabs = scayt_control.uiTags || [1,1,0,1];
			var	userDicActive = tabs[2] == 1;
			var	captions;
			var dic_buttons = [
				// [0] contains buttons for creating
				"dic_create,dic_restore",
				// [1] contains buton for manipulation
				"dic_rename,dic_delete"
			];

			var get =
				new function(){

					var mergeObjs = function(obj1, obj2)
					{
						for (var k in obj1)
							obj2[k] = obj1[k];

						return obj2;
					};

					var removeWhitespaces = function( s )
					{
						s = s.replace( new RegExp("^ +| +$"), '' ) ;
						return s ;
					};

					var addEvent = function( el ,sEventName, fTodo )
					{
						if (el.addEventListener) {
							el.addEventListener (sEventName,fTodo,false);

						} else if (el.attachEvent) {
							el.attachEvent ("on"+sEventName,fTodo);

						} else {
							el["on"+sEventName] = fTodo;
						}
					};

					var getElementsByClassName = function (node,classname ,strTag) {
						strTag = strTag || "*";
					  	node = node || document;
						if (node.getElementsByClassName)
							return node.getElementsByClassName(classname);
						else {
							var objColl = node.getElementsByTagName(strTag);
							if (!objColl.length &&  strTag == "*" &&  node.all) objColl = node.all;
							var arr = new Array();
							var delim = classname.indexOf('|') != -1  ? '|' : ' ';
							var arrClass = classname.split(delim);
							for (var i = 0, j = objColl.length; i < j; i++) {
								var arrObjClass = objColl[i].className.split(' ');
								if (delim == ' ' && arrClass.length > arrObjClass.length) continue;
								var c = 0;
								comparisonLoop:
									for ( var k = 0, l = arrObjClass.length ; k < l ; k++ )
									{
										for ( var m = 0, n = arrClass.length ; m < n ; m++ )
										{
											if ( arrClass[m] == arrObjClass[k] )
												c++ ;

											if ( ( delim == '|' && c == 1 ) || ( delim == ' ' && c == arrClass.length ) )
											{
												arr.push( objColl[i] ) ;
												break comparisonLoop ;
											}
										}
									}
							}
							return arr;
						}
					};

					var hasClassName = function ( sClassName, elem ) {
						//.split(/\s+/);
						var aCnames = elem.className.split(/\s+/) || [];
						for (var i=0, l=aCnames.length; i<l ; i++){
							if (sClassName == aCnames[i])
								return true;
						}
						return false;
					}

					var single = {
						addClass 	: function ( sClassName ) {
							//console.info( sClassName, this.className, );
							if ( hasClassName(sClassName , this) )
								return this;
							var s = removeWhitespaces(this.className + " " +sClassName);
							this.className = s;
							return this;

						},
						removeClass : function ( sClassName ) {
							var s = removeWhitespaces(this.className.replace(sClassName,""));
							this.className = s;
							return this;
						},
						setStyle : function( oStyles )
						{
							for ( var style in oStyles )
							{
								this.style[style] = oStyles[style] ;
							}
							return this ;
						},
						bindOnclick		: function ( handler ) {
							//addEvent( this, "click" , handler);
							this.onclick = handler;
							return this;
						},
						bindOnchange	: function ( handler ) {
							//addEvent( this, "change" , handler);
							this.onchange = handler;
							return this;
						},
						getAttr : function ( sAttrName )
						{
							if ( !sAttrName )
								return null;

							return this[sAttrName];
						},
						setAttr : function ( sAttrName , attrVal )
						{
							if ( !sAttrName || !attrVal )
								return null;

							this[sAttrName] = attrVal;

							return this;
						},
						remAttr : function ( sAttrName )
						{
							if ( !sAttrName )
								return null;
						}
					};

					var singleCaller = function ( sMethod,args ) {
						for ( var i=0, l=this.length; i<l ; i++ ){
							var oItem = mergeObjs( single, this[i] );
							oItem[sMethod].apply(this[i],args);
						}
					};


					var collection = {

						addClass 	: function ( sClassName ){
							singleCaller.call(this, "addClass", [sClassName])
							return this;
						},
						removeClass 	: function ( sClassName ) {
							singleCaller.call(this, "removeClass", [sClassName])
							return this;
						},
						setStyle		: function ( oStyles ) {
							singleCaller.call(this, "setStyle", [oStyles])
							return this;
						},
						bindOnclick		: function ( f ) {
							singleCaller.call(this, "bindOnclick", [f])
							return this;
						},
						bindOnchange	: function ( f ) {
							singleCaller.call(this, "bindOnchange", [f])
							return this;
						},

						forEach : function ( fTodo ) {
							//el,i
							for (var i=0, l=this.length; i<l ; i++){
								fTodo.apply(this[i], [this[i],i ]);
							}
							return this;
						}

					};



					this.byClass = function( sClassName ){
						var o = getElementsByClassName(document, sClassName );
						return o ? mergeObjs( collection, o ) : o;
					};

					this.byId = function( sId ){
						var o = document.getElementById( sId );
						return o ? mergeObjs( single, o ) : o;
					};

					this.gup = function ( name ){
				        name = name.replace( /[\[]/, '\\\[' ).replace( /[\]]/, '\\\]' ) ;
				        var regexS = '[\\?&]' + name + '=([^&#]*)' ;
				        var regex = new RegExp( regexS ) ;
				        var results = regex.exec( window.location.href ) ;

				        if( results == null )
				            return '' ;
				        else
				            return results[ 1 ] ;
					};
					this.wrap = function ( o ) {
						return o ? mergeObjs( single, o ) : o;
					};
					this.forEach = function ( oScope, fTodo ){
						collection.forEach.apply( oScope,[fTodo] );
					};

				 };



			// Add the dialog tabs.
			tabs[0] == 1 && dialog.AddTab( 'options', 'Options' ) ;
			tabs[1] == 1 && dialog.AddTab( 'langs', 'Languages' ) ;
			tabs[2] == 1 && dialog.AddTab( 'dictionary', 'Dictionary' ) ;
			tabs[3] == 1 && dialog.AddTab( 'about', 'About' ) ;

			// Function called when a dialog tab is selected.
			function OnDialogTabChange( tabCode )
			{
				ShowE('inner_options'	, ( tabCode == 'options' ) ) ;
				ShowE('inner_langs'	, ( tabCode == 'langs' ) ) ;
				ShowE('inner_dictionary'		, ( tabCode == 'dictionary' ) ) ;
				ShowE('inner_about'	, ( tabCode == 'about' ) ) ;
			}





			window.onload = function()
			{
				// Things to do when the page is loaded.

				if ( document.location.search.length )
					dialog.SetSelectedTab( document.location.search.substr(1) ) ;

				dialog.SetOkButton( true ) ;


	                if (!scayt) throw "SCAYT is undefined";
	                if (!scayt_control) throw "SCAYT_CONTROL is undefined";

					// show alowed tabs
					tabs = scayt_control.uiTags || [1,1,1,0];


					sLang = scayt_control.getLang();
	                fckLang = "en";
					options = scayt_control.option();
					// apply captions
					scayt.getCaption( fckLang, function( caps )
					{
						//console.info( "scayt.getCaption runned" )
						captions = caps;
						apllyCaptions();
						//lang_list = scayt.getLangList();
		                lang_list = scayt.getLangList() ;//|| {ltr: {"en_US" : "English","en_GB" : "British English","pt_BR" : "Brazilian Portuguese","da_DK" : "Danish","nl_NL" : "Dutch","en_CA" : "English Canadian","fi_FI" : "Finnish","fr_FR" : "French","fr_CA" : "French Canadian","de_DE" : "German","el_GR" : "Greek","hu_HU" : "Hungarian","it_IT" : "Italian","nb_NO" : "Norwegian","pl_PL" : "Polish","pt_PT" : "Portuguese","ru_RU" : "Russian","es_ES" : "Spanish","sv_SE" : "Swedish","tr_TR" : "Turkish","uk_UA" : "Ukrainian","cy_GB" : "Welsh"},rtl: {"ar_EG" : "Arabic"}};




		                // ** animate options
		                get.byClass("_scayt_option").forEach(function(el,i){

							if ('undefined' != typeof(options[el.name])) {
		                        // *** set default values

		                        if ( 1 == options[ el.name ] ){
		                           //el.setAttribute("checked","true");
								   get.wrap(el).setAttr("checked" ,true)
								   //document.all_options[el.name].checked = "true";
								   //el.checked = true;
								   //alert( options[ dojo.attr(el ,'name') ] + " el " )
		                        }
								//console.info(options)
		                        // *** bind events
		                        get.wrap(el).bindOnclick( function(ev){

									var that = get.wrap(this);
									var isCheck = that.getAttr("checked");
									//console.info(isCheck)
		                            if ( isCheck == false ) {

										//that.setAttr("checked",false);
										options[ this.name ] = 0;
		                            }else{
		                                //that.setAttr("checked",true);
										options[ this.name ] = 1;
		                            }
									//console.info(options)
		                        });
		                    }
		                });


		                // * Create languages tab
		                // ** convert langs obj to array
		                var lang_arr = [];

		                for (var k in lang_list.rtl){
		                    // find curent lang
		                    if ( k == sLang)
		                        chosed_lang = lang_list.rtl[k] + "::" + k;
		                    lang_arr[lang_arr.length] = lang_list.rtl[k] + "::" + k;

		                }
		                for (var k in lang_list.ltr){
		                     // find curent lang
		                     if ( k == sLang)
		                        chosed_lang = lang_list.ltr[k] + "::" + k;
		                    lang_arr[lang_arr.length] = lang_list.ltr[k] + "::" + k;
		                }
		                lang_arr.sort();

		                // ** find lang containers

		                var lcol = get.byId("lcolid");
		                var rcol = get.byId("rcolid");
		                // ** place langs in DOM

		                get.forEach(lang_arr , function( l , i ){

							//console.info( l,i );

							var l_arr = l.split('::');
		                    var l_name = l_arr[0];
		                    var l_code = l_arr[1];
		                    var row = document.createElement('div');
		                    row.id = l_code;
		                    row.className = "li";
		                    // split langs on half
		                    var col = ( i < lang_arr.length/2 ) ? lcol:rcol ;

		                    // append row
		                    //console.dir( col )
		                    col.appendChild(row);
		                    var row_dom = get.byId( l_code )
		                    row_dom.innerHTML = l_name;

		                    var checkActiveLang = function( id ){
		                        return chosed_lang.split("::")[1] == id;
		                    };
		                    // bind click
		                    row_dom.bindOnclick(function(ev){

		                        if ( checkActiveLang(this.id) ) return false;
		                        var elId = this.id;
								get.byId(this.id)
	                            	.addClass("Button")
	                            	.removeClass("DarkBackground");

		                        window.setTimeout( function (){ get.byId(elId).setStyle({opacity:"0.5",cursor:"no-drop"});  } ,300 );

		                        get.byId(chosed_lang.split("::")[1])
		                            .addClass("DarkBackground")
		                            .removeClass("Button")
		                            .setStyle({opacity:"1",cursor:"pointer"});

		                        chosed_lang = this.innerHTML + "::" + this.id;
		                        return true;
		                    })
							.setStyle({
		                        cursor:"pointer"
		                    });
		                    // select current lang
		                    if (l == chosed_lang)
		                        row_dom.addClass("Button").setStyle({opacity:"0.5",cursor:"no-drop"});
		                    else
		                        row_dom.addClass("DarkBackground").setStyle({opacity:"1"});

		                });
						// * user dictionary
						if ( userDicActive ){
							initUserDictionary()

						}
					});



			}




			var buttons = [ 'dic_create','dic_delete','dic_rename','dic_restore' ];
			var labels  = [ 'mixedCase','mixedWithDigits','allCaps','ignoreDomainNames' ];


			function apllyCaptions ( )
			{

				// fill tabs headers
				// add missing captions

				get.byClass("PopupTab").forEach(function(el,i){

					if ( tabs[i] == 1 ){
						el.style.display = "block";
					}
					el.innerHTML = captions['tab_'+el.id];

				});

				// Fill options labels.
				for ( i in labels )
				{
					var label = 'label_' + labels[ i ],
						labelElement = document.getElementById( label );

					if (  'undefined' != typeof labelElement
					   && 'undefined' != typeof captions[ label ] && captions[ label ] !== ""
					   && 'undefined' != typeof options[labels[ i ]] )
					{
						labelElement.innerHTML = captions[ label ];
						var labelParent = labelElement.parentNode;
						labelParent.style.display = "block";
					}
				}
				// fill dictionary section
				for ( var i in buttons )
				{
					var button = buttons[ i ];
					get.byId( button ).innerHTML = '<span>' + captions[ 'button_' + button]  +'</span>' ;
				}
				get.byId("dname").innerHTML = captions['label_dname'];
				get.byId( 'dic_info' ).innerHTML = captions[ 'dic_info' ];

				// fill about tab
				var about = '<p>' + captions[ 'about_throwt_image' ] + '</p>'+
					'<p>' + captions[ 'version' ]  + scayt.version.toString() + '</p>' +
					'<p>' + captions[ 'about_throwt_copy' ] + '</p>';

				get.byId( 'scayt_about' ).innerHTML = about;

			}


			function initUserDictionary () {

				scayt.getNameUserDictionary(
					function( o )
					{
						var dic_name = o.dname;
						if ( dic_name )
						{
							get.byId( 'dic_name' ).value = dic_name;
							display_dic_buttons( dic_buttons[1] );
						}
						else
							display_dic_buttons( dic_buttons[0] );

					},
					function ()
					{
						get.byId( 'dic_name' ).value("");
						dic_error_message(captions["err_dic_enable"] || "Used dictionary are unaveilable now.")
					}
				);

				dic_success_message("");

				 // ** bind event listeners
                get.byClass("button").bindOnclick(function( ){

					// get dic name
					var dic_name = get.byId('dic_name').value ;
					// check common dictionary rules
					if (!dic_name) {
						dic_error_message(" Dictionary name should not be empty. ");
						return false;
					}
					//apply handler
					window[this.id].apply( window, [this, dic_name, dic_buttons ] );

					//console.info( typeof window[this.id], window[this.id].calle )
					return false;
				});

			}

			dic_create = function( el, dic_name , dic_buttons )
			{
				// comma separated button's ids include repeats if exists
				var all_buttons = dic_buttons[0] + ',' + dic_buttons[1];

				var err_massage = captions["err_dic_create"];
				var suc_massage = captions["succ_dic_create"];
				//console.info("--plugin ");

				scayt.createUserDictionary(dic_name,
					function(arg)
						{
							//console.info( "dic_create callback called with args" , arg );
							hide_dic_buttons ( all_buttons );
							display_dic_buttons ( dic_buttons[1] );
							suc_massage = suc_massage.replace("%s" , arg.dname );
							dic_success_message (suc_massage);
						},
					function(arg)
						{
							//console.info( "dic_create errorback called with args" , arg )
							err_massage = err_massage.replace("%s" ,arg.dname );
							dic_error_message ( err_massage + "( "+ (arg.message || "") +")");
						});

			};

			dic_rename = function( el, dic_name , dic_buttons )
			{
				//
				// try to rename dictionary
				// @TODO: rename dict
				//console.info ( captions["err_dic_rename"] )
				var err_massage = captions["err_dic_rename"] || "";
				var suc_massage = captions["succ_dic_rename"] || "";
				scayt.renameUserDictionary(dic_name,
					function(arg)
						{
							//console.info( "dic_rename callback called with args" , arg );
							suc_massage = suc_massage.replace("%s" , arg.dname );
							set_dic_name( dic_name );
							dic_success_message ( suc_massage );
						},
					function(arg)
						{
							//console.info( "dic_rename errorback called with args" , arg )
							err_massage = err_massage.replace("%s" , arg.dname  );
							set_dic_name( dic_name );
							dic_error_message( err_massage + "( " + ( arg.message || "" ) + " )" );
						});
			};

			dic_delete = function ( el, dic_name , dic_buttons )
			{
				var all_buttons = dic_buttons[0] + ',' + dic_buttons[1];
				var err_massage = captions["err_dic_delete"];
				var suc_massage = captions["succ_dic_delete"];

				// try to delete dictionary
				// @TODO: delete dict
				scayt.deleteUserDictionary(
					function(arg)
						{
							//console.info( "dic_delete callback " , dic_name ,arg );
							suc_massage = suc_massage.replace("%s" , arg.dname );
							hide_dic_buttons ( all_buttons );
							display_dic_buttons ( dic_buttons[0] );
							set_dic_name( "" ); // empty input field
							dic_success_message( suc_massage );
						},
					function(arg)
						{
							//console.info( " dic_delete errorback called with args" , arg )
							err_massage = err_massage.replace("%s" , arg.dname );
							dic_error_message(err_massage);
						});
			};

			dic_restore = dialog.dic_restore || function ( el, dic_name , dic_buttons )
			{
				// try to restore existing dictionary
				var all_buttons = dic_buttons[0] + ',' + dic_buttons[1];
				var err_massage = captions["err_dic_restore"];
				var suc_massage = captions["succ_dic_restore"];

				scayt.restoreUserDictionary(dic_name,
					function(arg)
						{
							//console.info( "dic_restore callback called with args" , arg );
							suc_massage = suc_massage.replace("%s" , arg.dname );
							hide_dic_buttons ( all_buttons );
							display_dic_buttons(dic_buttons[1]);
							dic_success_message( suc_massage );
						},
					function(arg)
						{
							//console.info( " dic_restore errorback called with args" , arg )
							err_massage = err_massage.replace("%s" , arg.dname );
							dic_error_message( err_massage );
						});
			};

			function dic_error_message( m )
			{
				if ( !m )
					return ;

				get.byId('dic_message').innerHTML =  '<span class="error">' + m + '</span>' ;
			}

            function dic_success_message( m )
            {
				if ( !m )
					return ;

				get.byId('dic_message').innerHTML = '<span class="success">' + m + '</span>' ;
			}

			function display_dic_buttons ( sIds ){
				sIds = new String( sIds );
				get.forEach( sIds.split(','), function ( id,i) {
					get.byId(id).setStyle({display:"inline"});
				});
			}
			function hide_dic_buttons ( sIds ){
				sIds = new String( sIds );
				get.forEach( sIds.split(','), function ( id,i) {
					get.byId(id).setStyle({display:"none"});
				});
			}
			function set_dic_name ( dic_name ) {
				get.byId('dic_name').value = dic_name;
			}
			function display_dic_tab () {
				get.byId("dic_tab").style.display = "block";
			}

			function Ok()
			{
				// Things to do when the Ok button is clicked.
				var c = 0;
			    // set upp options if any was set
			    var o = scayt_control.option();
				//console.info(options)
			    for ( var oN in options ) {

			        if ( o[oN] != options[oN] && c == 0){
						//console.info( "set option " )
			            scayt_control.option( options );
			            c++;
			        }
			    }
			    //setup languge if it was change
			    var csLang = chosed_lang.split("::")[1];
			    if ( csLang && sLang != csLang ){
			        scayt_control.setLang( csLang );
					//console.info(sLang+" -> "+csLang , scayt_control)
			        c++;
			    }

			    if ( c > 0 )  scayt_control.refresh();

			    return dialog.Cancel();

			}

		</script>
	</head>
	<body style="OVERFLOW: hidden" scroll="no">
		<div class="tab_container" id="inner_options">

           <ul id="scayt_options">
               <li class="_scayt_options">
                   <input class="_scayt_option" type="checkbox" value="0" name="allCaps" />
                   <label for="allCaps" id="label_allCaps"></label>
               </li>
               <li>
                   <input class="_scayt_option" type="checkbox" value="0" name="ignoreDomainNames" />
                   <label for="ignoreDomainNames" id="label_ignoreDomainNames"></label>
               </li>
               <li>
                   <input class="_scayt_option" type="checkbox" value="0" name="mixedCase" />
                   <label for="mixedCase" id="label_mixedCase"></label>
               </li>
               <li>
                   <input class="_scayt_option" type="checkbox" value="0" name="mixedWithDigits" />
                   <label for="mixedWithDigits" id="label_mixedWithDigits"></label>
               </li>
           </ul>
		</div>
		<div class="tab_container" id="inner_langs">

		   <div class="lcol" id="lcolid"></div>
           <div class="rcol" id="rcolid"></div>
		</div>
		<div class="tab_container" id="inner_dictionary">

		   <div id="dic_message"></div>
			<div id="_off_dic_tab" class="dictionary" >
				<div style="padding-left:10px;">
							<label id="dname" for="dname"></label>
							<input type="text" size="14" maxlength="15" value="" id="dic_name" name="dic_name"/>
						</div>
						<div class="dic_buttons">
							<a href="#" id="dic_create" class="button">  </a>
							<a href="#" id="dic_delete" class="button">  </a>
							<a href="#" id="dic_rename" class="button">  </a>
							<a href="#" id="dic_restore" class="button">  </a>
						</div>

						<div id="dic_info"></div>

			</div>
		</div>
		<div id="inner_about" class="tab_container">
		   <div id="scayt_about"></div>
		</div>
	</body>
</html>

Index: fck_button.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_button.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_button.html	1 Aug 2007 22:25:14 -0000	1.1
+++ fck_button.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,12 +29,13 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor	= dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+var oActiveEl = dialog.Selection.GetSelectedElement() ;
 
 window.onload = function()
 {
@@ -46,25 +47,21 @@
 		GetE('txtName').value	= oActiveEl.name ;
 		GetE('txtValue').value	= oActiveEl.value ;
 		GetE('txtType').value	= oActiveEl.type ;
-
-		GetE('txtType').disabled = true ;
 	}
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
 {
-	if ( !oActiveEl )
-	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
-		oActiveEl.type = GetE('txtType').value ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-	}
+	oEditor.FCKUndo.SaveUndoStep() ;
+
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ;
 
-	oActiveEl.name = GetE('txtName').value ;
 	SetAttribute( oActiveEl, 'value', GetE('txtValue').value ) ;
 
 	return true ;

Index: fck_listprop.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_listprop.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_listprop.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_listprop.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,13 +29,14 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 var sListType = ( location.search == '?OL' ? 'OL' : 'UL' ) ;
 
-var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( sListType ) ;
+var oActiveEl = dialog.Selection.GetSelection().MoveToAncestorNode( sListType ) ;
 var oActiveSel ;
 
 window.onload = function()
@@ -63,7 +64,10 @@
 			oActiveSel.value = oActiveEl.getAttribute('type') ;
 	}
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+
+	SelectField( sListType == 'OL' ? 'txtStartPosition' : 'selBulleted' ) ;
 }
 
 function Ok()

Index: fck_about.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_about.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_about.html	1 Aug 2007 22:25:13 -0000	1.1
+++ fck_about.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -70,7 +70,7 @@
 	<div id="divAbout">
 		<table cellpadding="0" cellspacing="0" border="0" width="100%" style="height: 100%">
 			<tr>
-				<td>
+				<td colspan="2">
 					<img alt="" src="fck_about/logo_fckeditor.gif" width="236" height="41" align="left" />
 					<table width="80" border="0" cellspacing="0" cellpadding="5" bgcolor="#ffffff" align="right">
 						<tr>
@@ -78,31 +78,37 @@
 								border-left: #000000 1px solid; border-bottom: #000000 1px solid">
 								<span fcklang="DlgAboutVersion">version</span>
 								<br />
-								<b>2.4.3</b><br />
-								Build 15657</td>
+								<b>2.6.6</b><br />
+								Build 25427</td>
 						</tr>
 					</table>
 				</td>
 			</tr>
 			<tr style="height: 100%">
-				<td align="center">
-					&nbsp;<br />
+				<td align="center" valign="middle">
 					<span style="font-size: 14px" dir="ltr">
-						<br />
 						<b><a href="http://www.fckeditor.net/?about" target="_blank" title="Visit the FCKeditor web site">
 							Support <b>Open Source</b> Software</a></b> </span>
-					<br />
-					<br />
-					<br />
+					<div style="padding-top:15px">
+						<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" />
+					</div>
+				</td>
+				<td align="center" nowrap="nowrap" valign="middle">
+					<div>
+						<div style="margin-bottom:5px" dir="ltr">Selected Sponsor</div>
+						<a href="http://www.spellchecker.net/fckeditor/" target="_blank"><img alt="Selected Sponsor" border="0" src="fck_about/sponsors/spellchecker_net.gif" width="75" height="75" /></a>
+					</div>
+				</td>
+			</tr>
+			<tr>
+				<td width="100%" nowrap="nowrap">
 					<span fcklang="DlgAboutInfo">For further information go to</span> <a href="http://www.fckeditor.net/?About"
 						target="_blank">http://www.fckeditor.net/</a>.
 					<br />
-					Copyright &copy; 2003-2007 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a>
+					Copyright &copy; 2003-2010 <a href="#" onclick="SendEMail();">Frederico Caldeira Knabben</a>
 				</td>
-			</tr>
-			<tr>
 				<td align="center">
-					<img alt="" src="fck_about/logo_fredck.gif" width="87" height="36" />
+					<a href="http://www.fckeditor.net/sponsors/apply" target="_blank">Become a Sponsor</a>
 				</td>
 			</tr>
 		</table>
@@ -140,11 +146,11 @@
 var sUserLang = '?' ;
 
 if ( window.navigator.language )
-	sUserLang = window.navigator.language.toLowerCase() ;
+	sUserLang = window.navigator.language ;
 else if ( window.navigator.userLanguage )
-	sUserLang = window.navigator.userLanguage.toLowerCase() ;
+	sUserLang = window.navigator.userLanguage ;
 
-document.write( '<b>User Language<\/b><br />' + sUserLang ) ;
+document.write( '<b>Language<\/b><br />' + sUserLang ) ;
 //-->
 					</script>
 				</td>

Index: fck_image.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_image.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_image.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_image.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -28,7 +28,11 @@
 	<meta name="robots" content="noindex, nofollow" />
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script src="fck_image/fck_image.js" type="text/javascript"></script>
-	<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+		<script type="text/javascript">
+
+document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
+
+		</script>
 </head>
 <body scroll="no" style="overflow: hidden">
 	<div id="divInfo">
@@ -160,7 +164,9 @@
 			<input id="txtUploadFile" style="width: 100%" type="file" size="40" name="NewFile" /><br />
 			<br />
 			<input id="btnUpload" type="submit" value="Send it to the Server" fcklang="DlgLnkBtnUpload" />
-			<iframe name="UploadWindow" style="display: none" src="javascript:void(0)"></iframe>
+			<script type="text/javascript">
+				document.write( '<iframe name="UploadWindow" style="display: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
+			</script>
 		</form>
 	</div>
 	<div id="divLink" style="display: none">

Index: fck_smiley.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_smiley.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_smiley.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_smiley.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -33,19 +33,25 @@
 			cursor: hand;
 		}
 	</style>
+	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 window.onload = function ()
 {
 	// First of all, translate the dialog box texts
 	oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+	dialog.SetAutoSize( true ) ;
 }
 
 function InsertSmiley( url )
 {
-	var oImg = oEditor.FCK.CreateElement( 'IMG' ) ;
+	oEditor.FCKUndo.SaveUndoStep() ;
+
+	var oImg = oEditor.FCK.InsertElement( 'img' ) ;
 	oImg.src = url ;
 	oImg.setAttribute( '_fcksavedurl', url ) ;
 
@@ -54,7 +60,7 @@
 	// everything before closing.
 	document.body.innerHTML = '' ;
 
-	window.parent.Cancel() ;
+	dialog.Cancel() ;
 }
 
 function over(td)
@@ -68,7 +74,7 @@
 }
 	</script>
 </head>
-<body scroll="no">
+<body style="overflow: hidden">
 	<table cellpadding="2" cellspacing="2" align="center" border="0" width="100%" height="100%">
 		<script type="text/javascript">
 

--- NEW FILE: fck_div.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<!--
 * FCKeditor - The text editor for Internet - http://www.fckeditor.net
 * Copyright (C) 2003-2010 Frederico Caldeira Knabben
 *
 * == BEGIN LICENSE ==
 *
 * Licensed under the terms of any of the following licenses at your
 * choice:
 *
 *  - GNU General Public License Version 2 or later (the "GPL")
 *    http://www.gnu.org/licenses/gpl.html
 *
 *  - GNU Lesser General Public License Version 2.1 or later (the "LGPL")
 *    http://www.gnu.org/licenses/lgpl.html
 *
 *  - Mozilla Public License Version 1.1 or later (the "MPL")
 *    http://www.mozilla.org/MPL/MPL-1.1.html
 *
 * == END LICENSE ==
 *
 * Form dialog window.
-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta content="noindex, nofollow" name="robots" />
	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
	<script type="text/javascript">
var dialog	= window.parent ;
var oEditor = dialog.InnerDialogLoaded() ;
var FCK = oEditor.FCK ;
var FCKLang = oEditor.FCKLang ;
var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
var FCKStyles = oEditor.FCKStyles ;
var FCKElementPath = oEditor.FCKElementPath ;
var FCKDomRange = oEditor.FCKDomRange ;
var FCKDomTools = oEditor.FCKDomTools ;
var FCKDomRangeIterator = oEditor.FCKDomRangeIterator ;
var FCKListsLib = oEditor.FCKListsLib ;
var AlwaysCreate = dialog.Args().CustomValue ;

String.prototype.IEquals = function()
{
	var thisUpper = this.toUpperCase() ;

	var aArgs = arguments ;

	// The arguments could also be a single array.
	if ( aArgs.length == 1 && aArgs[0].pop )
		aArgs = aArgs[0] ;

	for ( var i = 0 ; i < aArgs.length ; i++ )
	{
		if ( thisUpper == aArgs[i].toUpperCase() )
			return true ;
	}
	return false ;
}

var CurrentContainers = [] ;
if ( !AlwaysCreate )
{
	dialog.Selection.EnsureSelection() ;
	CurrentContainers = FCKDomTools.GetSelectedDivContainers() ;
}

// Add some tabs
dialog.AddTab( 'General', FCKLang.DlgDivGeneralTab );
dialog.AddTab( 'Advanced', FCKLang.DlgDivAdvancedTab ) ;

function AddStyleOption( styleName )
{
	var el = GetE( 'selStyle' ) ;
	var opt = document.createElement( 'option' ) ;
	opt.text = opt.value = styleName ;

	if ( FCKBrowserInfo.IsIE )
		el.add( opt ) ;
	else
		el.add( opt, null ) ;
}

function OnDialogTabChange( tabCode )
{
	ShowE( 'divGeneral', tabCode == 'General' ) ;
	ShowE( 'divAdvanced', tabCode == 'Advanced' ) ;
	dialog.SetAutoSize( true ) ;
}

function GetNearestAncestorDirection( node )
{
	var dir = 'ltr' ;	// HTML default.
	while ( ( node = node.parentNode ) )
	{
		if ( node.dir )
			dir = node.dir ;
	}
	return dir ;
}

window.onload = function()
{
	// First of all, translate the dialog box texts
	oEditor.FCKLanguageManager.TranslatePage(document) ;

	dialog.SetOkButton( true ) ;
	dialog.SetAutoSize( true ) ;

	// Popuplate the style menu
	var styles = FCKStyles.GetStyles() ;
	var selectableStyles = {} ;
	for ( var i in styles )
	{
		if ( ! /^_FCK_/.test( i ) && styles[i].Element == 'div' )
			selectableStyles[i] = styles[i] ;
	}
	if ( CurrentContainers.length <= 1 )
	{
		var target = CurrentContainers[0] ;
		var match = null ;
		for ( var i in selectableStyles )
		{
			if ( target && styles[i].CheckElementRemovable( target, true ) )
				match = i ;
		}
		if ( !match )
			AddStyleOption( "" ) ;
		for ( var i in selectableStyles )
			AddStyleOption( i ) ;
		if ( match )
			GetE( 'selStyle' ).value = match ;

		// Set the value for other inputs
		if ( target )
		{
			GetE( 'txtClass' ).value = target.className ;
			GetE( 'txtId' ).value = target.id ;
			GetE( 'txtLang' ).value = target.lang ;
			GetE( 'txtInlineStyle').value = target.style.cssText ;
			GetE( 'txtTitle' ).value = target.title ;
			GetE( 'selLangDir').value = target.dir || GetNearestAncestorDirection( target ) ;
		}
	}
	else
	{
		GetE( 'txtId' ).disabled = true ;
		AddStyleOption( "" ) ;
		for ( var i in selectableStyles )
			AddStyleOption( i ) ;
	}
}

function CreateDiv()
{
	var newBlocks = [] ;
	var range = new FCKDomRange( FCK.EditorWindow ) ;
	range.MoveToSelection() ;

	var bookmark = range.CreateBookmark() ;

	// Kludge for #1592: if the bookmark nodes are in the beginning of
	// $tagName, then move them to the nearest block element in the
	// $tagName.
	if ( FCKBrowserInfo.IsIE )
	{
		var bStart	= range.GetBookmarkNode( bookmark, true ) ;
		var bEnd	= range.GetBookmarkNode( bookmark, false ) ;

		var cursor ;

		if ( bStart
				&& bStart.parentNode.nodeName.IEquals( 'div' )
				&& !bStart.previousSibling )
		{
			cursor = bStart ;
			while ( ( cursor = cursor.nextSibling ) )
			{
				if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
					FCKDomTools.MoveNode( bStart, cursor, true ) ;
			}
		}

		if ( bEnd
				&& bEnd.parentNode.nodeName.IEquals( 'div' )
				&& !bEnd.previousSibling )
		{
			cursor = bEnd ;
			while ( ( cursor = cursor.nextSibling ) )
			{
				if ( FCKListsLib.BlockElements[ cursor.nodeName.toLowerCase() ] )
				{
					if ( cursor.firstChild == bStart )
						FCKDomTools.InsertAfterNode( bStart, bEnd ) ;
					else
						FCKDomTools.MoveNode( bEnd, cursor, true ) ;
				}
			}
		}
	}

	var iterator = new FCKDomRangeIterator( range ) ;
	var block ;

	var paragraphs = [] ;
	while ( ( block = iterator.GetNextParagraph() ) )
		paragraphs.push( block ) ;

	// Make sure all paragraphs have the same parent.
	var commonParent = paragraphs[0].parentNode ;
	var tmp = [] ;
	for ( var i = 0 ; i < paragraphs.length ; i++ )
	{
		block = paragraphs[i] ;
		commonParent = FCKDomTools.GetCommonParents( block.parentNode, commonParent ).pop() ;
	}

	// The common parent must not be the following tags: table, tbody, tr, ol, ul.
	while ( commonParent.nodeName.IEquals( 'table', 'tbody', 'tr', 'ol', 'ul' ) )
		commonParent = commonParent.parentNode ;

	// Reconstruct the block list to be processed such that all resulting blocks
	// satisfy parentNode == commonParent.
	var lastBlock = null ;
	while ( paragraphs.length > 0 )
	{
		block = paragraphs.shift() ;
		while ( block.parentNode != commonParent )
			block = block.parentNode ;
		if ( block != lastBlock )
			tmp.push( block ) ;
		lastBlock = block ;
	}
	paragraphs = tmp ;

	// Split the paragraphs into groups depending on their BlockLimit element.
	var groups = [] ;
	var lastBlockLimit = null ;
	for ( var i = 0 ; i < paragraphs.length ; i++ )
	{
		block = paragraphs[i] ;
		var elementPath = new FCKElementPath( block ) ;
		if ( elementPath.BlockLimit != lastBlockLimit )
		{
			groups.push( [] ) ;
			lastBlockLimit = elementPath.BlockLimit ;
		}
		groups[groups.length - 1].push( block ) ;
	}

	// Create a DIV container for each group.
	for ( var i = 0 ; i < groups.length ; i++ )
	{
		var divNode = FCK.EditorDocument.createElement( 'div' ) ;
		groups[i][0].parentNode.insertBefore( divNode, groups[i][0] ) ;
		for ( var j = 0 ; j < groups[i].length ; j++ )
			FCKDomTools.MoveNode( groups[i][j], divNode ) ;
		newBlocks.push( divNode ) ;
	}

	range.MoveToBookmark( bookmark ) ;
	range.Select() ;

	FCK.Focus() ;
	FCK.Events.FireEvent( 'OnSelectionChange' ) ;

	return newBlocks ;
}

function Ok()
{
	oEditor.FCKUndo.SaveUndoStep() ;

	if ( CurrentContainers.length < 1 )
		CurrentContainers = CreateDiv();

	var setValue = function( attrName, inputName )
	{
		var val = GetE( inputName ).value ;
		for ( var i = 0 ; i < CurrentContainers.length ; i++ )
		{
			if ( val == '' )
				CurrentContainers[i].removeAttribute( attrName ) ;
			else
				CurrentContainers[i].setAttribute( attrName, val ) ;
		}
	}

	// Apply modifications to the DIV container according to dialog inputs.
	if ( CurrentContainers.length == 1 )
	{
		setValue( 'class', 'txtClass' ) ;
		setValue( 'id', 'txtId' ) ;
	}
	setValue( 'lang', 'txtLang' ) ;
	if ( FCKBrowserInfo.IsIE )
	{
		for ( var i = 0 ; i < CurrentContainers.length ; i++ )
			CurrentContainers[i].style.cssText = GetE( 'txtInlineStyle' ).value ;
	}
	else
		setValue( 'style', 'txtInlineStyle' ) ;
	setValue( 'title', 'txtTitle' ) ;
	for ( var i = 0 ; i < CurrentContainers.length ; i++ )
	{
		var dir = GetE( 'selLangDir' ).value ;
		var styleName = GetE( 'selStyle' ).value ;
		if ( GetNearestAncestorDirection( CurrentContainers[i] ) != dir )
			CurrentContainers[i].dir = dir ;
		else
			CurrentContainers[i].removeAttribute( 'dir' ) ;

		if ( styleName )
			FCKStyles.GetStyle( styleName ).ApplyToObject( CurrentContainers[i] ) ;
	}

	return true ;
}

	</script>
</head>
<body style="overflow: hidden">
	<div id="divGeneral">
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
			<colgroup span="2">
				<col width="49%" />
				<col width="2%" />
				<col width="49%" />
			</colgroup>
			<tr>
				<td>
					<span fcklang="DlgDivStyle">Style</span><br />
					<select id="selStyle" style="width: 100%;">
					</select>
				</td>
				<td>&nbsp;</td>
				<td>
					<span fcklang="DlgGenClass">Stylesheet Classes</span><br />
					<input id="txtClass" style="width: 100%" type="text" />
				</td>
			</tr>
		</table>
	</div>
	<div id="divAdvanced" style="display: none">
		<table cellspacing="0" cellpadding="0" width="100%" border="0">
			<colgroup span="2">
				<col width="49%" />
				<col width="2%" />
				<col width="49%" />
			</colgroup>
			<tr>
				<td>
					<span fcklang="DlgGenId">Id</span><br />
					<input style="width: 100%" type="text" id="txtId" />
				</td>
				<td>&nbsp;</td>
				<td>
					<span fcklang="DlgGenLangCode">Language Code</span><br />
					<input style="width: 100%" type="text" id="txtLang" />
				</td>
			</tr>
			<tr>
				<td colspan="3">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3">
					<span fcklang="DlgDivInlineStyle">Inline Style</span><br />
					<input style="width: 100%" type="text" id="txtInlineStyle" />
				</td>
			</tr>
			<tr>
				<td colspan="3">&nbsp;</td>
			</tr>
			<tr>
				<td colspan="3">
					<span fcklang="DlgGenTitle">Advisory Title</span><br />
					<input style="width: 100%" type="text" id="txtTitle" />
				</td>
			</tr>
			<tr>
				<td>&nbsp;</td>
			</tr>
			<tr>
				<td>
					<span fcklang="DlgGenLangDir">Language Direction</span><br />
					<select id="selLangDir">
						<option fcklang="DlgGenLangDirLtr" value="ltr">Left to Right (LTR)
						<option fcklang="DlgGenLangDirRtl" value="rtl">Right to Left (RTL)
					</select>
				</td>
			</tr>
		</table>
	</div>
</body>
</html>

Index: fck_tablecell.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_tablecell.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_tablecell.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_tablecell.html	16 Mar 2010 08:34:49 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,10 +29,10 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
-// Gets the document DOM
-var oDOM = oEditor.FCK.EditorDocument ;
+var FCKDomTools = oEditor.FCKDomTools ;
 
 // Array of selected Cells
 var aCells = oEditor.FCKTableHandler.GetSelectedCells() ;
@@ -44,8 +44,9 @@
 
 	SetStartupValue() ;
 
-	window.parent.SetOkButton( true ) ;
-	window.parent.SetAutoSize( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtWidth' ) ;
 }
 
 function SetStartupValue()
@@ -72,13 +73,15 @@
 		GetE('txtCollSpan').value		= GetAttribute( oCell, 'colSpan' ) ;
 		GetE('txtBackColor').value		= GetAttribute( oCell, 'bgColor' ) ;
 		GetE('txtBorderColor').value	= GetAttribute( oCell, 'borderColor' ) ;
-//		GetE('cmbFontStyle').value		= oCell.className ;
+		GetE('selCellType').value     = oCell.nodeName.toLowerCase() ;
 	}
 }
 
 // Fired when the user press the OK button
 function Ok()
 {
+	oEditor.FCKUndo.SaveUndoStep() ;
+
 	for( i = 0 ; i < aCells.length ; i++ )
 	{
 		if ( GetE('txtWidth').value.length > 0 )
@@ -87,7 +90,7 @@
 			aCells[i].removeAttribute( 'width', 0 ) ;
 
 		if ( GetE('selWordWrap').value == 'false' )
-			aCells[i].noWrap = true ;
+			SetAttribute( aCells[i], 'noWrap', 'nowrap' ) ;
 		else
 			aCells[i].removeAttribute( 'noWrap' ) ;
 
@@ -98,7 +101,25 @@
 		SetAttribute( aCells[i], 'colSpan'		, GetE('txtCollSpan').value ) ;
 		SetAttribute( aCells[i], 'bgColor'		, GetE('txtBackColor').value ) ;
 		SetAttribute( aCells[i], 'borderColor'	, GetE('txtBorderColor').value ) ;
-//		SetAttribute( aCells[i], 'className'	, GetE('cmbFontStyle').value ) ;
+
+		var cellType = GetE('selCellType').value ;
+		if ( aCells[i].nodeName.toLowerCase() != cellType )
+			aCells[i] = RenameNode( aCells[i], cellType ) ;
+	}
+
+	// The cells need to be reselected, otherwise the caret will appear inside the table borders (Gecko)
+	// or sent back to the beginning of the document (Opera and Safari).
+	// Strangely, IE works ok so no change is needed for IE.
+	if ( !oEditor.FCKBrowserInfo.IsIE )
+	{
+		var selection = oEditor.FCK.EditorWindow.getSelection() ;
+		selection.removeAllRanges() ;
+		for ( var i = 0 ; i < aCells.length ; i++ )
+		{
+			var range = oEditor.FCK.EditorDocument.createRange() ;
+			range.selectNode( aCells[i] ) ;
+			selection.addRange( range ) ;
+		}
 	}
 
 	return true ;
@@ -118,7 +139,7 @@
 
 function SelectColor( wich )
 {
-	oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, wich == 'Back' ? SelectBackColor : SelectBorderColor, window ) ;
+	oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', oEditor.FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, wich == 'Back' ? SelectBackColor : SelectBorderColor ) ;
 }
 
 	</script>
@@ -136,7 +157,7 @@
 										<span fcklang="DlgCellWidth">Width</span>:</td>
 									<td>
 										&nbsp;<input onkeypress="return IsDigit(event);" id="txtWidth" type="text" maxlength="4"
-											size="3" name="txtWidth" />&nbsp;<select id="selWidthType" name="selWidthType">
+											size="3" />&nbsp;<select id="selWidthType">
 												<option fcklang="DlgCellWidthPx" value="pixels" selected="selected">pixels</option>
 												<option fcklang="DlgCellWidthPc" value="percent">percent</option>
 											</select></td>
@@ -145,7 +166,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgCellHeight">Height</span>:</td>
 									<td>
-										&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" name="txtHeight" onkeypress="return IsDigit(event);" />&nbsp;<span
+										&nbsp;<input id="txtHeight" type="text" maxlength="4" size="3" onkeypress="return IsDigit(event);" />&nbsp;<span
 											fcklang="DlgCellWidthPx">pixels</span></td>
 								</tr>
 								<tr>
@@ -158,7 +179,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgCellWordWrap">Word Wrap</span>:</td>
 									<td>
-										&nbsp;<select id="selWordWrap" name="selAlignment">
+										&nbsp;<select id="selWordWrap">
 											<option fcklang="DlgCellWordWrapYes" value="true" selected="selected">Yes</option>
 											<option fcklang="DlgCellWordWrapNo" value="false">No</option>
 										</select></td>
@@ -173,7 +194,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgCellHorAlign">Horizontal Alignment</span>:</td>
 									<td>
-										&nbsp;<select id="selHAlign" name="selAlignment">
+										&nbsp;<select id="selHAlign">
 											<option fcklang="DlgCellHorAlignNotSet" value="" selected>&lt;Not set&gt;</option>
 											<option fcklang="DlgCellHorAlignLeft" value="left">Left</option>
 											<option fcklang="DlgCellHorAlignCenter" value="center">Center</option>
@@ -184,7 +205,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgCellVerAlign">Vertical Alignment</span>:</td>
 									<td>
-										&nbsp;<select id="selVAlign" name="selAlignment">
+										&nbsp;<select id="selVAlign">
 											<option fcklang="DlgCellVerAlignNotSet" value="" selected>&lt;Not set&gt;</option>
 											<option fcklang="DlgCellVerAlignTop" value="top">Top</option>
 											<option fcklang="DlgCellVerAlignMiddle" value="middle">Middle</option>
@@ -200,11 +221,28 @@
 							<table cellspacing="0" cellpadding="0" border="0">
 								<tr>
 									<td nowrap="nowrap">
+									 <span fcklang="DlgCellType">Cell Type</span>:</td>
+									<td colspan="2">
+										&nbsp; <select id="selCellType">
+											<option fcklang="DlgCellTypeData" value="td">Data</option>
+											<option fcklang="DlgCellTypeHeader" value="th">Header</option>
+										</select>
+								</tr>
+								<tr>
+									<td>
+										&nbsp;</td>
+									<td>
+										&nbsp;</td>
+									<td>
+										&nbsp;</td>
+								</tr>
+								<tr>
+									<td nowrap="nowrap">
 										<span fcklang="DlgCellRowSpan">Rows Span</span>:</td>
 									<td>
 										&nbsp;
 										<input onkeypress="return IsDigit(event);" id="txtRowSpan" type="text" maxlength="3" size="2"
-											name="txtRows"></td>
+											></td>
 									<td>
 									</td>
 								</tr>
@@ -214,7 +252,7 @@
 									<td>
 										&nbsp;
 										<input onkeypress="return IsDigit(event);" id="txtCollSpan" type="text" maxlength="2"
-											size="2" name="txtColumns"></td>
+											size="2"></td>
 									<td>
 									</td>
 								</tr>
@@ -230,7 +268,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgCellBackColor">Background Color</span>:</td>
 									<td>
-										&nbsp;<input id="txtBackColor" type="text" size="8" name="txtCellSpacing"></td>
+										&nbsp;<input id="txtBackColor" type="text" size="8" /></td>
 									<td>
 										&nbsp;
 										<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Back' )"></td>
@@ -239,7 +277,7 @@
 									<td nowrap="nowrap">
 										<span fcklang="DlgCellBorderColor">Border Color</span>:</td>
 									<td>
-										&nbsp;<input id="txtBorderColor" type="text" size="8" name="txtCellPadding" /></td>
+										&nbsp;<input id="txtBorderColor" type="text" size="8" /></td>
 									<td>
 										&nbsp;
 										<input type="button" fcklang="DlgCellBtnSelect" value="Select..." onclick="SelectColor( 'Border' )" /></td>

Index: fck_replace.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_replace.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_replace.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_replace.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -19,113 +19,606 @@
  *
  * == END LICENSE ==
  *
- * "Replace" dialog box window.
+ * "Find" and "Replace" dialog box window.
 -->
 <html xmlns="http://www.w3.org/1999/xhtml">
 <head>
 	<title></title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta content="noindex, nofollow" name="robots" />
+	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
+var dialogArguments = dialog.Args() ;
+
+var FCKLang = oEditor.FCKLang ;
+var FCKDomTools = oEditor.FCKDomTools ;
+var FCKDomRange = oEditor.FCKDomRange ;
+var FCKListsLib = oEditor.FCKListsLib ;
+var FCKTools = oEditor.FCKTools ;
+var EditorDocument = oEditor.FCK.EditorDocument ;
+var HighlightStyle = oEditor.FCKStyles.GetStyle( '_FCK_SelectionHighlight' )  ;
+
+dialog.AddTab( 'Find', FCKLang.DlgFindTitle ) ;
+dialog.AddTab( 'Replace', FCKLang.DlgReplaceTitle ) ;
+var idMap = {} ;
+
+function OnDialogTabChange( tabCode )
+{
+	ShowE( 'divFind', ( tabCode == 'Find' ) ) ;
+	ShowE( 'divReplace', ( tabCode == 'Replace' ) ) ;
+	idMap['FindText'] = 'txtFind' + tabCode ;
+	idMap['CheckCase'] = 'chkCase' + tabCode ;
+	idMap['CheckWord'] = 'chkWord' + tabCode ;
+
+	if ( tabCode == 'Replace' )
+		dialog.SetAutoSize( true ) ;
+}
+
+GetNextNonEmptyTextNode = function( node, stopNode )
+{
+	while ( ( node = FCKDomTools.GetNextSourceNode( node, false, 3, stopNode ) ) && node && node.length < 1 )
+		1 ;
+	return node ;
+}
+
+CharacterCursor = function( arg )
+{
+	if ( arg.nodeType && arg.nodeType == 9 )
+	{
+		this._textNode = GetNextNonEmptyTextNode( arg.body, arg.documentElement ) ;
+		this._offset = 0 ;
+		this._doc = arg ;
+	}
+	else
+	{
+		this._textNode = arguments[0] ;
+		this._offset = arguments[1] ;
+		this._doc = FCKTools.GetElementDocument( arguments[0] ) ;
+	}
+}
+CharacterCursor.prototype =
+{
+	GetCharacter : function()
+	{
+		return ( this._textNode && this._textNode.nodeValue.charAt( this._offset ) ) || null ;
+	},
+
+	// Non-normalized.
+	GetTextNode : function()
+	{
+		return this._textNode ;
+	},
+
+	// Non-normalized.
+	GetIndex : function()
+	{
+		return this._offset ;
+	},
+
+	// Return value means whehther we've crossed a line break or a paragraph boundary.
+	MoveNext : function()
+	{
+		if ( this._offset < this._textNode.length - 1 )
+		{
+			this._offset++ ;
+			return false ;
+		}
+
+		var crossed = false ;
+		var curNode = this._textNode ;
+		while ( ( curNode = FCKDomTools.GetNextSourceNode( curNode ) )
+				&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
+		{
+			var tag = curNode.nodeName.toLowerCase() ;
+			if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
+				crossed = true ;
+		}
+
+		this._textNode = curNode ;
+		this._offset = 0 ;
+		return crossed ;
+	},
+
+	// Return value means whehther we've crossed a line break or a paragraph boundary.
+	MoveBack : function()
+	{
+		if ( this._offset > 0 && this._textNode.length > 0 )
+		{
+			this._offset = Math.min( this._offset - 1, this._textNode.length - 1 ) ;
+			return false ;
+		}
+
+		var crossed = false ;
+		var curNode = this._textNode ;
+		while ( ( curNode = FCKDomTools.GetPreviousSourceNode( curNode ) )
+				&& curNode && ( curNode.nodeType != 3 || curNode.length < 1 ) )
+		{
+			var tag = curNode.nodeName.toLowerCase() ;
+			if ( FCKListsLib.BlockElements[tag] || tag == 'br' )
+				crossed = true ;
+		}
+
+		this._textNode = curNode ;
+		this._offset = curNode && curNode.length - 1 ;
+		return crossed ;
+	},
+
+	Clone : function()
+	{
+		return new CharacterCursor( this._textNode, this._offset ) ;
+	}
+} ;
+
+CharacterRange = function( initCursor, maxLength )
+{
+	this._cursors = initCursor.push ? initCursor : [initCursor] ;
+	this._maxLength = maxLength ;
+	this._highlightRange = null ;
+}
+CharacterRange.prototype =
+{
+	ToDomRange : function()
+	{
+		var firstCursor = this._cursors[0] ;
+		var lastCursor = this._cursors[ this._cursors.length - 1 ] ;
+		var domRange = new FCKDomRange( FCKTools.GetElementWindow( firstCursor.GetTextNode() ) ) ;
+		var w3cRange = domRange._Range = domRange.CreateRange() ;
+		w3cRange.setStart( firstCursor.GetTextNode(), firstCursor.GetIndex() ) ;
+		w3cRange.setEnd( lastCursor.GetTextNode(), lastCursor.GetIndex() + 1 ) ;
+		domRange._UpdateElementInfo() ;
+		return domRange ;
+	},
+
+	Highlight : function()
+	{
+		if ( this._cursors.length < 1 )
+			return ;
+
+		var domRange = this.ToDomRange() ;
+		HighlightStyle.ApplyToRange( domRange, false, true ) ;
+		this._highlightRange = domRange ;
+
+		var charRange = CharacterRange.CreateFromDomRange( domRange ) ;
+		var focusNode = domRange.StartNode ;
+		if ( focusNode.nodeType != 1 )
+			focusNode = focusNode.parentNode ;
+		FCKDomTools.ScrollIntoView( focusNode, false ) ;
+		this._cursors = charRange._cursors ;
+	},
+
+	RemoveHighlight : function()
+	{
+		if ( this._highlightRange )
+		{
+			HighlightStyle.RemoveFromRange( this._highlightRange, false, true ) ;
+			var charRange = CharacterRange.CreateFromDomRange( this._highlightRange ) ;
+			this._cursors = charRange._cursors ;
+			this._highlightRange = null ;
+		}
+	},
+
+	GetHighlightDomRange : function()
+	{
+		return this._highlightRange;
+	},
+
+	MoveNext : function()
+	{
+		var next = this._cursors[ this._cursors.length - 1 ].Clone() ;
+		var retval = next.MoveNext() ;
+		if ( retval )
+			this._cursors = [] ;
+		this._cursors.push( next ) ;
+		if ( this._cursors.length > this._maxLength )
+			this._cursors.shift() ;
+		return retval ;
+	},
+
+	MoveBack : function()
+	{
+		var prev = this._cursors[0].Clone() ;
+		var retval = prev.MoveBack() ;
+		if ( retval )
+			this._cursors = [] ;
+		this._cursors.unshift( prev ) ;
+		if ( this._cursors.length > this._maxLength )
+			this._cursors.pop() ;
+		return retval ;
+	},
+
+	GetEndCharacter : function()
+	{
+		if ( this._cursors.length < 1 )
+			return null ;
+		var retval = this._cursors[ this._cursors.length - 1 ].GetCharacter() ;
+		return retval ;
+	},
+
+	GetNextRange : function( len )
+	{
+		if ( this._cursors.length == 0 )
+			return null ;
+		var cur = this._cursors[ this._cursors.length - 1 ].Clone() ;
+		cur.MoveNext() ;
+		return new CharacterRange( cur, len ) ;
+	},
+
+	GetCursors : function()
+	{
+		return this._cursors ;
+	}
+} ;
+
+CharacterRange.CreateFromDomRange = function( domRange )
+{
+	var w3cRange = domRange._Range ;
+	var startContainer = w3cRange.startContainer ;
+	var endContainer = w3cRange.endContainer ;
+	var startTextNode, startIndex, endTextNode, endIndex ;
+
+	if ( startContainer.nodeType == 3 )
+	{
+		startTextNode = startContainer ;
+		startIndex = w3cRange.startOffset ;
+	}
+	else if ( domRange.StartNode.nodeType == 3 )
+	{
+		startTextNode = domRange.StartNode ;
+		startIndex = 0 ;
+	}
+	else
+	{
+		startTextNode = GetNextNonEmptyTextNode( domRange.StartNode, domRange.StartNode.parentNode ) ;
+		if ( !startTextNode )
+			return null ;
+		startIndex = 0 ;
+	}
+
+	if ( endContainer.nodeType == 3 && w3cRange.endOffset > 0 )
+	{
+		endTextNode = endContainer ;
+		endIndex = w3cRange.endOffset - 1 ;
+	}
+	else
+	{
+		endTextNode = domRange.EndNode ;
+		while ( endTextNode.nodeType != 3 )
+			endTextNode = endTextNode.lastChild ;
+		endIndex = endTextNode.length - 1 ;
+	}
+
+	var cursors = [] ;
+	var current = new CharacterCursor( startTextNode, startIndex ) ;
+	cursors.push( current ) ;
+	if ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) && !domRange.CheckIsEmpty() )
+	{
+		do
+		{
+			current = current.Clone() ;
+			current.MoveNext() ;
+			cursors.push( current ) ;
+		}
+		while ( !( current.GetTextNode() == endTextNode && current.GetIndex() == endIndex ) ) ;
+	}
+
+	return new CharacterRange( cursors, cursors.length ) ;
+}
+
+// Knuth-Morris-Pratt Algorithm for stream input
+KMP_NOMATCH = 0 ;
+KMP_ADVANCED = 1 ;
+KMP_MATCHED = 2 ;
+KmpMatch = function( pattern, ignoreCase )
+{
+	var overlap = [ -1 ] ;
+	for ( var i = 0 ; i < pattern.length ; i++ )
+	{
+		overlap.push( overlap[i] + 1 ) ;
+		while ( overlap[ i + 1 ] > 0 && pattern.charAt( i ) != pattern.charAt( overlap[ i + 1 ] - 1 ) )
+			overlap[ i + 1 ] = overlap[ overlap[ i + 1 ] - 1 ] + 1 ;
+	}
+	this._Overlap = overlap ;
+	this._State = 0 ;
+	this._IgnoreCase = ( ignoreCase === true ) ;
+	if ( ignoreCase )
+		this.Pattern = pattern.toLowerCase();
+	else
+		this.Pattern = pattern ;
+}
+KmpMatch.prototype = {
+	FeedCharacter : function( c )
+	{
+		if ( this._IgnoreCase )
+			c = c.toLowerCase();
+
+		while ( true )
+		{
+			if ( c == this.Pattern.charAt( this._State ) )
+			{
+				this._State++ ;
+				if ( this._State == this.Pattern.length )
+				{
+					// found a match, start over, don't care about partial matches involving the current match
+					this._State = 0;
+					return KMP_MATCHED;
+				}
+				return KMP_ADVANCED ;
+			}
+			else if ( this._State == 0 )
+				return KMP_NOMATCH;
+			else
+				this._State = this._Overlap[ this._State ];
+		}
+
+		return null ;
+	},
+
+	Reset : function()
+	{
+		this._State = 0 ;
+	}
+};
 
+// Place a range at the start of document.
 function OnLoad()
 {
-	// First of all, translate the dialog box texts
+	// First of all, translate the dialog box texts.
 	oEditor.FCKLanguageManager.TranslatePage( document ) ;
 
-	window.parent.SetAutoSize( true ) ;
+	// Show the appropriate tab at startup.
+	if ( dialogArguments.CustomValue == 'Find' )
+	{
+		dialog.SetSelectedTab( 'Find' ) ;
+		dialog.SetAutoSize( true ) ;
+	}
+	else
+		dialog.SetSelectedTab( 'Replace' ) ;
 
-	oEditor.FCKUndo.SaveUndoStep() ;
+	SelectField( 'txtFind' + dialogArguments.CustomValue ) ;
 }
 
-function btnStat(frm)
+function btnStat()
 {
-	document.getElementById('btnReplace').disabled =
-		document.getElementById('btnReplaceAll').disabled =
-			( document.getElementById('txtFind').value.length == 0 ) ;
+	GetE('btnReplace').disabled =
+		GetE('btnReplaceAll').disabled =
+			GetE('btnFind').disabled =
+				( GetE(idMap["FindText"]).value.length == 0 ) ;
 }
 
-function ReplaceTextNodes( parentNode, regex, replaceValue, replaceAll, hasFound )
+function btnStatDelayed()
 {
-	for ( var i = 0 ; i < parentNode.childNodes.length ; i++ )
+	setTimeout( btnStat, 1 ) ;
+}
+
+function GetSearchString()
 	{
-		var oNode = parentNode.childNodes[i] ;
-		if ( oNode.nodeType == 3 )
+	return GetE(idMap['FindText']).value ;
+}
+
+function GetReplaceString()
 		{
-			var sReplaced = oNode.nodeValue.replace( regex, replaceValue ) ;
-			if ( oNode.nodeValue != sReplaced )
+	return GetE("txtReplace").value ;
+}
+
+function GetCheckCase()
 			{
-				oNode.nodeValue = sReplaced ;
-				if ( ! replaceAll )
-					return true ;
-				hasFound = true ;
+	return !! ( GetE(idMap['CheckCase']).checked ) ;
 			}
+
+function GetMatchWord()
+{
+	return !! ( GetE(idMap['CheckWord']).checked ) ;
 		}
 
-		hasFound = ReplaceTextNodes( oNode, regex, replaceValue, replaceAll, hasFound ) ;
-		if ( ! replaceAll && hasFound )
+/* Is this character a unicode whitespace or a punctuation mark?
+ * References:
+ * http://unicode.org/Public/UNIDATA/PropList.txt (whitespaces)
+ * http://php.chinaunix.net/manual/tw/ref.regex.php (punctuation marks)
+ */
+function CheckIsWordSeparator( c )
+{
+	if ( !c )
+		return true;
+	var code = c.charCodeAt( 0 );
+	if ( code >= 9 && code <= 0xd )
+		return true;
+	if ( code >= 0x2000 && code <= 0x200a )
+		return true;
+	switch ( code )
+	{
+		case 0x20:
+		case 0x85:
+		case 0xa0:
+		case 0x1680:
+		case 0x180e:
+		case 0x2028:
+		case 0x2029:
+		case 0x202f:
+		case 0x205f:
+		case 0x3000:
 			return true ;
+		default:
+	}
+	return /[.,"'?!;:]/.test( c ) ;
 	}
 
-	return hasFound ;
+FindRange = null ;
+function _Find()
+{
+	var searchString = GetSearchString() ;
+	if ( !FindRange )
+		FindRange = new CharacterRange( new CharacterCursor( EditorDocument ), searchString.length ) ;
+	else
+	{
+		FindRange.RemoveHighlight() ;
+		FindRange = FindRange.GetNextRange( searchString.length ) ;
 }
+	var matcher = new KmpMatch( searchString, ! GetCheckCase() ) ;
+	var matchState = KMP_NOMATCH ;
+	var character = '%' ;
 
-function GetRegexExpr()
+	while ( character != null )
 {
-	var sExpr = EscapeRegexString( document.getElementById('txtFind').value ) ;
+		while ( ( character = FindRange.GetEndCharacter() ) )
+		{
+			matchState = matcher.FeedCharacter( character ) ;
+			if ( matchState == KMP_MATCHED )
+				break ;
+			if ( FindRange.MoveNext() )
+				matcher.Reset() ;
+		}
 
-	if ( document.getElementById('chkWord').checked )
-		sExpr = '\\b' + sExpr + '\\b' ;
+		if ( matchState == KMP_MATCHED )
+		{
+			if ( GetMatchWord() )
+			{
+				var cursors = FindRange.GetCursors() ;
+				var head = cursors[ cursors.length - 1 ].Clone() ;
+				var tail = cursors[0].Clone() ;
+				if ( !head.MoveNext() && !CheckIsWordSeparator( head.GetCharacter() ) )
+					continue ;
+				if ( !tail.MoveBack() && !CheckIsWordSeparator( tail.GetCharacter() ) )
+					continue ;
+			}
 
-	return sExpr ;
+			FindRange.Highlight() ;
+			return true ;
+		}
 }
 
-function GetCase()
-{
-	return ( document.getElementById('chkCase').checked ? '' : 'i' ) ;
+	FindRange = null ;
+	return false ;
 }
 
-function GetReplacement()
+function Find()
 {
-	return document.getElementById('txtReplace').value.replace( /\$/g, '$$$$' ) ;
+	if ( ! _Find() )
+		alert( FCKLang.DlgFindNotFoundMsg ) ;
 }
 
-function EscapeRegexString( str )
+function Replace()
 {
-	return str.replace( /[\\\^\$\*\+\?\{\}\.\(\)\!\|\[\]\-]/g, '\\$&' ) ;
+	var saveUndoStep = function( selectRange )
+	{
+		var ieRange ;
+		if ( oEditor.FCKBrowserInfo.IsIE )
+			ieRange = document.selection.createRange() ;
+
+		selectRange.Select() ;
+		oEditor.FCKUndo.SaveUndoStep() ;
+		var cloneRange = selectRange.Clone() ;
+		cloneRange.Collapse( false ) ;
+		cloneRange.Select() ;
+
+		if ( ieRange )
+			setTimeout( function(){ ieRange.select() ; }, 1 ) ;
 }
 
-function Replace()
+	if ( FindRange && FindRange.GetHighlightDomRange() )
 {
-	var oRegex = new RegExp( GetRegexExpr(), GetCase() ) ;
-	if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), false, false ) )
-		alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
+		var range = FindRange.GetHighlightDomRange() ;
+		var bookmark = range.CreateBookmark() ;
+		FindRange.RemoveHighlight() ;
+		range.MoveToBookmark( bookmark ) ;
+
+		saveUndoStep( range ) ;
+		range.DeleteContents() ;
+		range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
+		range._UpdateElementInfo() ;
+
+		FindRange = CharacterRange.CreateFromDomRange( range ) ;
+	}
+	else
+	{
+		if ( ! _Find() )
+		{
+			FindRange && FindRange.RemoveHighlight() ;
+			alert( FCKLang.DlgFindNotFoundMsg ) ;
+		}
+	}
 }
 
 function ReplaceAll()
 {
-	var oRegex = new RegExp( GetRegexExpr(), GetCase() + 'g' ) ;
-	if ( !ReplaceTextNodes( oEditor.FCK.EditorDocument.body, oRegex, GetReplacement(), true, false ) )
-		alert( oEditor.FCKLang.DlgFindNotFoundMsg ) ;
-	window.parent.Cancel() ;
+	oEditor.FCKUndo.SaveUndoStep() ;
+	var replaceCount = 0 ;
+
+	while ( _Find() )
+	{
+		var range = FindRange.GetHighlightDomRange() ;
+		var bookmark = range.CreateBookmark() ;
+		FindRange.RemoveHighlight() ;
+		range.MoveToBookmark( bookmark) ;
+
+		range.DeleteContents() ;
+		range.InsertNode( EditorDocument.createTextNode( GetReplaceString() ) ) ;
+		range._UpdateElementInfo() ;
+
+		FindRange = CharacterRange.CreateFromDomRange( range ) ;
+		replaceCount++ ;
+	}
+	if ( replaceCount == 0 )
+	{
+		FindRange && FindRange.RemoveHighlight() ;
+		alert( FCKLang.DlgFindNotFoundMsg ) ;
+	}
+	dialog.Cancel() ;
+}
+
+window.onunload = function()
+{
+	if ( FindRange )
+	{
+		FindRange.RemoveHighlight() ;
+		FindRange.ToDomRange().Select() ;
+	}
 }
 	</script>
 </head>
 <body onload="OnLoad()" style="overflow: hidden">
+	<div id="divFind" style="display: none">
 	<table cellspacing="3" cellpadding="2" width="100%" border="0">
 		<tr>
 			<td nowrap="nowrap">
-				<label for="txtFind" fcklang="DlgReplaceFindLbl">
+					<label for="txtFindFind" fcklang="DlgReplaceFindLbl">
 					Find what:</label>
 			</td>
 			<td width="100%">
-				<input id="txtFind" onkeyup="btnStat(this.form)" style="width: 100%" tabindex="1"
+					<input id="txtFindFind" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1"
 					type="text" />
 			</td>
 			<td>
-				<input id="btnReplace" style="width: 100%" disabled="disabled" onclick="Replace();"
+					<input id="btnFind" style="width: 80px" disabled="disabled" onclick="Find();"
+						type="button" value="Find" fcklang="DlgFindFindBtn" />
+				</td>
+			</tr>
+			<tr>
+				<td valign="bottom" colspan="3">
+					&nbsp;<input id="chkCaseFind" tabindex="3" type="checkbox" /><label for="chkCaseFind" fcklang="DlgReplaceCaseChk">Match
+						case</label>
+					<br />
+					&nbsp;<input id="chkWordFind" tabindex="4" type="checkbox" /><label for="chkWordFind" fcklang="DlgReplaceWordChk">Match
+						whole word</label>
+				</td>
+			</tr>
+		</table>
+	</div>
+	<div id="divReplace" style="display:none">
+		<table cellspacing="3" cellpadding="2" width="100%" border="0">
+			<tr>
+				<td nowrap="nowrap">
+					<label for="txtFindReplace" fcklang="DlgReplaceFindLbl">
+						Find what:</label>
+				</td>
+				<td width="100%">
+					<input id="txtFindReplace" onkeyup="btnStat()" oninput="btnStat()" onpaste="btnStatDelayed()" style="width: 100%" tabindex="1"
+						type="text" />
+				</td>
+				<td>
+					<input id="btnReplace" style="width: 80px" disabled="disabled" onclick="Replace();"
 					type="button" value="Replace" fcklang="DlgReplaceReplaceBtn" />
 			</td>
 		</tr>
@@ -138,19 +631,20 @@
 				<input id="txtReplace" style="width: 100%" tabindex="2" type="text" />
 			</td>
 			<td>
-				<input id="btnReplaceAll" disabled="disabled" onclick="ReplaceAll()" type="button"
+					<input id="btnReplaceAll" style="width: 80px" disabled="disabled" onclick="ReplaceAll()" type="button"
 					value="Replace All" fcklang="DlgReplaceReplAllBtn" />
 			</td>
 		</tr>
 		<tr>
 			<td valign="bottom" colspan="3">
-				&nbsp;<input id="chkCase" tabindex="3" type="checkbox" /><label for="chkCase" fcklang="DlgReplaceCaseChk">Match
+					&nbsp;<input id="chkCaseReplace" tabindex="3" type="checkbox" /><label for="chkCaseReplace" fcklang="DlgReplaceCaseChk">Match
 					case</label>
 				<br />
-				&nbsp;<input id="chkWord" tabindex="4" type="checkbox" /><label for="chkWord" fcklang="DlgReplaceWordChk">Match
+					&nbsp;<input id="chkWordReplace" tabindex="4" type="checkbox" /><label for="chkWordReplace" fcklang="DlgReplaceWordChk">Match
 					whole word</label>
 			</td>
 		</tr>
 	</table>
+	</div>
 </body>
 </html>

Index: fck_colorselector.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_colorselector.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_colorselector.html	1 Aug 2007 22:25:14 -0000	1.1
+++ fck_colorselector.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -34,6 +34,7 @@
 			#btnClear		{ width: 75px ; height: 22px ; margin-bottom: 6px ; }
 			.ColorCell		{ height: 15px ; width: 15px ; }
 		</style>
+		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script type="text/javascript">
 
 var oEditor = window.parent.InnerDialogLoaded() ;
@@ -135,8 +136,8 @@
 
 function Ok()
 {
-	if ( typeof(window.parent.dialogArguments.CustomValue) == 'function' )
-		window.parent.dialogArguments.CustomValue( document.getElementById('selcolor').value ) ;
+	if ( typeof(window.parent.Args().CustomValue) == 'function' )
+		window.parent.Args().CustomValue( document.getElementById('selcolor').value ) ;
 
 	return true ;
 }

Index: fck_textfield.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_textfield.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_textfield.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_textfield.html	16 Mar 2010 08:34:50 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,12 +29,13 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+var oActiveEl = dialog.Selection.GetSelectedElement() ;
 
 window.onload = function()
 {
@@ -48,13 +49,13 @@
 		GetE('txtSize').value	= GetAttribute( oActiveEl, 'size' ) ;
 		GetE('txtMax').value	= GetAttribute( oActiveEl, 'maxLength' ) ;
 		GetE('txtType').value	= oActiveEl.type ;
-
-		GetE('txtType').disabled = true ;
 	}
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
@@ -72,14 +73,10 @@
 		return false ;
 	}
 
-	if ( !oActiveEl )
-	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
-		oActiveEl.type = GetE('txtType').value ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-	}
+	oEditor.FCKUndo.SaveUndoStep() ;
+
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: GetE('txtType').value } ) ;
 
-	oActiveEl.name = GetE('txtName').value ;
 	SetAttribute( oActiveEl, 'value'	, GetE('txtValue').value ) ;
 	SetAttribute( oActiveEl, 'size'		, GetE('txtSize').value ) ;
 	SetAttribute( oActiveEl, 'maxlength', GetE('txtMax').value ) ;

Index: fck_spellerpages.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_spellerpages.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_spellerpages.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_spellerpages.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -26,6 +26,7 @@
 		<title>Spell Check</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<meta content="noindex, nofollow" name="robots">
+		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script src="fck_spellerpages/spellerpages/spellChecker.js"></script>
 		<script type="text/javascript">
 
@@ -51,7 +52,12 @@
 function oSpeller_OnFinished( numberOCorrections )
 {
 	if ( numberOCorrections > 0 )
-		oEditor.FCK.SetHTML( document.getElementById('txtHtml').value ) ;
+	{
+		oEditor.FCKUndo.SaveUndoStep() ;
+		oEditor.FCK.EditorDocument.body.innerHTML = document.getElementById('txtHtml').value ;
+		if ( oEditor.FCKBrowserInfo.IsIE )
+			oEditor.FCKSelection.Collapse( true ) ;
+	}
 	window.parent.Cancel() ;
 }
 

Index: fck_checkbox.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_checkbox.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_checkbox.html	1 Aug 2007 22:25:14 -0000	1.1
+++ fck_checkbox.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,12 +29,13 @@
 		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor	= dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+var oActiveEl = dialog.Selection.GetSelectedElement() ;
 
 window.onload = function()
 {
@@ -50,20 +51,16 @@
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
 {
-	if ( !oActiveEl )
-	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'INPUT' ) ;
-		oActiveEl.type = 'checkbox' ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-	}
+	oEditor.FCKUndo.SaveUndoStep() ;
 
-	if ( GetE('txtName').value.length > 0 )
-		oActiveEl.name = GetE('txtName').value ;
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'INPUT', {name: GetE('txtName').value, type: 'checkbox' } ) ;
 
 	if ( oEditor.FCKBrowserInfo.IsIE )
 		oActiveEl.value = GetE('txtValue').value ;

Index: fck_docprops.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_docprops.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_docprops.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_docprops.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -21,11 +21,11 @@
  *
  * Link dialog window.
 -->
-<html xmlns="http://www.w3.org/1999/xhtml">
+<html>
 <head>
 	<title></title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<meta content="noindex, nofollow" name="robots" />
+	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
+	<meta content="noindex, nofollow" name="robots" >
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
@@ -282,7 +282,7 @@
 		if ( sCharSet.length == 0 )
 			sCharSet = 'utf-8' ;
 
-		FCK.XmlDeclaration = '<?xml version="1.0" encoding="' + sCharSet + '"?>' ;
+		FCK.XmlDeclaration = '<' + '?xml version="1.0" encoding="' + sCharSet + '"?>' ;
 
 		SetAttribute( oHTML, 'xmlns', 'http://www.w3.org/1999/xhtml' ) ;
 	}
@@ -374,11 +374,11 @@
 {
 	switch ( wich )
 	{
-		case 'Back'			: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectBackColor, window ) ; return ;
-		case 'ColorText'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorText, window ) ; return ;
-		case 'ColorLink'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorLink, window ) ; return ;
-		case 'ColorVisited'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorVisited, window ) ; return ;
-		case 'ColorActive'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 400, 330, SelectColorActive, window ) ; return ;
+		case 'Back'			: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectBackColor ) ; return ;
+		case 'ColorText'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorText ) ; return ;
+		case 'ColorLink'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorLink ) ; return ;
+		case 'ColorVisited'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorVisited ) ; return ;
+		case 'ColorActive'	: oEditor.FCKDialog.OpenDialog( 'FCKDialog_Color', FCKLang.DlgColorTitle, 'dialog/fck_colorselector.html', 410, 320, SelectColorActive ) ; return ;
 	}
 }
 
@@ -456,24 +456,24 @@
 						<tr>
 							<td nowrap="nowrap">
 								<span fcklang="DlgDocDocType">Document Type Heading</span><br />
-								<select id="selDocType" name="selDocType" onchange="CheckOther( this, 'txtDocType' );">
+								<select id="selDocType" onchange="CheckOther( this, 'txtDocType' );">
 									<option value="" selected="selected"></option>
-									<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'>HTML
+									<option value='&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;'>HTML
 										4.01 Transitional</option>
-									<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">'>
+									<option value='&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;'>
 										HTML 4.01 Strict</option>
-									<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">'>
+									<option value='&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"&gt;'>
 										HTML 4.01 Frameset</option>
-									<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'>
+									<option value='&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;'>
 										XHTML 1.0 Transitional</option>
-									<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'>
+									<option value='&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;'>
 										XHTML 1.0 Strict</option>
-									<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">'>
+									<option value='&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&gt;'>
 										XHTML 1.0 Frameset</option>
-									<option value='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'>
+									<option value='&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;'>
 										XHTML 1.1</option>
-									<option value='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">'>HTML 3.2</option>
-									<option value='<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">'>HTML 2.0</option>
+									<option value='&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"&gt;'>HTML 3.2</option>
+									<option value='&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"&gt;'>HTML 2.0</option>
 									<option value="..." fcklang="DlgOpOther">&lt;Other&gt;</option>
 								</select>
 							</td>

Index: fck_specialchar.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_specialchar.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_specialchar.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_specialchar.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -33,6 +33,7 @@
 				}
 				.Sample { font-size: 24px; }
 		</style>
+		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script type="text/javascript">
 
 var oEditor = window.parent.InnerDialogLoaded() ;
@@ -41,18 +42,23 @@
 
 function insertChar(charValue)
 {
+	oEditor.FCKUndo.SaveUndoStep() ;
 	oEditor.FCK.InsertHtml( charValue || "" ) ;
 	window.parent.Cancel() ;
 }
 
 function over(td)
 {
+	if ( ! oSample )
+		return ;
 	oSample.innerHTML = td.innerHTML ;
 	td.className = 'LightBackground SpecialCharsOver Hand' ;
 }
 
 function out(td)
 {
+	if ( ! oSample )
+		return ;
 	oSample.innerHTML = "&nbsp;" ;
 	td.className = 'DarkBackground SpecialCharsOut Hand' ;
 }
@@ -64,17 +70,19 @@
 
 	// First of all, translates the dialog box texts.
 	oEditor.FCKLanguageManager.TranslatePage(document) ;
+
+	window.parent.SetAutoSize( true ) ;
 }
 
 		</script>
-	</HEAD>
-	<BODY onload="setDefaults()" scroll="no">
+	</head>
+	<body onload="setDefaults()" style="overflow: hidden">
 		<table cellpadding="0" cellspacing="0" width="100%" height="100%">
 			<tr>
 				<td width="100%">
 					<table cellpadding="1" cellspacing="1" align="center" border="0" width="100%" height="100%">
 						<script type="text/javascript">
-var aChars = ["!","&quot;","#","$","%","&amp;","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otild
 e;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;","&OElig;","&oelig;","&sbquo;","&#8219;","&bdquo;","&hellip;","&trade;","&#9658;","&bull;","&rarr;","&rArr;","&hArr;","&diams;","&asymp;"] ;
+var aChars = ["!","&quot;","#","$","%","&amp;","\\'","(",")","*","+","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","&lt;","=","&gt;","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","&euro;","&lsquo;","&rsquo;","&rsquo;","&ldquo;","&rdquo;","&ndash;","&mdash;","&iexcl;","&cent;","&pound;","&curren;","&yen;","&brvbar;","&sect;","&uml;","&copy;","&ordf;","&laquo;","&not;","&reg;","&macr;","&deg;","&plusmn;","&sup2;","&sup3;","&acute;","&micro;","&para;","&middot;","&cedil;","&sup1;","&ordm;","&raquo;","&frac14;","&frac12;","&frac34;","&iquest;","&Agrave;","&Aacute;","&Acirc;","&Atilde;","&Auml;","&Aring;","&AElig;","&Ccedil;","&Egrave;","&Eacute;","&Ecirc;","&Euml;","&Igrave;","&Iacute;","&Icirc;","&Iuml;","&ETH;","&Ntilde;","&Ograve;","&Oacute;","&Ocirc;","&Otild
 e;","&Ouml;","&times;","&Oslash;","&Ugrave;","&Uacute;","&Ucirc;","&Uuml;","&Yacute;","&THORN;","&szlig;","&agrave;","&aacute;","&acirc;","&atilde;","&auml;","&aring;","&aelig;","&ccedil;","&egrave;","&eacute;","&ecirc;","&euml;","&igrave;","&iacute;","&icirc;","&iuml;","&eth;","&ntilde;","&ograve;","&oacute;","&ocirc;","&otilde;","&ouml;","&divide;","&oslash;","&ugrave;","&uacute;","&ucirc;","&uuml;","&uuml;","&yacute;","&thorn;","&yuml;","&OElig;","&oelig;","&#372;","&#374","&#373","&#375;","&sbquo;","&#8219;","&bdquo;","&hellip;","&trade;","&#9658;","&bull;","&rarr;","&rArr;","&hArr;","&diams;","&asymp;"] ;
 
 var cols = 20 ;
 
@@ -109,5 +117,5 @@
 				</td>
 			</tr>
 		</table>
-	</BODY>
-</HTML>
\ No newline at end of file
+	</body>
+</html>

Index: fck_form.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_form.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_form.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_form.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,12 +29,13 @@
 	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.MoveToAncestorNode( 'FORM' ) ;
+var oActiveEl = dialog.Selection.GetSelection().MoveToAncestorNode( 'FORM' ) ;
 
 window.onload = function()
 {
@@ -50,16 +51,19 @@
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
 {
 	if ( !oActiveEl )
 	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'FORM' ) ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-		oActiveEl.innerHTML = '&nbsp;' ;
+		oActiveEl = oEditor.FCK.InsertElement( 'form' ) ;
+
+		if ( oEditor.FCKBrowserInfo.IsGeckoLike )
+			oEditor.FCKTools.AppendBogusBr( oActiveEl ) ;
 	}
 
 	oActiveEl.name = GetE('txtName').value ;

Index: fck_select.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_select.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_select.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_select.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -30,12 +30,13 @@
 		<script type="text/javascript" src="fck_select/fck_select.js"></script>
 		<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+var oActiveEl = dialog.Selection.GetSelectedElement() ;
 
 var oListText ;
 var oListValue ;
@@ -48,6 +49,10 @@
 	oListText	= document.getElementById( 'cmbText' ) ;
 	oListValue	= document.getElementById( 'cmbValue' ) ;
 
+	// Fix the lists widths. (Bug #970)
+	oListText.style.width = oListText.offsetWidth ;
+	oListValue.style.width = oListValue.offsetWidth ;
+
 	if ( oActiveEl && oActiveEl.tagName == 'SELECT' )
 	{
 		GetE('txtName').value		= oActiveEl.name ;
@@ -68,22 +73,21 @@
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
 {
+	oEditor.FCKUndo.SaveUndoStep() ;
+
 	var sSize = GetE('txtLines').value ;
 	if ( sSize == null || isNaN( sSize ) || sSize <= 1 )
 		sSize = '' ;
 
-	if ( !oActiveEl )
-	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'SELECT' ) ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-	}
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'SELECT', {name: GetE('txtName').value} ) ;
 
-	SetAttribute( oActiveEl, 'name'	, GetE('txtName').value ) ;
 	SetAttribute( oActiveEl, 'size'	, sSize ) ;
 	oActiveEl.multiple = ( sSize.length > 0 && GetE('chkMultiple').checked ) ;
 
@@ -112,7 +116,7 @@
 
 		</script>
 	</head>
-	<body style='OVERFLOW: hidden' scroll='no'>
+	<body style="overflow: hidden">
 		<table width="100%" height="100%">
 			<tr>
 				<td>
@@ -128,7 +132,7 @@
 						<tr>
 							<td nowrap><span fckLang="DlgSelectSize">Size</span>&nbsp;</td>
 							<td nowrap><input id="txtLines" type="text" size="2" value="">&nbsp;<span fckLang="DlgSelectLines">lines</span></td>
-							<td nowrap align="right"><input id="chkMultiple" name="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
+							<td nowrap align="right"><input id="chkMultiple" type="checkbox"><label for="chkMultiple" fckLang="DlgSelectChkMulti">Allow
 									multiple selections</label></td>
 						</tr>
 					</table>
@@ -139,20 +143,20 @@
 					<table width="100%">
 						<tr>
 							<td width="50%"><span fckLang="DlgSelectOpText">Text</span><br>
-								<input id="txtText" style="WIDTH: 100%" type="text" name="txtText">
+								<input id="txtText" style="WIDTH: 100%" type="text">
 							</td>
 							<td width="50%"><span fckLang="DlgSelectOpValue">Value</span><br>
-								<input id="txtValue" style="WIDTH: 100%" type="text" name="txtValue">
+								<input id="txtValue" style="WIDTH: 100%" type="text">
 							</td>
 							<td vAlign="bottom"><input onclick="Add();" type="button" fckLang="DlgSelectBtnAdd" value="Add"></td>
 							<td vAlign="bottom"><input onclick="Modify();" type="button" fckLang="DlgSelectBtnModify" value="Modify"></td>
 						</tr>
 						<tr>
 							<td rowSpan="2"><select id="cmbText" style="WIDTH: 100%" onchange="GetE('cmbValue').selectedIndex = this.selectedIndex;Select(this);"
-									size="5" name="cmbText"></select>
+									size="5"></select>
 							</td>
 							<td rowSpan="2"><select id="cmbValue" style="WIDTH: 100%" onchange="GetE('cmbText').selectedIndex = this.selectedIndex;Select(this);"
-									size="5" name="cmbValue"></select>
+									size="5"></select>
 							</td>
 							<td vAlign="top" colSpan="2">
 							</td>

Index: fck_textarea.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_textarea.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_textarea.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_textarea.html	16 Mar 2010 08:34:50 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,12 +29,13 @@
 		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script type="text/javascript">
 
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog	= window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 
 // Gets the document DOM
 var oDOM = oEditor.FCK.EditorDocument ;
 
-var oActiveEl = oEditor.FCKSelection.GetSelectedElement() ;
+var oActiveEl = dialog.Selection.GetSelectedElement() ;
 
 window.onload = function()
 {
@@ -50,18 +51,17 @@
 	else
 		oActiveEl = null ;
 
-	window.parent.SetOkButton( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
 {
-	if ( !oActiveEl )
-	{
-		oActiveEl = oEditor.FCK.EditorDocument.createElement( 'TEXTAREA' ) ;
-		oActiveEl = oEditor.FCK.InsertElementAndGetIt( oActiveEl ) ;
-	}
+	oEditor.FCKUndo.SaveUndoStep() ;
+
+	oActiveEl = CreateNamedElement( oEditor, oActiveEl, 'TEXTAREA', {name: GetE('txtName').value} ) ;
 
-	oActiveEl.name = GetE('txtName').value ;
 	SetAttribute( oActiveEl, 'cols', GetE('txtCols').value ) ;
 	SetAttribute( oActiveEl, 'rows', GetE('txtRows').value ) ;
 
@@ -70,7 +70,7 @@
 
 		</script>
 	</head>
-	<body style='OVERFLOW: hidden' scroll='no'>
+	<body style="overflow: hidden">
 		<table height="100%" width="100%">
 			<tr>
 				<td align="center">

Index: fck_flash.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_flash.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_flash.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_flash.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -28,7 +28,11 @@
 		<meta content="noindex, nofollow" name="robots">
 		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script src="fck_flash/fck_flash.js" type="text/javascript"></script>
-		<link href="common/fck_dialog_common.css" type="text/css" rel="stylesheet">
+		<script type="text/javascript">
+
+document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
+
+		</script>
 	</head>
 	<body scroll="no" style="OVERFLOW: hidden">
 		<div id="divInfo">
@@ -55,12 +59,12 @@
 							<TR>
 								<TD nowrap>
 									<span fckLang="DlgImgWidth">Width</span><br>
-									<input id="txtWidth" class="FCK__FieldNumeric" type="text" size="3">
+									<input id="txtWidth" onkeypress="return IsDigit(event);" type="text" size="3">
 								</TD>
 								<TD>&nbsp;</TD>
 								<TD>
 									<span fckLang="DlgImgHeight">Height</span><br>
-									<input id="txtHeight" class="FCK__FieldNumeric" type="text" size="3">
+									<input id="txtHeight" onkeypress="return IsDigit(event);" type="text" size="3">
 								</TD>
 							</TR>
 						</table>
@@ -92,7 +96,9 @@
 				<input id="txtUploadFile" style="WIDTH: 100%" type="file" size="40" name="NewFile" /><br />
 				<br />
 				<input id="btnUpload" type="submit" value="Send it to the Server" fckLang="DlgLnkBtnUpload" />
-				<iframe name="UploadWindow" style="DISPLAY: none" src="javascript:void(0)"></iframe>
+				<script type="text/javascript">
+					document.write( '<iframe name="UploadWindow" style="DISPLAY: none" src="' + FCKTools.GetVoidUrl() + '"><\/iframe>' ) ;
+				</script>
 			</form>
 		</div>
 		<div id="divAdvanced" style="DISPLAY: none">

Index: fck_source.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_source.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_source.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_source.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -26,12 +26,15 @@
 		<title>Source</title>
 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 		<meta name="robots" content="noindex, nofollow">
-		<link href="common/fck_dialog_common.css" rel="stylesheet" type="text/css" />
+		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script language="javascript">
 
 var oEditor		= window.parent.InnerDialogLoaded() ;
 var FCK			= oEditor.FCK ;
 var FCKConfig	= oEditor.FCKConfig ;
+var FCKTools	= oEditor.FCKTools ;
+
+document.write( FCKTools.GetStyleHtml( GetCommonDialogCss() ) ) ;
 
 window.onload = function()
 {
@@ -49,7 +52,7 @@
 	if ( oEditor.FCKBrowserInfo.IsIE )
 		oEditor.FCKUndo.SaveUndoStep() ;
 
-	FCK.SetHTML( document.getElementById('txtSource').value, false ) ;
+	FCK.SetData( document.getElementById('txtSource').value, false ) ;
 
 	return true ;
 }

Index: fck_paste.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_paste.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_paste.html	1 Aug 2007 22:25:15 -0000	1.1
+++ fck_paste.html	16 Mar 2010 08:34:48 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -28,50 +28,83 @@
 	<title></title>
 	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 	<meta name="robots" content="noindex, nofollow" />
-
+	<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 	<script type="text/javascript">
-var oEditor = window.parent.InnerDialogLoaded() ;
+var dialog = window.parent ;
+var oEditor = dialog.InnerDialogLoaded() ;
 var FCK = oEditor.FCK;
 var FCKTools	= oEditor.FCKTools ;
 var FCKConfig	= oEditor.FCKConfig ;
+var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
 
 window.onload = function ()
 {
 	// First of all, translate the dialog box texts
 	oEditor.FCKLanguageManager.TranslatePage(document) ;
 	
-	var sPastingType = window.parent.dialogArguments.CustomValue ;
+	var sPastingType = dialog.Args().CustomValue ;
 
 	if ( sPastingType == 'Word' || sPastingType == 'Security' )
 	{
 		if ( sPastingType == 'Security' )
 			document.getElementById( 'xSecurityMsg' ).style.display = '' ;
 
-		var oFrame = document.getElementById('frmData') ;
-		oFrame.style.display = '' ;
+		// For document.domain compatibility (#123) we must do all the magic in
+		// the URL for IE.
+		var sFrameUrl = !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE ?
+			'javascript:void(0)' :
+			'javascript:void( (function(){' +
+				'document.open() ;' +
+				'document.domain=\'' + document.domain + '\' ;' +
+				'document.write(\'<html><head><scr' + 'ipt>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>\') ;' +
+				'document.close() ;' +
+				'document.body.contentEditable = true ;' +
+				'window.focus() ;' +
+				'})() )' ;
 
-		if ( oFrame.contentDocument )
-			oFrame.contentDocument.designMode = 'on' ;
+		var eFrameSpace = document.getElementById( 'xFrameSpace' ) ;
+		eFrameSpace.innerHTML = '<iframe id="frmData" src="' + sFrameUrl + '" ' +
+					'height="98%" width="99%" frameborder="0" style="border: #000000 1px; background-color: #ffffff"><\/iframe>' ;
+
+		var oFrame = eFrameSpace.firstChild ;
+
+		if ( !oEditor.FCK_IS_CUSTOM_DOMAIN || !FCKBrowserInfo.IsIE )
+		{
+			// Avoid errors if the pasted content has any script that fails: #389
+			var oDoc = oFrame.contentWindow.document ;
+			oDoc.open() ;
+			oDoc.write('<html><head><scr' + 'ipt>window.onerror = function() { return true ; };<\/script><\/head><body><\/body><\/html>') ;
+			oDoc.close() ;
+
+			if ( FCKBrowserInfo.IsIE )
+				oDoc.body.contentEditable = true ;
 		else
-			oFrame.contentWindow.document.body.contentEditable = true ;
+				oDoc.designMode = 'on' ;
+
+			oFrame.contentWindow.focus();
+		}
 	}
 	else
 	{
 		document.getElementById('txtData').style.display = '' ;
+		SelectField( 'txtData' ) ;
 	}
 
 	if ( sPastingType != 'Word' )
 		document.getElementById('oWordCommands').style.display = 'none' ;
 
-	window.parent.SetOkButton( true ) ;
-	window.parent.SetAutoSize( true ) ;
+	dialog.SetOkButton( true ) ;
+	dialog.SetAutoSize( true ) ;
 }
 
 function Ok()
 {
+	// Before doing anything, save undo snapshot.
+	oEditor.FCKUndo.SaveUndoStep() ;
+
 	var sHtml ;
 
-	var sPastingType = window.parent.dialogArguments.CustomValue ;
+	var sPastingType = dialog.Args().CustomValue ;
 
 	if ( sPastingType == 'Word' || sPastingType == 'Security' )
 	{
@@ -101,24 +134,50 @@
 	else
 	{
 		sHtml = oEditor.FCKTools.HTMLEncode( document.getElementById('txtData').value )  ;
-		sHtml = sHtml.replace( /\n/g, '<BR>' ) ;
-	}
+		sHtml = FCKTools.ProcessLineBreaks( oEditor, FCKConfig, sHtml ) ;
 
-	oEditor.FCK.InsertHtml( sHtml ) ;
+		// FCK.InsertHtml() does not work for us, since document fragments cannot contain node fragments. :(
+		// Use the marker method instead. It's primitive, but it works.
+		var range = new oEditor.FCKDomRange( oEditor.FCK.EditorWindow ) ;
+		var oDoc = oEditor.FCK.EditorDocument ;
+		dialog.Selection.EnsureSelection() ;
+		range.MoveToSelection() ;
+		range.DeleteContents() ;
+		var marker = [] ;
+		for ( var i = 0 ; i < 5 ; i++ )
+			marker.push( parseInt(Math.random() * 100000, 10 ) ) ;
+		marker = marker.join( "" ) ;
+		range.InsertNode ( oDoc.createTextNode( marker ) ) ;
+		var bookmark = range.CreateBookmark() ;
 
-	return true ;
-}
+		// Now we've got a marker indicating the paste position in the editor document.
+		// Find its position in the HTML code.
+		var htmlString = oDoc.body.innerHTML ;
+		var index = htmlString.indexOf( marker ) ;
 
-function CleanUpBox()
-{
-	var oFrame = document.getElementById('frmData') ;
+		// Split it the HTML code up, add the code we generated, and put them back together.
+		var htmlList = [] ;
+		htmlList.push( htmlString.substr( 0, index ) ) ;
+		htmlList.push( sHtml ) ;
+		htmlList.push( htmlString.substr( index + marker.length ) ) ;
+		htmlString = htmlList.join( "" ) ;
 
-	if ( oFrame.contentDocument )
-		oFrame.contentDocument.body.innerHTML = '' ;
+		if ( oEditor.FCKBrowserInfo.IsIE )
+			oEditor.FCK.SetInnerHtml( htmlString ) ;
 	else
-		oFrame.contentWindow.document.body.innerHTML = '' ;
+			oDoc.body.innerHTML = htmlString ;
+
+		range.MoveToBookmark( bookmark ) ;
+		range.Collapse( false ) ;
+		range.Select() ;
+		range.Release() ;
+		return true ;
 }
 
+	oEditor.FCK.InsertHtml( sHtml ) ;
+
+	return true ;
+}
 
 // This function will be called from the PasteFromWord dialog (fck_paste.html)
 // Input: oNode a DOM node that contains the raw paste from the clipboard
@@ -129,17 +188,17 @@
 	var html = oNode.innerHTML ;
 
 	html = html.replace(/<o:p>\s*<\/o:p>/g, '') ;
-	html = html.replace(/<o:p>.*?<\/o:p>/g, '&nbsp;') ;
+	html = html.replace(/<o:p>[\s\S]*?<\/o:p>/g, '&nbsp;') ;
 
 	// Remove mso-xxx styles.
 	html = html.replace( /\s*mso-[^:]+:[^;"]+;?/gi, '' ) ;
 
 	// Remove margin styles.
-	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*;/gi, '' ) ;
-	html = html.replace( /\s*MARGIN: 0cm 0cm 0pt\s*"/gi, "\"" ) ;
+	html = html.replace( /\s*MARGIN: 0(?:cm|in) 0(?:cm|in) 0pt\s*;/gi, '' ) ;
+	html = html.replace( /\s*MARGIN: 0(?:cm|in) 0(?:cm|in) 0pt\s*"/gi, "\"" ) ;
 
-	html = html.replace( /\s*TEXT-INDENT: 0cm\s*;/gi, '' ) ;
-	html = html.replace( /\s*TEXT-INDENT: 0cm\s*"/gi, "\"" ) ;
+	html = html.replace( /\s*TEXT-INDENT: 0(?:cm|in)\s*;/gi, '' ) ;
+	html = html.replace( /\s*TEXT-INDENT: 0(?:cm|in)\s*"/gi, "\"" ) ;
 
 	html = html.replace( /\s*TEXT-ALIGN: [^\s;]+;?"/gi, "\"" ) ;
 
@@ -166,6 +225,10 @@
 	if ( bRemoveStyles )
 		html = html.replace( /<(\w[^>]*) style="([^\"]*)"([^>]*)/gi, "<$1$3" ) ;
 
+	// Remove style, meta and link tags
+	html = html.replace( /<STYLE[^>]*>[\s\S]*?<\/STYLE[^>]*>/gi, '' ) ;
+	html = html.replace( /<(?:META|LINK)[^>]*>\s*/gi, '' ) ;
+
 	// Remove empty styles.
 	html =  html.replace( /\s*style="\s*"/gi, '' ) ;
 
@@ -176,25 +239,35 @@
 	// Remove Lang attributes
 	html = html.replace(/<(\w[^>]*) lang=([^ |>]*)([^>]*)/gi, "<$1$3") ;
 
-	html = html.replace( /<SPAN\s*>(.*?)<\/SPAN>/gi, '$1' ) ;
+	html = html.replace( /<SPAN\s*>([\s\S]*?)<\/SPAN>/gi, '$1' ) ;
 
-	html = html.replace( /<FONT\s*>(.*?)<\/FONT>/gi, '$1' ) ;
+	html = html.replace( /<FONT\s*>([\s\S]*?)<\/FONT>/gi, '$1' ) ;
 
 	// Remove XML elements and declarations
 	html = html.replace(/<\\?\?xml[^>]*>/gi, '' ) ;
 
+	// Remove w: tags with contents.
+	html = html.replace( /<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi, '' ) ;
+
 	// Remove Tags with XML namespace declarations: <o:p><\/o:p>
 	html = html.replace(/<\/?\w+:[^>]*>/gi, '' ) ;
 
 	// Remove comments [SF BUG-1481861].
-	html = html.replace(/<\!--.*-->/g, '' ) ;
+	html = html.replace(/<\!--[\s\S]*?-->/g, '' ) ;
 
 	html = html.replace( /<(U|I|STRIKE)>&nbsp;<\/\1>/g, '&nbsp;' ) ;
 
 	html = html.replace( /<H\d>\s*<\/H\d>/gi, '' ) ;
 
 	// Remove "display:none" tags.
-	html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none(.*?)<\/\1>/ig, '' ) ;
+	html = html.replace( /<(\w+)[^>]*\sstyle="[^"]*DISPLAY\s?:\s?none[\s\S]*?<\/\1>/ig, '' ) ;
+
+	// Remove language tags
+	html = html.replace( /<(\w[^>]*) language=([^ |>]*)([^>]*)/gi, "<$1$3") ;
+
+	// Remove onmouseover and onmouseout events (from MS Word comments effect)
+	html = html.replace( /<(\w[^>]*) onmouseover="([^\"]*)"([^>]*)/gi, "<$1$3") ;
+	html = html.replace( /<(\w[^>]*) onmouseout="([^\"]*)"([^>]*)/gi, "<$1$3") ;
 
 	if ( FCKConfig.CleanWordKeepsStructure )
 	{
@@ -202,8 +275,8 @@
 		html = html.replace( /<H(\d)([^>]*)>/gi, '<h$1>' ) ;
 
 		// Word likes to insert extra <font> tags, when using MSIE. (Wierd).
-		html = html.replace( /<(H\d)><FONT[^>]*>(.*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
-		html = html.replace( /<(H\d)><EM>(.*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
+		html = html.replace( /<(H\d)><FONT[^>]*>([\s\S]*?)<\/FONT><\/\1>/gi, '<$1>$2<\/$1>' );
+		html = html.replace( /<(H\d)><EM>([\s\S]*?)<\/EM><\/\1>/gi, '<$1>$2<\/$1>' );
 	}
 	else
 	{
@@ -217,7 +290,7 @@
 		html = html.replace( /<\/H\d>/gi, '<\/font><\/b><\/div>' ) ;
 
 		// Transform <P> to <DIV>
-		var re = new RegExp( '(<P)([^>]*>.*?)(<\/P>)', 'gi' ) ;	// Different because of a IE 5.0 error
+		var re = new RegExp( '(<P)([^>]*>[\\s\\S]*?)(<\/P>)', 'gi' ) ;	// Different because of a IE 5.0 error
 		html = html.replace( re, '<div$2<\/div>' ) ;
 
 		// Remove empty tags (three times, just to be sure).
@@ -251,20 +324,14 @@
 			</td>
 		</tr>
 		<tr>
-			<td valign="top" height="100%" style="border-right: #000000 1px solid; border-top: #000000 1px solid;
-				border-left: #000000 1px solid; border-bottom: #000000 1px solid">
+			<td id="xFrameSpace" valign="top" height="100%" style="border: #000000 1px solid">
 				<textarea id="txtData" cols="80" rows="5" style="border: #000000 1px; display: none;
 					width: 99%; height: 98%"></textarea>
-				<iframe id="frmData" src="javascript:void(0)" height="98%" width="99%" frameborder="0"
-					style="border-right: #000000 1px; border-top: #000000 1px; display: none; border-left: #000000 1px;
-					border-bottom: #000000 1px; background-color: #ffffff"></iframe>
 			</td>
 		</tr>
 		<tr id="oWordCommands">
 			<td>
-				<table border="0" cellpadding="0" cellspacing="0" width="100%">
-					<tr>
-						<td nowrap="nowrap">
+
 							<input id="chkRemoveFont" type="checkbox" checked="checked" />
 							<label for="chkRemoveFont" fcklang="DlgPasteIgnoreFont">
 								Ignore Font Face definitions</label>
@@ -272,12 +339,7 @@
 							<input id="chkRemoveStyles" type="checkbox" />
 							<label for="chkRemoveStyles" fcklang="DlgPasteRemoveStyles">
 								Remove Styles definitions</label>
-						</td>
-						<td align="right" valign="top">
-							<input type="button" fcklang="DlgPasteCleanBox" value="Clean Up Box" onclick="CleanUpBox()" />
-						</td>
-					</tr>
-				</table>
+
 			</td>
 		</tr>
 	</table>

Index: fck_anchor.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/fckeditor/editor/dialog/fck_anchor.html,v
retrieving revision 1.1
retrieving revision 1.1.6.1
diff -u -w -d -r1.1 -r1.1.6.1
--- fck_anchor.html	1 Aug 2007 22:25:13 -0000	1.1
+++ fck_anchor.html	16 Mar 2010 08:34:47 -0000	1.1.6.1
@@ -1,7 +1,7 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
 <!--
  * FCKeditor - The text editor for Internet - http://www.fckeditor.net
- * Copyright (C) 2003-2007 Frederico Caldeira Knabben
+ * Copyright (C) 2003-2010 Frederico Caldeira Knabben
  *
  * == BEGIN LICENSE ==
  *
@@ -29,16 +29,18 @@
 		<script src="common/fck_dialog_common.js" type="text/javascript"></script>
 		<script type="text/javascript">
 
-var oEditor	= window.parent.InnerDialogLoaded() ;
+var dialog			= window.parent ;
+var oEditor			= dialog.InnerDialogLoaded() ;
+
 var FCK		= oEditor.FCK ;
 var FCKBrowserInfo = oEditor.FCKBrowserInfo ;
 var FCKTools = oEditor.FCKTools ;
 var FCKRegexLib = oEditor.FCKRegexLib ;
 
-// Gets the document DOM
-var oDOM = oEditor.FCK.EditorDocument ;
+var oDOM			= FCK.EditorDocument ;
+
+var oFakeImage = dialog.Selection.GetSelectedElement() ;
 
-var oFakeImage = FCK.Selection.GetSelectedElement() ;
 var oAnchor ;
 
 if ( oFakeImage )
@@ -68,6 +70,9 @@
 		oAnchor = null ;
 
 	window.parent.SetOkButton( true ) ;
+	window.parent.SetAutoSize( true ) ;
+
+	SelectField( 'txtName' ) ;
 }
 
 function Ok()
@@ -83,7 +88,8 @@
 		// Remove the anchor if the user leaves the name blank
 		if ( oAnchor )
 		{
-			RemoveAnchor() ;
+			// Removes the current anchor from the document using the new command
+			FCK.Commands.GetCommand( 'AnchorDelete' ).Execute() ;
 			return true ;
 		}
 
@@ -113,10 +119,7 @@
 	var aNewAnchors = oEditor.FCK.CreateLink( '#' ) ;
 
 	if ( aNewAnchors.length == 0 )
-	{
-		// Nothing was selected, so now just create a normal A
-		aNewAnchors.push( oEditor.FCK.CreateElement( 'a' ) ) ;
-	}
+			aNewAnchors.push( oEditor.FCK.InsertElement( 'a' ) ) ;
 	else
 	{
 		// Remove the fake href
@@ -130,6 +133,17 @@
 		oAnchor = aNewAnchors[i] ;
 
 		// Set the name
+		if ( FCKBrowserInfo.IsIE )
+		{
+			// Setting anchor names directly in IE will trash the HTML code stored
+			// in FCKTempBin after undos. See #2263.
+			var replaceAnchor = oEditor.FCK.EditorDocument.createElement( '<a name="' +
+					FCKTools.HTMLEncode( sNewName ).replace( '"', '&quot;' ) + '">' ) ;
+			oEditor.FCKDomTools.MoveChildren( oAnchor, replaceAnchor ) ;
+			oAnchor.parentNode.replaceChild( replaceAnchor, oAnchor ) ;
+			oAnchor = replaceAnchor ;
+		}
+		else
 		oAnchor.name = sNewName ;
 
 		// IE does require special processing to show the Anchor's image
@@ -157,36 +171,6 @@
 	return true ;
 }
 
-// Removes the current anchor from the document
-function RemoveAnchor()
-{
-	// If it's also a link, then just remove the name and exit
-	if ( oAnchor.href.length != 0 )
-	{
-		oAnchor.removeAttribute( 'name' ) ;
-		// Remove temporary class for IE
-		if ( FCKBrowserInfo.IsIE )
-			oAnchor.className = oAnchor.className.replace( FCKRegexLib.FCK_Class, '' ) ;
-		return ;
-	}
-
-	// We need to remove the anchor
-	// If we got a fake image, then just remove it and we're done
-	if ( oFakeImage )
-	{
-		oFakeImage.parentNode.removeChild( oFakeImage ) ;
-		return ;
-	}
-	// Empty anchor, so just remove it
-	if ( oAnchor.innerHTML.length == 0 )
-	{
-		oAnchor.parentNode.removeChild( oAnchor ) ;
-		return ;
-	}
-	// Anchor with content, leave the content
-	FCKTools.RemoveOuterTags( oAnchor ) ;
-}
-
 // Checks all the links in the current page pointing to the current name and changes them to the new name
 function ReadjustLinksToAnchor( sCurrent, sNew )
 {
@@ -217,7 +201,7 @@
 
 		</script>
 	</head>
-	<body style="OVERFLOW: hidden" scroll="no">
+	<body style="overflow: hidden">
 		<table height="100%" width="100%">
 			<tr>
 				<td align="center">



More information about the freeside-commits mailing list