1
0
mirror of https://github.com/e107inc/e107.git synced 2025-10-11 21:15:09 +02:00

TinyMce upgrade and e107bbcode plugin work

This commit is contained in:
CaMer0n
2012-04-29 08:59:24 +00:00
parent 10712bef1b
commit 611e3ae7e2
90 changed files with 4592 additions and 3680 deletions

View File

@@ -63,6 +63,11 @@ function init() {
function updateAction() {
var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
if (!AutoValidator.validate(formObj)) {
tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
return false;
}
tinyMCEPopup.restoreSelection();
el = ed.selection.getStart();
tdElm = ed.dom.getParent(el, "td,th");
@@ -123,6 +128,36 @@ function updateAction() {
break;
case "col":
var curr, col = 0, cell = trElm.firstChild, rows = tableElm.getElementsByTagName("tr");
if (cell.nodeName != "TD" && cell.nodeName != "TH")
cell = nextCell(cell);
do {
if (cell == tdElm)
break;
col += cell.getAttribute("colspan");
} while ((cell = nextCell(cell)) != null);
for (var i=0; i<rows.length; i++) {
cell = rows[i].firstChild;
if (cell.nodeName != "TD" && cell.nodeName != "TH")
cell = nextCell(cell);
curr = 0;
do {
if (curr == col) {
cell = updateCell(cell, true);
break;
}
curr += cell.getAttribute("colspan");
} while ((cell = nextCell(cell)) != null);
}
break;
case "all":
var rows = tableElm.getElementsByTagName("tr");