Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

3.4.7 plone #10

Open
wants to merge 4 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 15, 2012
  1. @joka
  2. @joka

    updated doc

    joka authored
  3. @joka
  4. @joka

    updated doc

    joka authored
This page is out of date. Refresh to see the latest.
View
6 changelog_plone.txt
@@ -5,5 +5,11 @@ HISTORY
3.4.3-plone
-----------
+- More stable more stable form_utils
+ [joka]
+
+- More stable table plugin; IE9 fixes
+ [joka]
+
- Fix transparent line appearing in popups near the title
[iElectric]
View
44 jscripts/tiny_mce/plugins/table/js/cell.js
@@ -16,6 +16,8 @@ function init() {
var st = ed.dom.parseStyle(ed.dom.getAttrib(tdElm, "style"));
// Get table cell data
+ var celltype = tdElm.nodeName.toLowerCase();
+ var align = ed.dom.getAttrib(tdElm, 'align');
var valign = ed.dom.getAttrib(tdElm, 'valign');
var width = trimSize(getStyle(tdElm, 'width', 'width'));
var height = trimSize(getStyle(tdElm, 'height', 'height'));
@@ -29,6 +31,7 @@ function init() {
var scope = ed.dom.getAttrib(tdElm, 'scope');
// Setup form
+ addClassesToList('class', 'table_cell_styles');
TinyMCE_EditableSelects.init();
if (!ed.dom.hasClass(tdElm, 'mceSelected')) {
@@ -60,7 +63,7 @@ function init() {
function updateAction() {
var el, inst = ed, tdElm, trElm, tableElm, formObj = document.forms[0];
- if (!AutoValidator.validate(formObj)) {
+ if ( ((typeof AutoValidator)!=='undefined') && !AutoValidator.validate(formObj)) {
tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
return false;
}
@@ -87,8 +90,29 @@ function updateAction() {
switch (getSelectValue(formObj, 'action')) {
case "cell":
+ var celltype = getSelectValue(formObj, 'celltype');
var scope = getSelectValue(formObj, 'scope');
+ function doUpdate(s) {
+ if (s) {
+ updateCell(tdElm);
+
+ ed.addVisual();
+ ed.nodeChanged();
+ inst.execCommand('mceEndUndoLevel');
+ tinyMCEPopup.close();
+ }
+ };
+
+ if (ed.getParam("accessibility_warnings", 1)) {
+ if (celltype == "th" && scope == "")
+ tinyMCEPopup.confirm(ed.getLang('table_dlg.missing_scope', '', true), doUpdate);
+ else
+ doUpdate(1);
+
+ return;
+ }
+
updateCell(tdElm);
break;
@@ -169,13 +193,15 @@ function nextCell(elm) {
function updateCell(td, skip_id) {
var inst = ed;
var formObj = document.forms[0];
+ var curCellType = td.nodeName.toLowerCase();
+ var celltype = String(getSelectValue(formObj, 'celltype'));
var doc = inst.getDoc();
var dom = ed.dom;
if (!skip_id)
dom.setAttrib(td, 'id', formObj.id.value);
- dom.setAttrib(td, 'align', formObj.align.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'));
@@ -207,6 +233,20 @@ function updateCell(td, skip_id) {
else
td.style.backgroundImage = '';
+ if (curCellType != celltype && celltype!="") {
+ // changing to a different node type
+ var newCell = doc.createElement(celltype);
+
+ for (var c=0; c<td.childNodes.length; c++)
+ newCell.appendChild(td.childNodes[c].cloneNode(1));
+
+ for (var a=0; a<td.attributes.length; a++)
+ ed.dom.setAttrib(newCell, td.attributes[a].name, ed.dom.getAttrib(td, td.attributes[a].name));
+
+ td.parentNode.replaceChild(newCell, td);
+ td = newCell;
+ }
+
dom.setAttrib(td, 'style', dom.serializeStyle(dom.parseStyle(td.style.cssText)));
return td;
View
4 jscripts/tiny_mce/plugins/table/js/row.js
@@ -14,8 +14,10 @@ function init() {
// Get table row data
var rowtype = trElm.parentNode.nodeName.toLowerCase();
+ var align = dom.getAttrib(trElm, 'align');
var valign = dom.getAttrib(trElm, 'valign');
var height = trimSize(getStyle(trElm, 'height', 'height'));
+ var className = dom.getAttrib(trElm, 'class');
var bgcolor = convertRGBToHex(getStyle(trElm, 'bgcolor', 'backgroundColor'));
var backgroundimage = getStyle(trElm, 'background', 'backgroundImage').replace(new RegExp("url\\(['\"]?([^'\"]*)['\"]?\\)", 'gi'), "$1");
var id = dom.getAttrib(trElm, 'id');
@@ -54,7 +56,7 @@ function updateAction() {
var inst = tinyMCEPopup.editor, dom = inst.dom, trElm, tableElm, formObj = document.forms[0];
var action = getSelectValue(formObj, 'action');
- if (!AutoValidator.validate(formObj)) {
+ if ( ((typeof AutoValidator)!=='undefined') && !AutoValidator.validate(formObj)) {
tinyMCEPopup.alert(AutoValidator.getErrorMessages(formObj).join('. ') + '.');
return false;
}
View
21 jscripts/tiny_mce/plugins/table/js/table.js
@@ -78,7 +78,7 @@ function insertTable() {
}
dom.setAttrib(elm, 'align', align);
- dom.setAttrib(elm, 'tframe', frame);
+ dom.setAttrib(elm, 'frame', frame);
dom.setAttrib(elm, 'rules', rules);
dom.setAttrib(elm, 'class', className);
dom.setAttrib(elm, 'style', style);
@@ -247,8 +247,12 @@ function insertTable() {
inst.execCommand('mceInsertContent', false, html);
tinymce.each(dom.select('table[data-mce-new]'), function(node) {
- var tdorth = dom.select('td,th', node);
+ // Fixes a bug in IE where the caret cannot be placed after the table if the table is at the end of the document
+ if (tinymce.isIE && node.nextSibling == null) {
+ dom.insertAfter(dom.create('p'), node);
+ }
+ var tdorth = dom.select('td,th', node);
try {
// IE9 might fail to do this selection
inst.selection.setCursorLocation(tdorth[0], 0);
@@ -303,6 +307,15 @@ function init() {
var formObj = document.forms[0];
var elm = dom.getParent(inst.selection.getNode(), "table");
+ /*
+ * hide class selection
+ */
+ var classElement = dom.select('#general_panel>div:first', formObj);
+ if (classElement!=null && classElement!=undefined && classElement.length>0) {
+ dom.hide(classElement);
+ }
+
+
action = tinyMCEPopup.getWindowArg('action');
if (!action)
@@ -350,7 +363,7 @@ function init() {
// Update form
selectByValue(formObj, 'align', align);
- selectByValue(formObj, 'frame', frame);
+ selectByValue(formObj, 'tframe', frame);
selectByValue(formObj, 'rules', rules);
selectByValue(formObj, 'class', className, true, true);
formObj.cols.value = cols;
@@ -438,6 +451,8 @@ function changedBorder() {
st['border-width'] = '';
}
}
+
+ formObj.style.value = dom.serializeStyle(st);
}
function changedColor() {
View
33 jscripts/tiny_mce/utils/form_utils.js
@@ -115,34 +115,35 @@ function addSelectValue(form_obj, field_name, name, value) {
function addClassesToList(list_id, specific_option) {
// Setup class droplist
var styleSelectElm = document.getElementById(list_id);
- var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
- styles = tinyMCEPopup.getParam(specific_option, styles);
+ if (styleSelectElm!=null) {
+ var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
+ styles = tinyMCEPopup.getParam(specific_option, styles);
- if (styles) {
- var stylesAr = styles.split(';');
+ if (styles) {
+ var stylesAr = styles.split(';');
- for (var i=0; i<stylesAr.length; i++) {
- if (stylesAr != "") {
- var key, value;
+ for (var i=0; i<stylesAr.length; i++) {
+ if (stylesAr != "") {
+ var key, value;
- key = stylesAr[i].split('=')[0];
- value = stylesAr[i].split('=')[1];
+ key = stylesAr[i].split('=')[0];
+ value = stylesAr[i].split('=')[1];
- styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+ styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+ }
}
+ } else {
+ tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
+ styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
+ });
}
- } else {
- tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
- styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
- });
}
}
function isVisible(element_id) {
var elm = document.getElementById(element_id);
- // elm.style.display can be an empty string if the panel is hidden and has never been shown
- return elm && (elm.style.display == "block" || elm.style.display == "inline" || elm.style.display == "list-element");
+ return elm && elm.style.display != "none";
}
function convertRGBToHex(col) {
Something went wrong with that request. Please try again.