diff media/js/tiny_mce/plugins/table/editor_plugin_src.js @ 247:6ed2932901fa

Update tinymce to 3.3.9
author Brian Neal <bgneal@gmail.com>
date Sat, 18 Sep 2010 19:54:11 +0000
parents 237710206167
children
line wrap: on
line diff
--- a/media/js/tiny_mce/plugins/table/editor_plugin_src.js	Sat Sep 18 19:39:16 2010 +0000
+++ b/media/js/tiny_mce/plugins/table/editor_plugin_src.js	Sat Sep 18 19:54:11 2010 +0000
@@ -11,6 +11,20 @@
 (function(tinymce) {
 	var each = tinymce.each;
 
+	// Checks if the selection/caret is at the start of the specified block element
+	function isAtStart(rng, par) {
+		var doc = par.ownerDocument, rng2 = doc.createRange(), elm;
+
+		rng2.setStartBefore(par);
+		rng2.setEnd(rng.endContainer, rng.endOffset);
+
+		elm = doc.createElement('body');
+		elm.appendChild(rng2.cloneContents());
+
+		// Check for text characters of other elements that should be treated as content
+		return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length == 0;
+	};
+
 	/**
 	 * Table Grid class.
 	 */
@@ -38,12 +52,12 @@
 			grid = [];
 
 			each(['thead', 'tbody', 'tfoot'], function(part) {
-				var rows = dom.select(part + ' tr', table);
+				var rows = dom.select('> ' + part + ' tr', table);
 
 				each(rows, function(tr, y) {
 					y += startY;
 
-					each(dom.select('td,th', tr), function(td, x) {
+					each(dom.select('> td, > th', tr), function(td, x) {
 						var x2, y2, rowspan, colspan;
 
 						// Skip over existing cells produced by rowspan