From 4cd91acc35bd1923b9c2bfd5c377c0ac2e157d23 Mon Sep 17 00:00:00 2001 From: iionly Date: Tue, 19 Feb 2013 20:15:34 +0100 Subject: Tinymce plugin: update to version 3.5.8 of Tinymce editor --- .../jscripts/tiny_mce/plugins/table/js/table.js | 23 +++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/table/js/table.js') diff --git a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/table/js/table.js b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/table/js/table.js index b21eaa6e7..1db243b63 100644 --- a/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/table/js/table.js +++ b/mod/tinymce/vendor/tinymce/jscripts/tiny_mce/plugins/table/js/table.js @@ -144,7 +144,7 @@ function insertTable() { //elm.outerHTML = elm.outerHTML; inst.nodeChanged(); - inst.execCommand('mceEndUndoLevel'); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); // Repaint if dimensions changed if (formObj.width.value != orgTableWidth || formObj.height.value != orgTableHeight) @@ -242,8 +242,16 @@ function insertTable() { } else inst.execCommand('mceInsertContent', false, html); - tinymce.each(dom.select('table[data-mce-new]'), function(node) { + 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) { + if (inst.settings.forced_root_block) + dom.insertAfter(dom.create(inst.settings.forced_root_block), node); + else + dom.insertAfter(dom.create('br', {'data-mce-bogus': '1'}), node); + } try { // IE9 might fail to do this selection @@ -256,7 +264,7 @@ function insertTable() { }); inst.addVisual(); - inst.execCommand('mceEndUndoLevel'); + inst.execCommand('mceEndUndoLevel', false, {}, {skip_undo: true}); tinyMCEPopup.close(); } @@ -299,6 +307,15 @@ function init() { var formObj = document.forms[0]; var elm = dom.getParent(inst.selection.getNode(), "table"); + // Hide advanced fields that isn't available in the schema + tinymce.each("summary id rules dir style frame".split(" "), function(name) { + var tr = tinyMCEPopup.dom.getParent(name, "tr") || tinyMCEPopup.dom.getParent("t" + name, "tr"); + + if (tr && !tinyMCEPopup.editor.schema.isValid("table", name)) { + tr.style.display = 'none'; + } + }); + action = tinyMCEPopup.getWindowArg('action'); if (!action) -- cgit v1.2.3