r1546 - branches/bxe_2_0/js

[email protected] Wed, 18 Oct 2006 11:41:35 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Wed Oct 18 11:41:34 2006
New Revision: 1546

Modified:
   branches/bxe_2_0/js/bxeFunctions.js
Log:
add needed attributes automatically

Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Wed Oct 18 11:41:34 2006
@@ -2036,7 +2036,8 @@
 function bxe_insertContent_async(node,replaceNode, options) {
 	var docfrag;
 	if (typeof node == "string") {
-        docfrag = node.convertToXML()
+        docfrag = node.convertToXML();
+		
 	} else {
 		docfrag = node;
 	}
@@ -2046,7 +2047,6 @@
 		//FIXME 2.0 doesn't work yet
 		var sel = window.getSelection();
 		;
-		
 		//var _node = _currentNode.prepareForInsert();
 		if (options & BXE_SPLIT_IF_INLINE) {
 			var  _currentNode = docfrag.lastChild
@@ -2058,13 +2058,20 @@
 			}
 			if (!bxe_checkIsAllowedChild(_currentNode.namespaceURI,_currentNode.localName,sel, true)) {
 				var cssr = sel.getEditableRange();
+				/*
+				//doesn't split text nodes anymore
+				do we need that?
+				can be deleted otherwise (18.10.2006)
+				
 				var textNode = sel.anchorNode.XMLNode._node;
 				textNode.splitText(cssr.startOffset);
 				var _position = bxe_getChildPosition(textNode);
+				*/
 				var lala = sel.anchorNode.parentNode.XMLNode._node;
-				lala.split(_position);
+				//lala.split(_position);
 				
 			    lala.parentNode.insertBefore(docfrag,lala.nextSibling);
+				lala.parentNode.XMLNode.isNodeValid(true,2,true);
 				bxe_Transform();
 				return ;
 			}
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs