From 69d05c371029b7915cf2a87d6e552d9853244644 Mon Sep 17 00:00:00 2001 From: alecpl <alec@alec.pl> Date: Fri, 19 Mar 2010 10:53:30 -0400 Subject: [PATCH] - TinyMCE 3.3.1 --- program/js/tiny_mce/plugins/table/js/table.js | 25 +++++++++++++++++-------- 1 files changed, 17 insertions(+), 8 deletions(-) diff --git a/program/js/tiny_mce/plugins/table/js/table.js b/program/js/tiny_mce/plugins/table/js/table.js index 182589d..f4b0862 100644 --- a/program/js/tiny_mce/plugins/table/js/table.js +++ b/program/js/tiny_mce/plugins/table/js/table.js @@ -82,7 +82,7 @@ capEl = elm.ownerDocument.createElement('caption'); if (!tinymce.isIE) - capEl.innerHTML = '<br mce_bogus="1"/>'; + capEl.innerHTML = '<br _mce_bogus="1"/>'; elm.insertBefore(capEl, elm.firstChild); } @@ -151,6 +151,7 @@ html += makeAttrib('border', border); html += makeAttrib('cellpadding', cellpadding); html += makeAttrib('cellspacing', cellspacing); + html += makeAttrib('_mce_new', '1'); if (width && inst.settings.inline_styles) { if (style) @@ -186,7 +187,7 @@ if (caption) { if (!tinymce.isIE) - html += '<caption><br mce_bogus="1"/></caption>'; + html += '<caption><br _mce_bogus="1"/></caption>'; else html += '<caption></caption>'; } @@ -196,7 +197,7 @@ for (var x=0; x<cols; x++) { if (!tinymce.isIE) - html += '<td><br mce_bogus="1"/></td>'; + html += '<td><br _mce_bogus="1"/></td>'; else html += '<td></td>'; } @@ -210,9 +211,10 @@ // Move table if (inst.settings.fix_table_elements) { - var bm = inst.selection.getBookmark(), patt = ''; + var patt = ''; - inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />'); + inst.focus(); + inst.selection.setContent('<br class="_mce_marker" />'); tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { if (patt) @@ -225,12 +227,19 @@ inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); }); - dom.setOuterHTML(dom.select('._mce_marker')[0], html); - - inst.selection.moveToBookmark(bm); + dom.setOuterHTML(dom.select('br._mce_marker')[0], html); } else inst.execCommand('mceInsertContent', false, html); + tinymce.each(dom.select('table[_mce_new]'), function(node) { + var td = dom.select('td', node); + + inst.selection.select(td[0], true); + inst.selection.collapse(); + + dom.setAttrib(node, '_mce_new', ''); + }); + inst.addVisual(); inst.execCommand('mceEndUndoLevel'); -- Gitblit v1.9.1