[geeklog-cvs] Geeklog-1.x/public_html/fckeditor/editor/_source/classes fckcontextmenu.js, 1.4, 1.5 fckdocumentfragment_gecko.js, 1.2, 1.3 fckdomrange.js, 1.2, 1.3 fckdomrangeiterator.js, 1.2, 1.3 fckeditingarea.js, 1.5, 1.6 fckenterkey.js, 1.2, 1.3 fckiecleanup.js, 1.4, 1.5 fckpanel.js, 1.5, 1.6 fckstyle.js, 1.2, 1.3 fckxml_gecko.js, 1.6, 1.7 fckxml_ie.js, 1.6, 1.7

Blaine Lang blaine at qs1489.pair.com
Sun Aug 10 12:46:28 EDT 2008


Update of /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes
In directory qs1489.pair.com:/tmp/cvs-serv4567/editor/_source/classes

Modified Files:
	fckcontextmenu.js fckdocumentfragment_gecko.js fckdomrange.js 
	fckdomrangeiterator.js fckeditingarea.js fckenterkey.js 
	fckiecleanup.js fckpanel.js fckstyle.js fckxml_gecko.js 
	fckxml_ie.js 
Log Message:
Upgrade to FCKeditor ver 2.6.3

Index: fckxml_gecko.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckxml_gecko.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** fckxml_gecko.js	5 May 2008 00:35:23 -0000	1.6
--- fckxml_gecko.js	10 Aug 2008 16:46:25 -0000	1.7
***************
*** 33,40 ****
  		oXmlHttp.send( null ) ;
  
! 		if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
! 			oXml = oXmlHttp.responseXML ;
! 		else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
  			oXml = oXmlHttp.responseXML ;
  		else
  			oXml = null ;
--- 33,44 ----
  		oXmlHttp.send( null ) ;
  
! 		if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
! 		{
  			oXml = oXmlHttp.responseXML ;
+ 			// #1426: Fallback if responseXML isn't set for some
+ 			// reason (e.g. improperly configured web server)
+ 			if ( !oXml )
+ 				oXml = (new DOMParser()).parseFromString( oXmlHttp.responseText, 'text/xml' ) ;
+ 		}
  		else
  			oXml = null ;

Index: fckxml_ie.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckxml_ie.js,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** fckxml_ie.js	5 May 2008 00:35:23 -0000	1.6
--- fckxml_ie.js	10 Aug 2008 16:46:25 -0000	1.7
***************
*** 41,52 ****
  		oXmlHttp.send( null ) ;
  
! 		if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 )
! 			this.DOMDocument = oXmlHttp.responseXML ;
! 		else if ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 )
  		{
! 			this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
! 			this.DOMDocument.async = false ;
! 			this.DOMDocument.resolveExternals = false ;
! 			this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
  		}
  		else
--- 41,57 ----
  		oXmlHttp.send( null ) ;
  
! 		if ( oXmlHttp.status == 200 || oXmlHttp.status == 304 || ( oXmlHttp.status == 0 && oXmlHttp.readyState == 4 ) )
  		{
! 			this.DOMDocument = oXmlHttp.responseXML ;
! 
! 			// #1426: Fallback if responseXML isn't set for some
! 			// reason (e.g. improperly configured web server)
! 			if ( !this.DOMDocument || this.DOMDocument.firstChild == null )
! 			{
! 				this.DOMDocument = FCKTools.CreateXmlObject( 'DOMDocument' ) ;
! 				this.DOMDocument.async = false ;
! 				this.DOMDocument.resolveExternals = false ;
! 				this.DOMDocument.loadXML( oXmlHttp.responseText ) ;
! 			}
  		}
  		else

Index: fckcontextmenu.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckcontextmenu.js,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** fckcontextmenu.js	5 May 2008 00:35:23 -0000	1.4
--- fckcontextmenu.js	10 Aug 2008 16:46:25 -0000	1.5
***************
*** 90,93 ****
--- 90,96 ----
  function FCKContextMenu_Document_OnContextMenu( e )
  {
+ 	if ( FCKConfig.BrowserContextMenu )
+ 		return true ;
+ 
  	var el = e.target ;
  
***************
*** 115,118 ****
--- 118,124 ----
  		return false ;
  
+ 	if ( FCKConfig.BrowserContextMenu )
+ 		return true ;
+ 
  	var el = e.target ;
  
***************
*** 146,149 ****
--- 152,158 ----
  function FCKContextMenu_Document_OnMouseUp( e )
  {
+ 	if ( FCKConfig.BrowserContextMenu )
+ 		return true ;
+ 
  	var overrideButton = FCKContextMenu_OverrideButton ;
  
***************
*** 165,169 ****
  function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
  {
! 	if ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) )
  		return true ;
  
--- 174,178 ----
  function FCKContextMenu_AttachedElement_OnContextMenu( ev, fckContextMenu, el )
  {
! 	if ( ( fckContextMenu.CtrlDisable && ( ev.ctrlKey || ev.metaKey ) ) || FCKConfig.BrowserContextMenu )
  		return true ;
  

Index: fckiecleanup.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckiecleanup.js,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** fckiecleanup.js	5 May 2008 00:35:23 -0000	1.4
--- fckiecleanup.js	10 Aug 2008 16:46:25 -0000	1.5
***************
*** 44,48 ****
  function FCKIECleanup_Cleanup()
  {
! 	if ( !this._FCKCleanupObj || !window.FCKUnloadFlag )
  		return ;
  
--- 44,48 ----
  function FCKIECleanup_Cleanup()
  {
! 	if ( !this._FCKCleanupObj || ( FCKConfig.MsWebBrowserControlCompat && !window.FCKUnloadFlag ) )
  		return ;
  

Index: fckdomrange.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckdomrange.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fckdomrange.js	5 May 2008 00:35:23 -0000	1.2
--- fckdomrange.js	10 Aug 2008 16:46:25 -0000	1.3
***************
*** 42,46 ****
  			// For text nodes, the node itself is the StartNode.
  			var eStart	= innerRange.startContainer ;
- 			var eEnd	= innerRange.endContainer ;
  
  			var oElementPath = new FCKElementPath( eStart ) ;
--- 42,45 ----
***************
*** 50,75 ****
  			this.StartBlockLimit	= oElementPath.BlockLimit ;
  
! 			if ( eStart != eEnd )
! 				oElementPath = new FCKElementPath( eEnd ) ;
! 
! 			// The innerRange.endContainer[ innerRange.endOffset ] is not
! 			// usually part of the range, but the marker for the range end. So,
! 			// let's get the previous available node as the real end.
! 			var eEndNode = eEnd ;
! 			if ( innerRange.endOffset == 0 )
  			{
! 				while ( eEndNode && !eEndNode.previousSibling )
! 					eEndNode = eEndNode.parentNode ;
! 
! 				if ( eEndNode )
! 					eEndNode = eEndNode.previousSibling ;
  			}
! 			else if ( eEndNode.nodeType == 1 )
! 				eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
  
! 			this.EndNode			= eEndNode ;
! 			this.EndContainer		= eEnd ;
! 			this.EndBlock			= oElementPath.Block ;
! 			this.EndBlockLimit		= oElementPath.BlockLimit ;
  		}
  
--- 49,86 ----
  			this.StartBlockLimit	= oElementPath.BlockLimit ;
  
! 			if ( innerRange.collapsed )
  			{
! 				this.EndNode		= this.StartNode ;
! 				this.EndContainer	= this.StartContainer ;
! 				this.EndBlock		= this.StartBlock ;
! 				this.EndBlockLimit	= this.StartBlockLimit ;
  			}
! 			else
! 			{
! 				var eEnd	= innerRange.endContainer ;
  
! 				if ( eStart != eEnd )
! 					oElementPath = new FCKElementPath( eEnd ) ;
! 
! 				// The innerRange.endContainer[ innerRange.endOffset ] is not
! 				// usually part of the range, but the marker for the range end. So,
! 				// let's get the previous available node as the real end.
! 				var eEndNode = eEnd ;
! 				if ( innerRange.endOffset == 0 )
! 				{
! 					while ( eEndNode && !eEndNode.previousSibling )
! 						eEndNode = eEndNode.parentNode ;
! 
! 					if ( eEndNode )
! 						eEndNode = eEndNode.previousSibling ;
! 				}
! 				else if ( eEndNode.nodeType == 1 )
! 					eEndNode = eEndNode.childNodes[ innerRange.endOffset - 1 ] ;
! 
! 				this.EndNode			= eEndNode ;
! 				this.EndContainer		= eEnd ;
! 				this.EndBlock			= oElementPath.Block ;
! 				this.EndBlockLimit		= oElementPath.BlockLimit ;
! 			}
  		}
  
***************
*** 459,463 ****
  		var addrStart = this._Range.startContainer ;
  		var addrEnd = this._Range.endContainer ;
! 		while ( curStart && curStart.nodeType == 3 )
  		{
  			bookmark.Start[0] += curStart.length ;
--- 470,474 ----
  		var addrStart = this._Range.startContainer ;
  		var addrEnd = this._Range.endContainer ;
! 		while ( curStart && addrStart.nodeType == 3 )
  		{
  			bookmark.Start[0] += curStart.length ;
***************
*** 465,469 ****
  			curStart = curStart.previousSibling ;
  		}
! 		while ( curEnd && curEnd.nodeType == 3 )
  		{
  			bookmark.End[0] += curEnd.length ;
--- 476,480 ----
  			curStart = curStart.previousSibling ;
  		}
! 		while ( curEnd && addrEnd.nodeType == 3 )
  		{
  			bookmark.End[0] += curEnd.length ;
***************
*** 864,867 ****
--- 875,884 ----
  		FCKDomTools.TrimNode( oFixedBlock ) ;
  
+ 		// If the fixed block is empty (not counting bookmark nodes)
+ 		// Add a <br /> inside to expand it.
+ 		if ( FCKDomTools.CheckIsEmptyElement(oFixedBlock, function( element ) { return element.getAttribute('_fck_bookmark') != 'true' ; } )
+ 				&& FCKBrowserInfo.IsGeckoLike )
+ 				FCKTools.AppendBogusBr( oFixedBlock ) ;
+ 
  		// Insert the fixed block into the DOM.
  		this.InsertNode( oFixedBlock ) ;

Index: fckstyle.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckstyle.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fckstyle.js	5 May 2008 00:35:23 -0000	1.2
--- fckstyle.js	10 Aug 2008 16:46:25 -0000	1.3
***************
*** 222,225 ****
--- 222,227 ----
  												continue ;
  
+ 											/*jsl:fallthru*/
+ 
  										default :
  											FCKDomTools.RemoveAttribute( pathElement, att ) ;
***************
*** 374,377 ****
--- 376,381 ----
  										continue ;
  
+ 									/*jsl:fallthru*/
+ 
  								default :
  									FCKDomTools.RemoveAttribute( currentNode, att ) ;
***************
*** 547,550 ****
--- 551,556 ----
  								continue ;
  
+ 							/*jsl:fallthru*/
+ 
  						default :
  							FCKDomTools.RemoveAttribute( innerElement, att ) ;
***************
*** 782,786 ****
  				if ( !isTag )
  				{
! 					value = value.replace( /\n/g, '<BR>' ) ;
  					value = value.replace( /[ \t]{2,}/g,
  							function ( match )
--- 788,792 ----
  				if ( !isTag )
  				{
! 					value = value.replace( /\n/g, '<br>' ) ;
  					value = value.replace( /[ \t]{2,}/g,
  							function ( match )
***************
*** 803,813 ****
  		var innerHTML = block.innerHTML.Trim() ;
  
! 		// 1. Delete ANSI whitespaces immediately before and after <BR> because they are not visible.
! 		// 2. Mark down any <BR /> nodes here so they can be turned into \n in the next step and avoid being compressed.
! 		innerHTML = innerHTML.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '<BR />' ) ;
  
! 		// 3. Compress other ANSI whitespaces since they're only visible as one single space previously.
  		// 4. Convert   to spaces since   is no longer needed in <PRE>.
! 		// 5. Convert any <BR /> to \n. This must not be done earlier because the \n would then get compressed.
  		var htmlIterator = new FCKHtmlIterator( innerHTML ) ;
  		var results = [] ;
--- 809,823 ----
  		var innerHTML = block.innerHTML.Trim() ;
  
! 		// 1. Delete ANSI whitespaces immediately before and after <BR> because
! 		//    they are not visible.
! 		// 2. Mark down any <BR /> nodes here so they can be turned into \n in
! 		//    the next step and avoid being compressed.
! 		innerHTML = innerHTML.replace( /[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi, '<br />' ) ;
  
! 		// 3. Compress other ANSI whitespaces since they're only visible as one
! 		//    single space previously.
  		// 4. Convert   to spaces since   is no longer needed in <PRE>.
! 		// 5. Convert any <BR /> to \n. This must not be done earlier because
! 		//    the \n would then get compressed.
  		var htmlIterator = new FCKHtmlIterator( innerHTML ) ;
  		var results = [] ;
***************
*** 816,827 ****
  				if ( !isTag )
  					value = value.replace( /([ \t\n\r]+| )/g, ' ' ) ;
! 				else if ( isTag && value == '<BR />' )
  					value = '\n' ;
  				results.push( value ) ;
  			} ) ;
  
! 		// Assigning innerHTML to <PRE> in IE causes all linebreaks to be reduced to spaces.
! 		// Assigning outerHTML to <PRE> in IE doesn't work if the <PRE> isn't contained in another node
! 		// since the node reference is changed after outerHTML assignment.
  		// So, we need some hacks to workaround IE bugs here.
  		if ( FCKBrowserInfo.IsIE )
--- 826,839 ----
  				if ( !isTag )
  					value = value.replace( /([ \t\n\r]+| )/g, ' ' ) ;
! 				else if ( isTag && value == '<br />' )
  					value = '\n' ;
  				results.push( value ) ;
  			} ) ;
  
! 		// Assigning innerHTML to <PRE> in IE causes all linebreaks to be
! 		// reduced to spaces.
! 		// Assigning outerHTML to <PRE> in IE doesn't work if the <PRE> isn't
! 		// contained in another node since the node reference is changed after
! 		// outerHTML assignment.
  		// So, we need some hacks to workaround IE bugs here.
  		if ( FCKBrowserInfo.IsIE )
***************
*** 829,841 ****
  			var temp = doc.createElement( 'div' ) ;
  			temp.appendChild( newBlock ) ;
! 			newBlock.outerHTML = '<PRE>\n' + results.join( '' ) + '</PRE>' ;
  			newBlock = temp.removeChild( temp.firstChild ) ;
  		}
  		else
  			newBlock.innerHTML = results.join( '' ) ;
  		return newBlock ;
  	},
  
  	/**
  	 * Apply an inline style to a FCKDomRange.
  	 *
--- 841,933 ----
  			var temp = doc.createElement( 'div' ) ;
  			temp.appendChild( newBlock ) ;
! 			newBlock.outerHTML = '<pre>\n' + results.join( '' ) + '</pre>' ;
  			newBlock = temp.removeChild( temp.firstChild ) ;
  		}
  		else
  			newBlock.innerHTML = results.join( '' ) ;
+ 
  		return newBlock ;
  	},
  
  	/**
+ 	 * Merge a <pre> block with a previous <pre> block, if available.
+ 	 */
+ 	_CheckAndMergePre : function( previousBlock, preBlock )
+ 	{
+ 		// Check if the previous block and the current block are next
+ 		// to each other.
+ 		if ( previousBlock != FCKDomTools.GetPreviousSourceElement( preBlock, true ) )
+ 			return ;
+ 
+ 		// Merge the previous <pre> block contents into the current <pre>
+ 		// block.
+ 		//
+ 		// Another thing to be careful here is that currentBlock might contain
+ 		// a '\n' at the beginning, and previousBlock might contain a '\n'
+ 		// towards the end. These new lines are not normally displayed but they
+ 		// become visible after merging.
+ 		var innerHTML = previousBlock.innerHTML.replace( /\n$/, '' ) + '\n\n' +
+ 				preBlock.innerHTML.replace( /^\n/, '' ) ;
+ 
+ 		// Buggy IE normalizes innerHTML from <pre>, breaking whitespaces.
+ 		if ( FCKBrowserInfo.IsIE )
+ 			preBlock.outerHTML = '<pre>' + innerHTML + '</pre>' ;
+ 		else
+ 			preBlock.innerHTML = innerHTML ;
+ 
+ 		// Remove the previous <pre> block.
+ 		//
+ 		// The preBlock must not be moved or deleted from the DOM tree. This
+ 		// guarantees the FCKDomRangeIterator in _ApplyBlockStyle would not
+ 		// get lost at the next iteration.
+ 		FCKDomTools.RemoveNode( previousBlock ) ;
+ 	},
+ 
+ 	_CheckAndSplitPre : function( newBlock )
+ 	{
+ 		var lastNewBlock ;
+ 
+ 		var cursor = newBlock.firstChild ;
+ 
+ 		// We are not splitting <br><br> at the beginning of the block, so
+ 		// we'll start from the second child.
+ 		cursor = cursor && cursor.nextSibling ;
+ 
+ 		while ( cursor )
+ 		{
+ 			var next = cursor.nextSibling ;
+ 
+ 			// If we have two <BR>s, and they're not at the beginning or the end,
+ 			// then we'll split up the contents following them into another block.
+ 			// Stop processing if we are at the last child couple.
+ 			if ( next && next.nextSibling && cursor.nodeName.IEquals( 'br' ) && next.nodeName.IEquals( 'br' ) )
+ 			{
+ 				// Remove the first <br>.
+ 				FCKDomTools.RemoveNode( cursor ) ;
+ 
+ 				// Move to the node after the second <br>.
+ 				cursor = next.nextSibling ;
+ 
+ 				// Remove the second <br>.
+ 				FCKDomTools.RemoveNode( next ) ;
+ 
+ 				// Create the block that will hold the child nodes from now on.
+ 				lastNewBlock = FCKDomTools.InsertAfterNode( lastNewBlock || newBlock, FCKDomTools.CloneElement( newBlock ) ) ;
+ 
+ 				continue ;
+ 			}
+ 
+ 			// If we split it, then start moving the nodes to the new block.
+ 			if ( lastNewBlock )
+ 			{
+ 				cursor = cursor.previousSibling ;
+ 				FCKDomTools.MoveNode(cursor.nextSibling, lastNewBlock ) ;
+ 			}
+ 
+ 			cursor = cursor.nextSibling ;
+ 		}
+ 	},
+ 
+ 	/**
  	 * Apply an inline style to a FCKDomRange.
  	 *
***************
*** 857,863 ****
  		var block ;
  		var doc = range.Window.document ;
! 
! 		var preBlocks = [] ;
! 		var convertedPreBlocks = [] ;
  
  		while( ( block = iterator.GetNextParagraph() ) )		// Only one =
--- 949,953 ----
  		var block ;
  		var doc = range.Window.document ;
! 		var previousPreBlock ;
  
  		while( ( block = iterator.GetNextParagraph() ) )		// Only one =
***************
*** 866,882 ****
  			var newBlock = this.BuildElement( doc ) ;
  
  			// Move everything from the current node to the new one.
! 			var newBlockIsPre = newBlock.nodeName.IEquals( 'pre' ) ;
! 			var blockIsPre = block.nodeName.IEquals( 'pre' ) ;
! 			if ( newBlockIsPre && !blockIsPre )
! 			{
  				newBlock = this._ToPre( doc, block, newBlock ) ;
! 				preBlocks.push( newBlock ) ;
! 			}
! 			else if ( !newBlockIsPre && blockIsPre )
! 			{
  				newBlock = this._FromPre( doc, block, newBlock ) ;
- 				convertedPreBlocks.push( newBlock ) ;
- 			}
  			else	// Convering from a regular block to another regular block.
  				FCKDomTools.MoveChildren( block, newBlock ) ;
--- 956,971 ----
  			var newBlock = this.BuildElement( doc ) ;
  
+ 			// Check if we are changing from/to <pre>.
+ 			var newBlockIsPre	= newBlock.nodeName.IEquals( 'pre' ) ;
+ 			var blockIsPre		= block.nodeName.IEquals( 'pre' ) ;
+ 
+ 			var toPre	= newBlockIsPre && !blockIsPre ;
+ 			var fromPre	= !newBlockIsPre && blockIsPre ;
+ 
  			// Move everything from the current node to the new one.
! 			if ( toPre )
  				newBlock = this._ToPre( doc, block, newBlock ) ;
! 			else if ( fromPre )
  				newBlock = this._FromPre( doc, block, newBlock ) ;
  			else	// Convering from a regular block to another regular block.
  				FCKDomTools.MoveChildren( block, newBlock ) ;
***************
*** 885,930 ****
  			block.parentNode.insertBefore( newBlock, block ) ;
  			FCKDomTools.RemoveNode( block ) ;
- 		}
  
! 		// Merge adjacent <PRE> blocks for #1229.
! 		for ( var i = 0 ; i < preBlocks.length - 1 ; i++ )
! 		{
! 			// Check if the next block in HTML equals the next <PRE> block generated.
! 			if ( FCKDomTools.GetNextSourceElement( preBlocks[i], true, [], [], true ) != preBlocks[i+1] )
! 				continue ;
! 
! 			// Merge the upper <PRE> block's content into the lower <PRE> block.
! 			// Remove the upper <PRE> block.
! 			preBlocks[i+1].innerHTML = preBlocks[i].innerHTML + '\n\n' + preBlocks[i+1].innerHTML ;
! 			FCKDomTools.RemoveNode( preBlocks[i] ) ;
! 		}
! 
! 		// Split converted <PRE> blocks for #1229.
! 		for ( var i = 0 ; i < convertedPreBlocks.length ; i++ )
! 		{
! 			var currentBlock = convertedPreBlocks[i] ;
! 			var lastNewBlock = null ;
! 			for ( var j = 0 ; j < currentBlock.childNodes.length ; j++ )
  			{
! 				var cursor = currentBlock.childNodes[j] ;
! 
! 				// If we have two <BR>s, and they're not at the beginning or the end,
! 				// then we'll split up the contents following them into another block.
! 				if ( cursor.nodeName.IEquals( 'br' ) && j != 0 && j != currentBlock.childNodes.length - 2
! 						&& cursor.nextSibling && cursor.nextSibling.nodeName.IEquals( 'br' ) )
! 				{
! 					FCKDomTools.RemoveNode( cursor.nextSibling ) ;
! 					FCKDomTools.RemoveNode( cursor ) ;
! 					j-- ;	// restart at current index at next iteration
! 					lastNewBlock = FCKDomTools.InsertAfterNode( lastNewBlock || currentBlock, doc.createElement( currentBlock.nodeName ) ) ;
! 					continue ;
! 				}
! 
! 				if ( lastNewBlock )
! 				{
! 					FCKDomTools.MoveNode( cursor, lastNewBlock ) ;
! 					j-- ;	// restart at current index at next iteration
! 				}
  			}
  		}
  
--- 974,987 ----
  			block.parentNode.insertBefore( newBlock, block ) ;
  			FCKDomTools.RemoveNode( block ) ;
  
! 			// Complete other tasks after inserting the node in the DOM.
! 			if ( newBlockIsPre )
  			{
! 				if ( previousPreBlock )
! 					this._CheckAndMergePre( previousPreBlock, newBlock ) ;	// Merge successive <pre> blocks.
! 				previousPreBlock = newBlock ;
  			}
+ 			else if ( fromPre )
+ 				this._CheckAndSplitPre( newBlock ) ;	// Split <br><br> in successive <pre>s.
  		}
  

Index: fckdomrangeiterator.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckdomrangeiterator.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fckdomrangeiterator.js	5 May 2008 00:35:23 -0000	1.2
--- fckdomrangeiterator.js	10 Aug 2008 16:46:25 -0000	1.3
***************
*** 137,141 ****
  						// point. (#1717)
  						if ( nodeName != 'br' )
! 							this._NextNode = currentNode ;
  					}
  
--- 137,141 ----
  						// point. (#1717)
  						if ( nodeName != 'br' )
! 							this._NextNode = FCKDomTools.GetNextSourceNode( currentNode, true, null, lastNode ) ;
  					}
  

Index: fckpanel.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckpanel.js,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** fckpanel.js	5 May 2008 00:35:23 -0000	1.5
--- fckpanel.js	10 Aug 2008 16:46:25 -0000	1.6
***************
*** 67,75 ****
  	{
  		var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
  		oIFrame.src					= 'javascript:void(0)' ;
  		oIFrame.allowTransparency	= true ;
  		oIFrame.frameBorder			= '0' ;
  		oIFrame.scrolling			= 'no' ;
! 		oIFrame.width = oIFrame.height = 0 ;
  		FCKDomTools.SetElementStyles( oIFrame,
  			{
--- 67,76 ----
  	{
  		var oIFrame = this._IFrame = this._Window.document.createElement('iframe') ;
+ 		FCKTools.ResetStyles( oIFrame );
  		oIFrame.src					= 'javascript:void(0)' ;
  		oIFrame.allowTransparency	= true ;
  		oIFrame.frameBorder			= '0' ;
  		oIFrame.scrolling			= 'no' ;
! 		oIFrame.style.width = oIFrame.style.height = '0px' ;
  		FCKDomTools.SetElementStyles( oIFrame,
  			{
***************
*** 278,283 ****
  				var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
  				var iHeight = eMainNode.offsetHeight ;
! 				me._IFrame.width = iWidth ;
! 				me._IFrame.height = iHeight ;
  
  			}, 0 ) ;
--- 279,284 ----
  				var iWidth = eMainNode.offsetWidth || eMainNode.firstChild.offsetWidth ;
  				var iHeight = eMainNode.offsetHeight ;
! 				me._IFrame.style.width = iWidth + 'px' ;
! 				me._IFrame.style.height = iHeight + 'px' ;
  
  			}, 0 ) ;
***************
*** 304,308 ****
  		// It is better to set the sizes to 0, otherwise Firefox would have
  		// rendering problems.
! 		this._IFrame.width = this._IFrame.height = 0 ;
  
  		this._IsOpened = false ;
--- 305,309 ----
  		// It is better to set the sizes to 0, otherwise Firefox would have
  		// rendering problems.
! 		this._IFrame.style.width = this._IFrame.style.height = '0px' ;
  
  		this._IsOpened = false ;

Index: fckdocumentfragment_gecko.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckdocumentfragment_gecko.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fckdocumentfragment_gecko.js	5 May 2008 00:35:23 -0000	1.2
--- fckdocumentfragment_gecko.js	10 Aug 2008 16:46:25 -0000	1.3
***************
*** 40,43 ****
--- 40,50 ----
  	},
  
+ 	AppendHtml : function( html )
+ 	{
+ 		var eTmpDiv = this.RootNode.ownerDocument.createElement( 'div' ) ;
+ 		eTmpDiv.innerHTML = html ;
+ 		FCKDomTools.MoveChildren( eTmpDiv, this.RootNode ) ;
+ 	},
+ 
  	InsertAfterNode : function( existingNode )
  	{

Index: fckeditingarea.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckeditingarea.js,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** fckeditingarea.js	5 May 2008 00:35:23 -0000	1.5
--- fckeditingarea.js	10 Aug 2008 16:46:25 -0000	1.6
***************
*** 97,105 ****
  
  		oIFrame.frameBorder = 0 ;
! 		oIFrame.width = oIFrame.height = '100%' ;
  
  		if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
  		{
! 			window._FCKHtmlToLoad = sOverrideError + html ;
  			oIFrame.src = 'javascript:void( (function(){' +
  				'document.open() ;' +
--- 97,105 ----
  
  		oIFrame.frameBorder = 0 ;
! 		oIFrame.style.width = oIFrame.style.height = '100%' ;
  
  		if ( FCK_IS_CUSTOM_DOMAIN && FCKBrowserInfo.IsIE )
  		{
! 			window._FCKHtmlToLoad = html.replace( /<head>/i, '<head>' + sOverrideError ) ;
  			oIFrame.src = 'javascript:void( (function(){' +
  				'document.open() ;' +
***************
*** 133,137 ****
  
  			oDoc.open() ;
! 			oDoc.write( sOverrideError + html ) ;
  			oDoc.close() ;
  		}
--- 133,137 ----
  
  			oDoc.open() ;
! 			oDoc.write( html.replace( /<head>/i, '<head>' + sOverrideError ) ) ;
  			oDoc.close() ;
  		}
***************
*** 151,166 ****
  		{
  			var editArea = this ;
! 			( oIFrame.onreadystatechange = function()
! 			{
! 				if ( oIFrame.readyState == 'complete' )
! 				{
! 					oIFrame.onreadystatechange = null ;
! 					editArea.Window._FCKEditingArea = editArea ;
! 					FCKEditingArea_CompleteStart.call( editArea.Window ) ;
! 				}
! 			// It happened that IE changed the state to "complete" after the
! 			// "if" and before the "onreadystatechange" assignement, making we
! 			// lost the event call, so we do a manual call just to be sure.
! 			} )() ;
  		}
  		else
--- 151,171 ----
  		{
  			var editArea = this ;
! 
! 			// Using a IE alternative for DOMContentLoaded, similar to the
! 			// solution proposed at http://javascript.nwbox.com/IEContentLoaded/
! 			setTimeout( function()
! 					{
! 						try
! 						{
! 							editArea.Window.document.documentElement.doScroll("left") ;
! 						}
! 						catch(e)
! 						{
! 							setTimeout( arguments.callee, 0 ) ;
! 							return ;
! 						}
! 						editArea.Window._FCKEditingArea = editArea ;
! 						FCKEditingArea_CompleteStart.call( editArea.Window ) ;
! 					}, 0 ) ;
  		}
  		else
***************
*** 247,250 ****
--- 252,256 ----
  			{
  				oDoc.body.innerHTML = this._BodyHTML ;
+ 				oDoc.body.offsetLeft ;		// Don't remove, this is a hack to fix Opera 9.50, see #2264.
  				this._BodyHTML = null ;
  			}

Index: fckenterkey.js
===================================================================
RCS file: /cvsroot/geeklog/Geeklog-1.x/public_html/fckeditor/editor/_source/classes/fckenterkey.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** fckenterkey.js	5 May 2008 00:35:23 -0000	1.2
--- fckenterkey.js	10 Aug 2008 16:46:25 -0000	1.3
***************
*** 44,58 ****
  		[ 13		, 'Enter' ],
  		[ SHIFT + 13, 'ShiftEnter' ],
- 		[ 9 		, 'Tab' ],
  		[ 8			, 'Backspace' ],
! 		[ CTRL + 8		, 'CtrlBackspace' ],
  		[ 46		, 'Delete' ]
  	] ) ;
  
! 	if ( tabSpaces > 0 )
  	{
! 		this.TabText = '' ;
! 		while ( tabSpaces-- > 0 )
  			this.TabText += '\xa0' ;
  	}
  
--- 44,62 ----
  		[ 13		, 'Enter' ],
  		[ SHIFT + 13, 'ShiftEnter' ],
  		[ 8			, 'Backspace' ],
! 		[ CTRL + 8	, 'CtrlBackspace' ],
  		[ 46		, 'Delete' ]
  	] ) ;
  
! 	this.TabText = '' ;
! 
! 	// Safari by default inserts 4 spaces on TAB, while others make the editor
! 	// loose focus. So, we need to handle it here to not include those spaces.
! 	if ( tabSpaces > 0 || FCKBrowserInfo.IsSafari )
  	{
! 		while ( tabSpaces-- )
  			this.TabText += '\xa0' ;
+ 
+ 		oKeystrokeHandler.SetKeystrokes( [ 9, 'Tab' ] );
  	}
  
***************
*** 164,167 ****
--- 168,193 ----
  	}
  
+ 	// On IE, it is better for us handle the deletion if the caret is preceeded
+ 	// by a <br> (#1383).
+ 	if ( FCKBrowserInfo.IsIE )
+ 	{
+ 		var previousElement = FCKDomTools.GetPreviousSourceElement( oRange.StartNode, true ) ;
+ 
+ 		if ( previousElement && previousElement.nodeName.toLowerCase() == 'br' )
+ 		{
+ 			// Create a range that starts after the <br> and ends at the
+ 			// current range position.
+ 			var testRange = oRange.Clone() ;
+ 			testRange.SetStart( previousElement, 4 ) ;
+ 
+ 			// If that range is empty, we can proceed cleaning that <br> manually.
+ 			if ( testRange.CheckIsEmpty() )
+ 			{
+ 				previousElement.parentNode.removeChild( previousElement ) ;
+ 				return true ;
+ 			}
+ 		}
+ 	}
+ 
  	var oStartBlock = oRange.StartBlock ;
  	var oEndBlock = oRange.EndBlock ;
***************
*** 505,512 ****
  		}
  
! 		if ( FCKBrowserInfo.IsSafari )
  			FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
- 		else if ( FCKBrowserInfo.IsGeckoLike )
- 			( eNextBlock || eNewBlock ).scrollIntoView( false ) ;
  
  		oRange.Select() ;
--- 531,536 ----
  		}
  
! 		if ( FCKBrowserInfo.IsGeckoLike )
  			FCKDomTools.ScrollIntoView( eNextBlock || eNewBlock, false ) ;
  
  		oRange.Select() ;
***************
*** 591,598 ****
  				eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ;
  
! 				if ( FCKBrowserInfo.IsSafari )
! 					FCKDomTools.ScrollIntoView( dummy, false ) ;
! 				else
! 					dummy.scrollIntoView( false ) ;
  
  				dummy.parentNode.removeChild( dummy ) ;
--- 615,619 ----
  				eLineBreak.parentNode.insertBefore( dummy, eLineBreak.nextSibling ) ;
  
! 				FCKDomTools.ScrollIntoView( dummy, false ) ;
  
  				dummy.parentNode.removeChild( dummy ) ;




More information about the geeklog-cvs mailing list