r1776 - in branches/bxe_2_0: js mozile relaxng

[email protected] Fri, 9 Nov 2007 16:58:38 +0100 (CET)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Fri Nov  9 16:58:37 2007
New Revision: 1776

Log:
fix for BXEB-46



Modified:
   branches/bxe_2_0/js/bxeFunctions.js
   branches/bxe_2_0/js/bxeXMLNode.js
   branches/bxe_2_0/mozile/mozCE.js
   branches/bxe_2_0/relaxng/ElementVDOM.js
   branches/bxe_2_0/relaxng/RelaxNG.js

Modified: branches/bxe_2_0/js/bxeFunctions.js
==============================================================================
--- branches/bxe_2_0/js/bxeFunctions.js	(original)
+++ branches/bxe_2_0/js/bxeFunctions.js	Fri Nov  9 16:58:37 2007
@@ -805,9 +805,7 @@
 			} catch(e) {
 			}
 			delNode.unlink();
-			if (par._node.childNodes.length == 0)  {
-				bxe_checkEmpty(par);
-			}
+			bxe_checkEmptyParent(par);
 				
 			if (par.parentNode) {
 				bxe_Transform(false,false,par.parentNode);
@@ -2852,6 +2850,9 @@
 	par._node.betterNormalize();
 	if (par._node.childNodes.length == 0) {
 		bxe_checkEmpty(par);
+	} else if (par.vdom && !par.vdom.bxeOnemptyAllowWhitespace && par.isWhitespaceOnly) {
+		par.removeAllChildren();
+		bxe_checkEmpty(par);
 	}
 }
 

Modified: branches/bxe_2_0/js/bxeXMLNode.js
==============================================================================
--- branches/bxe_2_0/js/bxeXMLNode.js	(original)
+++ branches/bxe_2_0/js/bxeXMLNode.js	Fri Nov  9 16:58:37 2007
@@ -115,11 +115,25 @@
 function()
 {
 	if (this._node.nodeType == 3) {
-		if(/\S+/.test(this._node.nodeValue)) // any non white space visible characters
+		if(/\S+/.test(this._node.nodeValue)) {// any non white space visible characters
 			return false;
+		}
 		
 		return true;
 	} else {
+		if (this._node.nodeType == 1) {
+			var c = this._node.firstChild;
+			while (c) {
+				if ( c.nodeType != 3) {
+					return false;
+				}
+				if (!c.isWhitespaceOnly) {
+					return false;
+				}
+				c = c.nextSibling;
+			}
+			return true;
+		}
 		return false;
 	}
 }

Modified: branches/bxe_2_0/mozile/mozCE.js
==============================================================================
--- branches/bxe_2_0/mozile/mozCE.js	(original)
+++ branches/bxe_2_0/mozile/mozCE.js	Fri Nov  9 16:58:37 2007
@@ -420,9 +420,8 @@
 			if (textNode.parentNode == xmlnode) {
 				xmlnode.removeChild(textNode);
 				xmlnode.betterNormalize();
-				if (xmlnode.childNodes.length == 0)  {
-					bxe_checkEmpty(xmlnode);
-				}
+				bxe_checkEmptyParent(xmlnode);
+				
 			} else {
 				delete textNode;
 			}

Modified: branches/bxe_2_0/relaxng/ElementVDOM.js
==============================================================================
--- branches/bxe_2_0/relaxng/ElementVDOM.js	(original)
+++ branches/bxe_2_0/relaxng/ElementVDOM.js	Fri Nov  9 16:58:37 2007
@@ -68,8 +68,9 @@
 		
 		if (child.nodeName == "RELAXNG_REF" && child.DefineVDOM) {
 			var AA = child.DefineVDOM.getAllAttributes()
-			if (AA) {
+			if (AA && attr) {
 				for (i in AA) {
+					
 					attr[AA[i].name]= AA[i];
 					//attr.push(AA[i]);
 				}

Modified: branches/bxe_2_0/relaxng/RelaxNG.js
==============================================================================
--- branches/bxe_2_0/relaxng/RelaxNG.js	(original)
+++ branches/bxe_2_0/relaxng/RelaxNG.js	Fri Nov  9 16:58:37 2007
@@ -443,6 +443,12 @@
 						this.bxeOnnew = childNodes[i].firstChild.data;
 					}
 					break;
+				case "onnewafter":
+					this.bxeOnnewafterType = childNodes[i].getAttribute("type");
+					if (childNodes[i].firstChild) {
+						this.bxeOnnewafter = childNodes[i].firstChild.data;
+					}
+					break;
 				case "onempty":
 					this.bxeOnemptyType = childNodes[i].getAttribute("type");
 					if (childNodes[i].firstChild) {
@@ -450,6 +456,10 @@
 					} else {
 						this.bxeOnempty = true;
 					}
+					if (childNodes[i].getAttribute("allowwhitespaceonly") == 'true') {
+						this.bxeOnemptyAllowWhitespace = true;
+					}
+					
 					break;
 				case "dontshow":
 					this.bxeDontshow = true;
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs