Commit eb65b57f authored by Brett Bieber's avatar Brett Bieber
Browse files

Merge branch 'master' of /home/git/repositories/nbarry10/TinyMCE

parents 76947c49 fa97b62a
......@@ -2,4 +2,6 @@ UNL Modifications to Core (Marked with "Start UNL Change"):
----------------
Both image.js files (in plugins/advimage/js and themes/advanced/js) have been modified to not autofill image width and height.
Table plugin (plugins/table/js/row.js and plugins/table/js/cell.js) have been modified to use CSS styles instead on deprecated attributes
----------------
......@@ -18,7 +18,13 @@ function init() {
// Get table cell data
var celltype = tdElm.nodeName.toLowerCase();
var align = ed.dom.getAttrib(tdElm, 'align');
if (getStyle(tdElm, 'text-align', 'text-align') != "") {
align = getStyle(tdElm, 'text-align', 'text-align');
}
var valign = ed.dom.getAttrib(tdElm, 'valign');
if (getStyle(tdElm, 'vertical-align', 'vertical-align') != "") {
valign = getStyle(tdElm, 'vertical-align', 'vertical-align');
}
var width = trimSize(getStyle(tdElm, 'width', 'width'));
var height = trimSize(getStyle(tdElm, 'height', 'height'));
var bordercolor = convertRGBToHex(getStyle(tdElm, 'bordercolor', 'borderLeftColor'));
......@@ -201,8 +207,8 @@ function updateCell(td, skip_id) {
if (!skip_id)
dom.setAttrib(td, 'id', formObj.id.value);
dom.setAttrib(td, 'align', formObj.align.value);
dom.setAttrib(td, 'vAlign', formObj.valign.value);
// dom.setAttrib(td, 'align', formObj.align.value);
// dom.setAttrib(td, 'vAlign', formObj.valign.value);
dom.setAttrib(td, 'lang', formObj.lang.value);
dom.setAttrib(td, 'dir', getSelectValue(formObj, 'dir'));
dom.setAttrib(td, 'style', ed.dom.serializeStyle(ed.dom.parseStyle(formObj.style.value)));
......@@ -215,10 +221,25 @@ function updateCell(td, skip_id) {
ed.dom.setAttrib(td, 'bgColor', '');
ed.dom.setAttrib(td, 'borderColor', '');
ed.dom.setAttrib(td, 'background', '');
ed.dom.setAttrib(td, 'align', '');
ed.dom.setAttrib(td, 'vAlign', '');
// Set styles
td.style.width = getCSSSize(formObj.width.value);
td.style.height = getCSSSize(formObj.height.value);
if (formObj.align.value != "") {
td.style.textAlign = formObj.align.value;
} else {
td.style.textAlign = '';
}
if (formObj.valign.value != "") {
td.style.verticalAlign = formObj.valign.value;
} else {
td.style.verticalAlign = '';
}
if (formObj.bordercolor.value != "") {
td.style.borderColor = formObj.bordercolor.value;
td.style.borderStyle = td.style.borderStyle == "" ? "solid" : td.style.borderStyle;
......
......@@ -15,7 +15,13 @@ function init() {
// Get table row data
var rowtype = trElm.parentNode.nodeName.toLowerCase();
var align = dom.getAttrib(trElm, 'align');
if (getStyle(trElm, 'text-align', 'text-align') != "") {
align = getStyle(trElm, 'text-align', 'text-align');
}
var valign = dom.getAttrib(trElm, 'valign');
if (getStyle(trElm, 'vertical-align', 'vertical-align') != "") {
valign = getStyle(trElm, 'vertical-align', 'vertical-align');
}
var height = trimSize(getStyle(trElm, 'height', 'height'));
var className = dom.getAttrib(trElm, 'class');
var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
......@@ -129,8 +135,8 @@ function updateRow(tr_elm, skip_id, skip_parent) {
if (!skip_id)
dom.setAttrib(tr_elm, 'id', formObj.id.value);
dom.setAttrib(tr_elm, 'align', getSelectValue(formObj, 'align'));
dom.setAttrib(tr_elm, 'vAlign', getSelectValue(formObj, 'valign'));
// dom.setAttrib(tr_elm, 'align', getSelectValue(formObj, 'align'));
// dom.setAttrib(tr_elm, 'vAlign', getSelectValue(formObj, 'valign'));
dom.setAttrib(tr_elm, 'lang', formObj.lang.value);
dom.setAttrib(tr_elm, 'dir', getSelectValue(formObj, 'dir'));
dom.setAttrib(tr_elm, 'style', dom.serializeStyle(dom.parseStyle(formObj.style.value)));
......@@ -140,10 +146,24 @@ function updateRow(tr_elm, skip_id, skip_parent) {
dom.setAttrib(tr_elm, 'background', '');
dom.setAttrib(tr_elm, 'bgColor', '');
dom.setAttrib(tr_elm, 'height', '');
dom.setAttrib(tr_elm, 'align', '');
dom.setAttrib(tr_elm, 'vAlign', '');
// Set styles
tr_elm.style.height = getCSSSize(formObj.height.value);
tr_elm.style.backgroundColor = formObj.bgcolor.value;
if (formObj.align.value != "") {
tr_elm.style.textAlign = formObj.align.value;
} else {
tr_elm.style.textAlign = '';
}
if (formObj.valign.value != "") {
tr_elm.style.verticalAlign = formObj.valign.value;
} else {
tr_elm.style.verticalAlign = '';
}
if (formObj.backgroundimage.value != "")
tr_elm.style.backgroundImage = "url('" + formObj.backgroundimage.value + "')";
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment