From 87e2fddb32da8580f73c5ec0628e9eacfb4e0043 Mon Sep 17 00:00:00 2001 From: svncommit Date: Mon, 26 Feb 2007 07:19:44 +0000 Subject: upgrade to TinyMCE v2.1.0 --- program/js/tiny_mce/plugins/table/jscripts/table.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'program/js/tiny_mce/plugins/table/jscripts') diff --git a/program/js/tiny_mce/plugins/table/jscripts/table.js b/program/js/tiny_mce/plugins/table/jscripts/table.js index 6904ed0f7..4a0ee3b47 100644 --- a/program/js/tiny_mce/plugins/table/jscripts/table.js +++ b/program/js/tiny_mce/plugins/table/jscripts/table.js @@ -3,8 +3,8 @@ var action, orgTableWidth, orgTableHeight; function insertTable() { var formObj = document.forms[0]; var inst = tinyMCE.selectedInstance; - var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className; - var html = ''; + var cols = 2, rows = 2, border = 0, cellpadding = -1, cellspacing = -1, align, width, height, className, caption; + var html = '', capEl; var elm = tinyMCE.tableElm; var cellLimit, rowLimit, colLimit; @@ -33,6 +33,7 @@ function insertTable() { dir = formObj.elements['dir'].value; lang = formObj.elements['lang'].value; background = formObj.elements['backgroundimage'].value; + caption = formObj.elements['caption'].checked; cellLimit = tinyMCE.getParam('table_cell_limit', false); rowLimit = tinyMCE.getParam('table_row_limit', false); @@ -65,6 +66,17 @@ function insertTable() { tinyMCE.setAttrib(elm, 'dir', dir); tinyMCE.setAttrib(elm, 'lang', lang); + capEl = elm.getElementsByTagName('caption')[0]; + + if (capEl && !caption) + capEl.parentNode.removeChild(capEl); + + if (!capEl && caption) { + capEl = elm.ownerDocument.createElement('caption'); + capEl.innerHTML = ' '; + elm.insertBefore(capEl, elm.firstChild); + } + // Not inline styles if (!tinyMCE.getParam("inline_styles")) tinyMCE.setAttrib(elm, 'width', width, true); @@ -132,9 +144,11 @@ function insertTable() { html += makeAttrib('summary', summary); html += makeAttrib('dir', dir); html += makeAttrib('lang', lang); - html += '>'; + if (caption) + html += ' '; + for (var y=0; y 0; orgTableWidth = width; orgTableHeight = height; -- cgit v1.2.3