Fixed bug #13004: htmlArea RTE: buttons.table.disableEnterParagraphs not honoured...
authorStanislas Rolland <typo3@sjbr.ca>
Thu, 10 Dec 2009 19:18:25 +0000 (19:18 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Thu, 10 Dec 2009 19:18:25 +0000 (19:18 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6649 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/plugins/TableOperations/table-operations.js

index 5ed59a3..958b6b5 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-10  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #13004: htmlArea RTE: buttons.table.disableEnterParagraphs not honoured in Opera
+
 2009-12-10  Dmitry Dulepov  <dmitry.dulepov@gmail.com>
 
        * Fixed bug #12959: cHashParams in index_phash is too small
index c7dc73a..25ad9c5 100644 (file)
@@ -1,3 +1,7 @@
+2009-12-10  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #13004: htmlArea RTE: buttons.table.disableEnterParagraphs not honoured in Opera
+
 2009-12-09  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #12682: Section links coming from RTE broken in FE
index 92f865d..fb6db76 100644 (file)
@@ -1839,10 +1839,10 @@ TableOperations = HTMLArea.Plugin.extend({
        
        /*
         * This function gets called by the main editor event handler when a key was pressed.
-        * It will process the enter key for IE when buttons.table.disableEnterParagraphs is set in the editor configuration
+        * It will process the enter key for IE and Opera when buttons.table.disableEnterParagraphs is set in the editor configuration
         */
        onKeyPress : function (ev) {
-               if (HTMLArea.is_ie && ev.keyCode == 13 && !ev.shiftKey && this.disableEnterParagraphs) {
+               if ((HTMLArea.is_ie || HTMLArea.is_opera) && ev.keyCode == 13 && !ev.shiftKey && this.disableEnterParagraphs) {
                        var selection = this.editor._getSelection();
                        var range = this.editor._createRange(selection);
                        var parentElement = this.editor.getParentElement(selection, range);
@@ -1850,7 +1850,13 @@ TableOperations = HTMLArea.Plugin.extend({
                                parentElement = parentElement.parentNode;
                        }
                        if (/^(td|th)$/i.test(parentElement.nodeName)) {
-                               range.pasteHTML("<br />");
+                               if (HTMLArea.is_ie) {
+                                       range.pasteHTML("<br />");
+                               } else {
+                                       var brNode = this.editor._doc.createElement("br");
+                                       this.editor.insertNodeAtSelection(brNode);
+                                       this.editor.selectNode(brNode, false);
+                               }
                                return false;
                        }
                }