22 cols = formObj.elements['cols'].value; |
22 cols = formObj.elements['cols'].value; |
23 rows = formObj.elements['rows'].value; |
23 rows = formObj.elements['rows'].value; |
24 border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; |
24 border = formObj.elements['border'].value != "" ? formObj.elements['border'].value : 0; |
25 cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; |
25 cellpadding = formObj.elements['cellpadding'].value != "" ? formObj.elements['cellpadding'].value : ""; |
26 cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; |
26 cellspacing = formObj.elements['cellspacing'].value != "" ? formObj.elements['cellspacing'].value : ""; |
27 align = formObj.elements['align'].options[formObj.elements['align'].selectedIndex].value; |
27 align = getSelectValue(formObj, "align"); |
28 frame = formObj.elements['frame'].options[formObj.elements['frame'].selectedIndex].value; |
28 frame = getSelectValue(formObj, "tframe"); |
29 rules = formObj.elements['rules'].options[formObj.elements['rules'].selectedIndex].value; |
29 rules = getSelectValue(formObj, "rules"); |
30 width = formObj.elements['width'].value; |
30 width = formObj.elements['width'].value; |
31 height = formObj.elements['height'].value; |
31 height = formObj.elements['height'].value; |
32 bordercolor = formObj.elements['bordercolor'].value; |
32 bordercolor = formObj.elements['bordercolor'].value; |
33 bgcolor = formObj.elements['bgcolor'].value; |
33 bgcolor = formObj.elements['bgcolor'].value; |
34 className = formObj.elements['class'].options[formObj.elements['class'].selectedIndex].value; |
34 className = getSelectValue(formObj, "class"); |
35 id = formObj.elements['id'].value; |
35 id = formObj.elements['id'].value; |
36 summary = formObj.elements['summary'].value; |
36 summary = formObj.elements['summary'].value; |
37 style = formObj.elements['style'].value; |
37 style = formObj.elements['style'].value; |
38 dir = formObj.elements['dir'].value; |
38 dir = formObj.elements['dir'].value; |
39 lang = formObj.elements['lang'].value; |
39 lang = formObj.elements['lang'].value; |
201 } |
205 } |
202 |
206 |
203 html += "</table>"; |
207 html += "</table>"; |
204 |
208 |
205 inst.execCommand('mceBeginUndoLevel'); |
209 inst.execCommand('mceBeginUndoLevel'); |
206 inst.execCommand('mceInsertContent', false, html); |
210 |
|
211 // Move table |
|
212 if (inst.settings.fix_table_elements) { |
|
213 var bm = inst.selection.getBookmark(), patt = ''; |
|
214 |
|
215 inst.execCommand('mceInsertContent', false, '<br class="_mce_marker" />'); |
|
216 |
|
217 tinymce.each('h1,h2,h3,h4,h5,h6,p'.split(','), function(n) { |
|
218 if (patt) |
|
219 patt += ','; |
|
220 |
|
221 patt += n + ' ._mce_marker'; |
|
222 }); |
|
223 |
|
224 tinymce.each(inst.dom.select(patt), function(n) { |
|
225 inst.dom.split(inst.dom.getParent(n, 'h1,h2,h3,h4,h5,h6,p'), n); |
|
226 }); |
|
227 |
|
228 dom.setOuterHTML(dom.select('._mce_marker')[0], html); |
|
229 |
|
230 inst.selection.moveToBookmark(bm); |
|
231 } else |
|
232 inst.execCommand('mceInsertContent', false, html); |
|
233 |
207 inst.addVisual(); |
234 inst.addVisual(); |
208 inst.execCommand('mceEndUndoLevel'); |
235 inst.execCommand('mceEndUndoLevel'); |
209 |
236 |
210 tinyMCEPopup.close(); |
237 tinyMCEPopup.close(); |
211 } |
238 } |
293 addClassesToList('class', "table_styles"); |
320 addClassesToList('class', "table_styles"); |
294 TinyMCE_EditableSelects.init(); |
321 TinyMCE_EditableSelects.init(); |
295 |
322 |
296 // Update form |
323 // Update form |
297 selectByValue(formObj, 'align', align); |
324 selectByValue(formObj, 'align', align); |
298 selectByValue(formObj, 'frame', frame); |
325 selectByValue(formObj, 'tframe', frame); |
299 selectByValue(formObj, 'rules', rules); |
326 selectByValue(formObj, 'rules', rules); |
300 selectByValue(formObj, 'class', className, true, true); |
327 selectByValue(formObj, 'class', className, true, true); |
301 formObj.cols.value = cols; |
328 formObj.cols.value = cols; |
302 formObj.rows.value = rows; |
329 formObj.rows.value = rows; |
303 formObj.border.value = border; |
330 formObj.border.value = border; |