Index: openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/table-operations.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/table-operations.js,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/table-operations.js 2 Nov 2005 08:56:29 -0000 1.1 +++ openacs-4/packages/acs-templating/www/resources/xinha-nightly/plugins/TableOperations/table-operations.js 11 Nov 2005 20:32:48 -0000 1.2 @@ -42,7 +42,7 @@ // add a new line in the toolbar cfg.toolbar.push(toolbar); -}; +} TableOperations._pluginInfo = { name : "TableOperations", @@ -168,7 +168,7 @@ function selected(val) { return val ? " selected" : ""; - }; + } // dialog contents dialog.content.style.width = "400px"; @@ -321,7 +321,7 @@ function selected(val) { return val ? " selected" : ""; - }; + } // dialog contents dialog.content.style.width = "400px"; @@ -391,7 +391,7 @@ td.rowSpan = 1; td.innerHTML = mozbr; } - }; + } function splitRow(td) { var n = parseInt("" + td.rowSpan); @@ -410,7 +410,7 @@ } editor.forceRedraw(); editor.updateToolbar(); - }; + } function splitCol(td) { var nc = parseInt("" + td.colSpan); @@ -425,7 +425,7 @@ } editor.forceRedraw(); editor.updateToolbar(); - }; + } function splitCell(td) { var nc = parseInt("" + td.colSpan); @@ -435,7 +435,7 @@ while (nc-- > 0) { splitRow(items[index++]); } - }; + } function selectNextNode(el) { var node = el.nextSibling; @@ -452,7 +452,7 @@ node = el.parentNode; } editor.selectNodeContents(node); - }; + } switch (button_id) { // ROWS @@ -505,18 +505,20 @@ } var rows = td.parentNode.parentNode.rows; var index = td.cellIndex; + var lastColumn = (td.parentNode.cells.length == index + 1); for (var i = rows.length; --i >= 0;) { - /* - var tr = rows; - var otd = tr.insertCell(index + (/after/.test(button_id) ? 1 : 0)); - otd.innerHTML = mozbr; - */ - var tr = rows[i]; - var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)]; + var tr = rows[i]; var otd = editor._doc.createElement("td"); otd.innerHTML = mozbr; - tr.insertBefore(otd, ref); - + if (lastColumn && HTMLArea.is_ie) + { + tr.insertBefore(otd); + } + else + { + var ref = tr.cells[index + (/after/.test(button_id) ? 1 : 0)]; + tr.insertBefore(otd, ref); + } } editor.focusEditor(); break; @@ -956,7 +958,7 @@ input.focus(); input.select(); } - }; + } select.onchange = function() { setCharVisibility(this.value == "char"); }; setCharVisibility(select.value == "char"); @@ -1106,7 +1108,7 @@ el.select(); } } - }; + } select.onchange = function() { setBorderFieldsStatus(this.value == "none"); }; input = doc.createElement("input"); @@ -1175,4 +1177,4 @@ return fieldset; }; -//// END GENERIC CODE ------------------------------------------------------- +//// END GENERIC CODE ------------------------------------------------------- \ No newline at end of file