r1544 - in branches/bxe_2_0: mozile relaxng

[email protected] Tue, 17 Oct 2006 15:00:08 +0200 (CEST)
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Tue Oct 17 15:00:07 2006
New Revision: 1544

Modified:
   branches/bxe_2_0/mozile/mozCE.js
   branches/bxe_2_0/relaxng/RelaxNG.js
Log:

add firstchild and firstgrandchild options


Modified: branches/bxe_2_0/mozile/mozCE.js
==============================================================================
--- branches/bxe_2_0/mozile/mozCE.js	(original)
+++ branches/bxe_2_0/mozile/mozCE.js	Tue Oct 17 15:00:07 2006
@@ -775,21 +775,33 @@
 					content2 += " xmlns='"+elementNamespace +"'";
 				}
 				content += ">";
-				for (var i = 0; i < row.length; i++) {
+				var _starti = 0;
+				if (paraElementVdom.bxeClipboardFirstChild) {
+					_starti = 1;
+					content += "<"+ paraElementVdom.bxeClipboardFirstChild +">";
+					row[0] = row[0] + "\t";
+					var cell = row[0].match(/([^\t]*[\t$]+)/g);
+					for (var j = 0; j < cell.length; j++) {
+						content += "<"+paraElementVdom.bxeClipboardFirstGrandChild + ">";
+						content += cell[j];
+						content += "</" + paraElementVdom.bxeClipboardFirstGrandChild + ">";
+					}
+					content += "</"+ paraElementVdom.bxeClipboardFirstChild +">";
+					
+				}
+				
+				for (var i = _starti; i < row.length; i++) {
 					content += "<"+ elementNameParent +">";
 					row[i] = row[i] + "\t";
 					var cell = row[i].match(/([^\t]*[\t$]+)/g);
 					for (var j = 0; j < cell.length; j++) {
 						content += "<"+elementName_start + ">";
-						console.log(cell[j]);
 						content += cell[j];
 						content += "</" + elementName + ">";
 					}
 					content += "</"+ elementNameParent +">";
 				}
 				content += "</" + elementNameGrandParent + ">";
-				
-				console.log(content);
 			} else {
 				content = "<"+elementName_start + ">"+ content.replace(/[\n\r]+/g,"</"+elementName+"><"+elementName_start+" >")+"</"+elementName+">";
 				

Modified: branches/bxe_2_0/relaxng/RelaxNG.js
==============================================================================
--- branches/bxe_2_0/relaxng/RelaxNG.js	(original)
+++ branches/bxe_2_0/relaxng/RelaxNG.js	Tue Oct 17 15:00:07 2006
@@ -469,6 +469,17 @@
 				case "clipboard":
 					this.bxeClipboard = childNodes[i].firstChild.data;
 					if (childNodes[i].hasAttribute("child")) {
+						if (childNodes[i].hasAttribute("grandchild")) {
+							this.bxeClipboardGrandChild =  childNodes[i].getAttribute("grandchild");
+							if (childNodes[i].hasAttribute("firstgrandchild")) {
+								this.bxeClipboardFirstGrandChild =  childNodes[i].getAttribute("firstgrandchild");
+							}
+							
+						}
+						if (childNodes[i].hasAttribute("firstchild")) {
+							this.bxeClipboardFirstChild =  childNodes[i].getAttribute("firstchild");
+						}
+						
 						this.bxeClipboardChild = childNodes[i].getAttribute("child")
 					} else {
 						this.bxeClipboardChild  = false;
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs