tinyMCEPopup.restoreSelection();\r
\r
if (!AutoValidator.validate(formObj)) {\r
- alert(inst.getLang('invalid_data'));\r
+ tinyMCEPopup.alert(inst.getLang('invalid_data'));\r
return false;\r
}\r
\r
\r
// Validate table size\r
if (colLimit && cols > colLimit) {\r
- inst.windowManager.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.col_limit').replace(/\{\$cols\}/g, colLimit));\r
return false;\r
} else if (rowLimit && rows > rowLimit) {\r
- inst.windowManager.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.row_limit').replace(/\{\$rows\}/g, rowLimit));\r
return false;\r
} else if (cellLimit && cols * rows > cellLimit) {\r
- inst.windowManager.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
+ tinyMCEPopup.alert(inst.getLang('table_dlg.cell_limit').replace(/\{\$cells\}/g, cellLimit));\r
return false;\r
}\r
\r
elm.insertBefore(capEl, elm.firstChild);\r
}\r
\r
- if (width && /(pt|em|cm)$/.test(width)) {\r
+ if (width && inst.settings.inline_styles) {\r
dom.setStyle(elm, 'width', width);\r
dom.setAttrib(elm, 'width', '');\r
} else {\r
dom.setAttrib(elm, 'bgColor', '');\r
dom.setAttrib(elm, 'background', '');\r
\r
- if (height) {\r
+ if (height && inst.settings.inline_styles) {\r
dom.setStyle(elm, 'height', height);\r
dom.setAttrib(elm, 'height', '');\r
- }\r
+ } else {\r
+ dom.setAttrib(elm, 'height', height, true);\r
+ dom.setStyle(elm, 'height', '');\r
+ }\r
\r
if (background != '')\r
elm.style.backgroundImage = "url('" + background + "')";\r
html += makeAttrib('cellpadding', cellpadding);\r
html += makeAttrib('cellspacing', cellspacing);\r
\r
- if (width && /(pt|em|cm)$/.test(width)) {\r
+ if (width && inst.settings.inline_styles) {\r
if (style)\r
style += '; ';\r
\r
+ // Force px\r
+ if (/[0-9\.]+/.test(width))\r
+ width += 'px';\r
+\r
style += 'width: ' + width;\r
} else\r
html += makeAttrib('width', width);\r
html += "</table>";\r
\r
inst.execCommand('mceBeginUndoLevel');\r
- inst.execCommand('mceInsertContent', false, html);\r
+\r
+ // Move table\r
+ if (inst.settings.fix_table_elements) {\r
+ var bm = inst.selection.getBookmark(), patt = '';\r
+\r
+ inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />');\r
+\r
+ tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) {\r
+ if (patt)\r
+ patt += ',';\r
+\r
+ patt += n + ' ._mce_marker';\r
+ });\r
+\r
+ tinymce.each(inst.dom.select(patt), function(n) {\r
+ inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n);\r
+ });\r
+\r
+ dom.setOuterHTML(dom.select('._mce_marker')[0], html);\r
+\r
+ inst.selection.moveToBookmark(bm);\r
+ } else\r
+ inst.execCommand('mceInsertContent', false, html);\r
+\r
inst.addVisual();\r
inst.execCommand('mceEndUndoLevel');\r
\r