r1620 - in branches/bxe_2_0: mozile xsl

[email protected] Thu, 9 Nov 2006 08:30:39 +0100 (CET)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Thu Nov  9 08:30:38 2006
New Revision: 1620

Modified:
   branches/bxe_2_0/mozile/mozilekb.js
   branches/bxe_2_0/xsl/transformxsl.xsl
Log:
even more...


Modified: branches/bxe_2_0/mozile/mozilekb.js
==============================================================================
--- branches/bxe_2_0/mozile/mozilekb.js	(original)
+++ branches/bxe_2_0/mozile/mozilekb.js	Thu Nov  9 08:30:38 2006
@@ -532,9 +532,10 @@
 		{
 			//if !collapsed, get the editable Range, it has a saner check, the getRangeAt(0) does not always work
 			bxe_deleteEventKey(sel,false);
-			
 			sel = window.getSelection();
 			//sel.selectEditableRange(cssr);
+			
+			try {
 			cssr = sel.getRangeAt(0);
 			var _node = sel.anchorNode.parentNode;
 			if (_node.getAttribute("__bxe_defaultcontent") == "true") {
@@ -550,12 +551,18 @@
 				par = cssr.startContainer.parentNode;
 				
 			}
+			par = cssr.startContainer.parentNode;
+			} catch(e) {
+			}
 
 		}
-
 		var startC = cssr.startContainer;
+		
 		var startOff = cssr.startOffset;
-		sel.collapse( startC, startOff);
+		if (startC.nodeType == 1 && startC.firstChild.nodeType == 3) {
+			startC = startC.firstChild;
+			startOff = 0;
+		}
 		var _ch = String.fromCharCode(event.charCode);
 		if(startOff > 0) {
 			if (startC.substringData(startOff-1,1) == STRING_NBSP) {
@@ -625,12 +632,13 @@
 			sel.extend(sel.focusNode,_pos);
 			
 		}
+				
 		if (sel.anchorNode.nodeType == 3 && sel.anchorOffset == 0) {
 			// if only one textnode and fully selected
+				
 			if (sel.anchorNode == sel.focusNode) {
 				if (sel.focusOffset >= sel.anchorNode.nodeValue.strip().length) {
 					var xmlnode = bxe_getXMLNodeByHTMLNodeRecursive(sel.anchorNode);
-					
 					//xmlnode.parentNode.appendChild(xmlnode.ownerDocument.createTextNode(" "));
 					var _par = bxe_getXMLNodeByHTMLNodeRecursive(sel.anchorNode.parentNode);
 					if (_par) {
@@ -641,6 +649,7 @@
 								_par.nodeValue = "#";
 								
 							}
+							//sel.anchorNode.nodeValue = _par.nodeValue;
 							//_par.XMLNode.makeDefaultNodes();
 						} else {
 							_par.removeChild(xmlnode);
@@ -648,7 +657,6 @@
 						}
 						
 						
-						
 					} else {
 						bxe_deleteWholeSelection(sel,backspace);
 						sel = window.getSelection();

Modified: branches/bxe_2_0/xsl/transformxsl.xsl
==============================================================================
--- branches/bxe_2_0/xsl/transformxsl.xsl	(original)
+++ branches/bxe_2_0/xsl/transformxsl.xsl	Thu Nov  9 08:30:38 2006
@@ -59,6 +59,8 @@
                 <!-- attribute nodes... -->
                 <xsl:if test="contains(@select, '@')">
                 <xsl:element name="attribute" namespace="http://www.w3.org/1999/XSL/Transform"><xsl:attribute name="name">__bxe_attribute</xsl:attribute><xsl:value-of select="substring-after(@select,'@')"/></xsl:element>
+                
+                
                 </xsl:if>
                 <xsl:element name="copy-of" namespace="http://www.w3.org/1999/XSL/Transform"><xsl:attribute name="select"><xsl:choose>
                             <xsl:when test="@select"><xsl:value-of select="@select"/>/@__bxe_defaultcontent</xsl:when>
@@ -109,7 +111,7 @@
     <xsl:for-each select="@*">
                 <xsl:copy/>
             </xsl:for-each>
-            <xsl:if test="not(following-sibling::*/@__bxe_id)"> 
+            <xsl:if test="not(following-sibling::*/@__bxe_id) and (.//*[namespace-uri() = 'http://www.w3.org/1999/XSL/Transform'])"> 
              
             <xsl:element name="attribute" namespace="http://www.w3.org/1999/XSL/Transform">
             
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs