Fixed bug #13674: htmlArea RTE: Incorrect position of cursor after SHIFT-ENTER in...
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Apr 2010 22:12:58 +0000 (22:12 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Apr 2010 22:12:58 +0000 (22:12 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7314 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js

index a4dcf73..1655bef 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 2010-04-12  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #13116: htmlArea RTE: Allow to hide counting classes
+       * Fixed bug #13674: htmlArea RTE: Incorrect position of cursor after SHIFT-ENTER in WebKit browser
 
 2010-04-12  Susanne Moog  <typo3@susanne-moog.de>
 
index 429be3b..2d0a774 100644 (file)
@@ -1,6 +1,7 @@
 2010-04-12  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Added feature #13116: htmlArea RTE: Allow to hide counting classes
+       * Fixed bug #13674: htmlArea RTE: Incorrect position of cursor after SHIFT-ENTER in WebKit browser
 
 2010-04-11  Stanislas Rolland  <typo3@sjbr.ca>
 
index cf87453..f416d0a 100644 (file)
@@ -1175,7 +1175,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                        event.stopEvent();
                        return false;
                }
-                       // onKeyPress deprecated as of TYPO3 4.4
+               /*****************************************************
+                * onKeyPress DEPRECATED AS OF TYPO3 4.4             *
+                *****************************************************/
                if (this.getEditor().hasPluginWithOnKeyPressHandler) {
                        var letBubble = true;
                        Ext.iterate(this.getEditor().plugins, function (pluginId) {
@@ -1194,7 +1196,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                }
                if (!event.altKey && !event.ctrlKey) {
                                // Detect URL in non-IE browsers
-                       if (!Ext.isIE && (event.getKey() != Ext.EventObject.ENTER || event.shiftKey)) {
+                       if (!Ext.isIE && (event.getKey() != Ext.EventObject.ENTER || (event.shiftKey && !Ext.isWebKit))) {
                                this.getEditor()._detectURL(event);
                        }
                                // Handle option+SPACE for Mac users
@@ -1262,10 +1264,8 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         */
        onEnter: function (key, event) {
                this.getEditor()._detectURL(event);
-               if (!event.shiftKey) {
-                       if (this.getEditor()._checkInsertP()) {
-                               event.stopEvent();
-                       }
+               if (this.getEditor()._checkInsertP()) {
+                       event.stopEvent();
                }
                        // Update the toolbar state after some time
                this.getToolbar().updateLater.delay(200);
@@ -1276,14 +1276,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         */
        onWebKitEnter: function (key, event) {
                if (event.shiftKey || this.config.disableEnterParagraphs) {
-                       var brNode = this.document.createElement('br');
-                       this.getEditor().insertNodeAtSelection(brNode);
-                       if (!brNode.nextSibling || !HTMLArea.getInnerText(brNode.nextSibling)) {
-                               var secondBrNode = this.document.createElement('br');
-                               secondBrNode = brNode.parentNode.appendChild(secondBrNode);
-                               this.getEditor().selectNode(secondBrNode, false);
-                       }
-                       event.stopEvent();
+                       this.getEditor()._detectURL(event);
                }
                        // Update the toolbar state after some time
                this.getToolbar().updateLater.delay(200);