diff options
author | svncommit <devs@roundcube.net> | 2007-02-26 07:19:44 +0000 |
---|---|---|
committer | svncommit <devs@roundcube.net> | 2007-02-26 07:19:44 +0000 |
commit | 87e2fddb32da8580f73c5ec0628e9eacfb4e0043 (patch) | |
tree | 33a5448f5e22896a0375ce418df5ba294076ebfa /program/js/tiny_mce/plugins/table/jscripts | |
parent | e17702395e1aa0fa54eea36817e1150c231d49eb (diff) |
upgrade to TinyMCE v2.1.0
Diffstat (limited to 'program/js/tiny_mce/plugins/table/jscripts')
-rw-r--r-- | program/js/tiny_mce/plugins/table/jscripts/table.js | 21 |
1 files changed, 18 insertions, 3 deletions
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 += '<caption> </caption>';
+
for (var y=0; y<rows; y++) {
html += "<tr>";
@@ -223,6 +237,7 @@ function init() { dir = tinyMCE.getAttrib(tinyMCE.tableElm, 'dir');
lang = tinyMCE.getAttrib(tinyMCE.tableElm, 'lang');
background = getStyle(elm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");
+ formObj.caption.checked = tinyMCE.tableElm.getElementsByTagName('caption').length > 0;
orgTableWidth = width;
orgTableHeight = height;
|