r1424 - branches/bxe_2_0/js

[email protected]
Newsgroups gmane.editors.bitflux.cvs
Message-ID <[email protected]>
Author: chregu
Date: Fri Dec 16 18:12:29 2005
New Revision: 1424

Modified:
   branches/bxe_2_0/js/table.js
Log:
automatic attribute adding for table cells seems to work now


Modified: branches/bxe_2_0/js/table.js
==============================================================================
--- branches/bxe_2_0/js/table.js	(original)
+++ branches/bxe_2_0/js/table.js	Fri Dec 16 18:12:29 2005
@@ -141,7 +141,7 @@
 
     var first = bxe_splitAtSelection(this);	
 	var colspan = parseInt(first.getAttribute("colspan"));
-	if (colspan > 2) {
+	if (colspan > 1) {
 		first.setAttribute("colspan", colspan-1);
 	} else {
 		first.removeAttribute("colspan");
@@ -151,7 +151,7 @@
 		nextSibling = nextSibling.nextSibling;
 	}
 	if (nextSibling) {
-		nextSibling.removeAttribute("colspan");
+		nextSibling.setAttribute("colspan","1");
 	}
 	return first.parentNode.parentNode;
 }
@@ -171,7 +171,7 @@
 	var first = bxe_splitAtSelection(this);	
 	
 	var rowspan = bxe_table_getSpanCount(first.getAttribute("rowspan"));
-	if (rowspan > 2) {
+	if (rowspan > 1) {
 		first.setAttribute("rowspan", rowspan-1);
 	} else {
 		first.removeAttribute("rowspan");
@@ -184,7 +184,7 @@
 		nextSibling = nextSibling.nextSibling;
 	}
 	if (nextSibling) {
-		nextSibling.removeAttribute("rowspan");
+		nextSibling.setAttribute("rowspan","1");
 	}
 	var cell = matrix[rowPos + rowspan - 1][colPos + 1];
 	if (cell) {
@@ -343,18 +343,13 @@
 		{
 			tre.appendChild(document.createTextNode("  "));
 			var tde = tre.createNewTableCell();
-			//FIXME hardcoded stuff, should be taken from relaxng
-			/*tde.setAttribute("valign","top");
-			tde.setAttribute("align","left");
-			tde.setAttribute("colspan","1");
-			tde.setAttribute("rowspan","1");
-			tde.appendChild(document.createTextNode(STRING_NBSP)); // POST05: CHANGE TO BR TOKEN
-			*/
 			tre.appendChild(tde);
 			tre.appendChild(document.createTextNode("\n"));
 		}
 		te.appendChild(document.createTextNode("\n"));
 	}
+	te.XMLNode.isNodeValid(true,2,true);
+			
 	return te;
 }
 
@@ -1008,6 +1003,7 @@
 			}
 		}
 	}
+	table.XMLNode.isNodeValid(true,2,true);
 	bxe_history_snapshot_async()
 	return table;
 }
@@ -1131,14 +1127,16 @@
 		}
 	}
 	
-	newCell.setAttribute("align", "left");
+	/*newCell.setAttribute("align", "left");
 	newCell.setAttribute("valign", "top");
 	newCell.setAttribute("colspan", "1");
-	newCell.setAttribute("rowspan", "1");
+	newCell.setAttribute("rowspan", "1");*/
 	//BX_node_insertID(newCell);
 	var textNode = bxe_config.doc.createTextNode("#");
 	newCell.appendChild(textNode);
 	
+			
+	
 	return newCell;
 }
 
-- 
Bx-editor-cvs mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-cvs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.