function init() { tinyMCEPopup.resizeToInnerSize(); document.getElementById('backgroundimagebrowsercontainer').innerHTML = getBrowserHTML('backgroundimagebrowser','backgroundimage','image','table'); document.getElementById('bordercolor_pickcontainer').innerHTML = getColorPickerHTML('bordercolor_pick','bordercolor'); document.getElementById('bgcolor_pickcontainer').innerHTML = getColorPickerHTML('bgcolor_pick','bgcolor') var inst = tinyMCE.selectedInstance; var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th"); var formObj = document.forms[0]; var st = tinyMCE.parseStyle(tinyMCE.getAttrib(tdElm, "style")); // Get table cell data var celltype = tdElm.nodeName.toLowerCase(); var align = tinyMCE.getAttrib(tdElm, 'align'); var valign = tinyMCE.getAttrib(tdElm, 'valign'); var width = trimSize(getStyle(tdElm, 'width', 'width')); var height = trimSize(getStyle(tdElm, 'height', 'height')); var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor')); var bgcolor = convertRGBToHex(getStyle(tdElm, 'bgcolor', 'backgroundColor')); var className = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(tdElm, 'class'), false); var backgroundimage = getStyle(tdElm, 'background', 'backgroundImage').replace(new RegExp("url\\('?([^']*)'?\\)", 'gi'), "$1");; var id = tinyMCE.getAttrib(tdElm, 'id'); var lang = tinyMCE.getAttrib(tdElm, 'lang'); var dir = tinyMCE.getAttrib(tdElm, 'dir'); var scope = tinyMCE.getAttrib(tdElm, 'scope'); // Setup form addClassesToList('class', 'table_cell_styles'); formObj.bordercolor.value = bordercolor; formObj.bgcolor.value = bgcolor; formObj.backgroundimage.value = backgroundimage; formObj.width.value = width; formObj.height.value = height; formObj.id.value = id; formObj.lang.value = lang; formObj.style.value = tinyMCE.serializeStyle(st); selectByValue(formObj, 'align', align); selectByValue(formObj, 'valign', valign); selectByValue(formObj, 'class', className); selectByValue(formObj, 'celltype', celltype); selectByValue(formObj, 'dir', dir); selectByValue(formObj, 'scope', scope); // Resize some elements if (isVisible('backgroundimagebrowser')) document.getElementById('backgroundimage').style.width = '180px'; updateColor('bordercolor_pick', 'bordercolor'); updateColor('bgcolor_pick', 'bgcolor'); } function updateAction() { tinyMCEPopup.restoreSelection(); var inst = tinyMCE.selectedInstance; var tdElm = tinyMCE.getParentElement(inst.getFocusElement(), "td,th"); var trElm = tinyMCE.getParentElement(inst.getFocusElement(), "tr"); var tableElm = tinyMCE.getParentElement(inst.getFocusElement(), "table"); var formObj = document.forms[0]; inst.execCommand('mceBeginUndoLevel'); switch (getSelectValue(formObj, 'action')) { case "cell": var celltype = getSelectValue(formObj, 'celltype'); var scope = getSelectValue(formObj, 'scope'); if (tinyMCE.getParam("accessibility_warnings")) { if (celltype == "th" && scope == "") var answer = confirm(tinyMCE.getLang('lang_table_missing_scope', '', true)); else var answer = true; if (!answer) return; } updateCell(tdElm); break; case "row": var cell = trElm.firstChild; if (cell.nodeName != "TD" && cell.nodeName != "TH") cell = nextCell(cell); do { cell = updateCell(cell, true); } while ((cell = nextCell(cell)) != null); break; case "all": var rows = tableElm.getElementsByTagName("tr"); for (var i=0; i