summaryrefslogtreecommitdiff
path: root/program/js/tiny_mce/plugins/table/js/table.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2010-03-19 14:53:30 +0000
committeralecpl <alec@alec.pl>2010-03-19 14:53:30 +0000
commit69d05c371029b7915cf2a87d6e552d9853244644 (patch)
tree689e3a2cf571e8fc0912bd87284b7acc8e47b91d /program/js/tiny_mce/plugins/table/js/table.js
parent258a043a31ff002d83097e45b4504e59e6559d1d (diff)
- TinyMCE 3.3.1
Diffstat (limited to 'program/js/tiny_mce/plugins/table/js/table.js')
-rw-r--r--program/js/tiny_mce/plugins/table/js/table.js25
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 182589d69..f4b0862ef 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 @@ function insertTable() {
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 @@ function insertTable() {
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 @@ function insertTable() {
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 @@ function insertTable() {
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 @@ function insertTable() {
// 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 @@ function insertTable() {
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');