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