rem: { 
add: { 
context: 	_ExecContentsAction : function( action, docFrag )	{			var startNode	= this.startContainer ;		var endNode		= this.endContainer ;				var startOffset	= this.startOffset ;		var endOffset	= this.endOffset ;				var removeStartNode	= false ;		var removeEndNode	= false ;				// Check the start and end nodes and make the necessary removals or changes.				// Start from the end, otherwise DOM mutations (splitText) made in the		// start boundary may interfere on the results here.		// For text containers, we must simply split the node and point to the		// second part. The removal will be handled by the rest of the code .		if ( endNode.nodeType == 3 )			endNode = endNode.splitText( endOffset ) ;		else		{			// If the end container has children and the offset is pointing			// to a child, then we should start from it.			if ( endNode.childNodes.length > 0 )			{				// If the offset points after the last node.				if ( endOffset > endNode.childNodes.length - 1 )				{					// Let's create a temporary node and mark it for removal.					endNode = FCKDomTools.InsertAfterNode( endNode.lastChild, this._Document.createTextNode('') ) ;					removeEndNode = true ;				}				else					endNode = endNode.childNodes[ endOffset ] ;			}		}		// For text containers, we must simply split the node. The removal will		// be handled by the rest of the code .		if ( startNode.nodeType == 3 )		{			startNode.splitText( startOffset ) ;						// In cases the end node is the same as the start node, the above			// splitting will also split the end, so me must move the end to			// the second part of the split.			if ( startNode == endNode )				endNode = startNode.nextSibling ;		}		else		{			// If the start container has children and the offset is pointing			// to a child, then we should start from its previous sibling.			if ( startNode.childNodes.length > 0 &&  startOffset <= startNode.childNodes.length - 1 )			{				// If the offset points to the first node, we don't have a				// sibling, so let's use the first one, but mark it for removal.				if ( startOffset == 0 )				{					// Let's create a temporary node and mark it for removal.					startNode = startNode.insertBefore( this._Document.createTextNode(''), startNode.firstChild ) ;					removeStartNode = true ;				}				else					startNode = startNode.childNodes[ startOffset ].previousSibling ;			}		}				// Get the parent nodes tree for the start and end boundaries.		var startParents	= FCKDomTools.GetParents( startNode ) ;		var endParents		= FCKDomTools.GetParents( endNode ) ;				// Compare them, to find the top most siblings.		var i, topStart, topEnd ;				for ( i = 0 ; i < startParents.length ; i++ )		{			topStart	= startParents[i] ;			topEnd		= endParents[i] ;						// The compared nodes will match until we find the top most			// siblings (different nodes that have the same parent).			// "i" will hold the index in the parants array for the top 			// most element.			if ( topStart != topEnd )				break ;		}		var clone, levelStartNode, levelClone, currentNode, currentSibling ;				if ( docFrag )			clone = docFrag.RootNode ;		// Remove all successive sibling nodes for every node in the		// startParents tree.		for ( var j = i ; j < startParents.length ; j++ )		{			levelStartNode = startParents[j] ;						// For Extract and Clone, we must clone this level.			if ( clone && levelStartNode != startNode )		// action = 0 = Delete				levelClone = clone.appendChild( levelStartNode.cloneNode( levelStartNode == startNode ) ) ;						currentNode = levelStartNode.nextSibling ;						while( currentNode )			{				// Stop processing when the current node matches a node in the				// endParents tree or if it is the endNode.				if ( currentNode == endParents[j] || currentNode == endNode )					break ;								// Cache the next sibling.				currentSibling = currentNode.nextSibling ;				// If clonning, just clone it.				if ( action == 2 )	// 2 = Clone					clone.appendChild( currentNode.cloneNode( true ) ) ;				else				{					// Both Delete and Extract will remove the node.					currentNode.parentNode.removeChild( currentNode ) ;										// When Extracting, move the removed node to the docFrag.					if ( action == 1 )	// 1 = Extract						clone.appendChild( currentNode ) ;				}								currentNode = currentSibling ;			}						if ( clone )				clone = levelClone ;		}				if ( docFrag )			clone = docFrag.RootNode ;		// Remove all previous sibling nodes for every node in the		// endParents tree.		for ( var k = i ; k < endParents.length ; k++ )		{			levelStartNode = endParents[k] ;						// For Extract and Clone, we must clone this level.			if ( action > 0 && levelStartNode != endNode )		// action = 0 = Delete				levelClone = clone.appendChild( levelStartNode.cloneNode( levelStartNode == endNode ) ) ;			// The processing of siblings may have already been done by the parent.			if ( !startParents[k] || levelStartNode.parentNode != startParents[k].parentNode )			{				currentNode = levelStartNode.previousSibling ;				while( currentNode )				{					// Stop processing when the current node matches a node in the					// startParents tree or if it is the startNode.					if ( currentNode == startParents[k] || currentNode == startNode )						break ;					// Cache the next sibling.					currentSibling = currentNode.previousSibling ;					// If clonning, just clone it.					if ( action == 2 )	// 2 = Clone						clone.insertBefore( currentNode.cloneNode( true ), clone.firstChild ) ;					else					{						// Both Delete and Extract will remove the node.						currentNode.parentNode.removeChild( currentNode ) ;												// When Extracting, mode the removed node to the docFrag.						if ( action == 1 )	// 1 = Extract							clone.insertBefore( currentNode, clone.firstChild ) ;					}					currentNode = currentSibling ;				}			}						if ( clone )				clone = levelClone ;		}				if ( action == 2 )		// 2 = Clone.		{			// No changes in the DOM should be done, so fix the split text (if any).			var startTextNode = this.startContainer ;			if ( startTextNode.nodeType == 3 )			{				startTextNode.data += startTextNode.nextSibling.data ;				startTextNode.parentNode.removeChild( startTextNode.nextSibling ) ;			}			var endTextNode = this.endContainer ;			if ( endTextNode.nodeType == 3 && endTextNode.nextSibling )			{				endTextNode.data += endTextNode.nextSibling.data ;				endTextNode.parentNode.removeChild( endTextNode.nextSibling ) ;			}		}		else		{			// Collapse the range.				// If a node has been partially selected, collapse the range between			// topStart and topEnd. Otherwise, simply collapse it to the start. (W3C specs).			if ( topStart && topEnd && ( startNode.parentNode != topStart.parentNode || endNode.parentNode != topEnd.parentNode ) )				this.setStart( topEnd.parentNode, FCKDomTools.GetIndexOf( topEnd ) ) ;						// Collapse it to the start.			this.collapse( true ) ;		}		// Cleanup any marked node.		if( removeStartNode )			startNode.parentNode.removeChild( startNode ) ;		if( removeEndNode && endNode.parentNode )			endNode.parentNode.removeChild( endNode ) ;	},
meta: 1235	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/1235/c3e806dd2e80d30e5028083f65e626da8d5acba4/fckw3crange.js/clean/reference/library/src/webapp/editor/FCKeditor/editor/_source/classes/fckw3crange.js