Fixed bug #13619: htmlArea RTE: url not detected on enter
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 23 Feb 2010 00:45:47 +0000 (00:45 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 23 Feb 2010 00:45:47 +0000 (00:45 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@6978 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 337259a..c8a938f 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        * Added feature #13608: htmlArea RTE: Make height of the context menu configurable
        * Updated NEWS.txt as follow-up to #13580: htmlArea RTE: Extjize the RTE
        * Fixed bug #13618: htmlArea RTE: RTE iframe is sometimes collapsed
+       * Fixed bug #13619: htmlArea RTE: url not detected on enter
 
 2010-02-22  Dmitry Dulepov <dmitry.dulepov@gmail.com>
 
index ad79d12..33483b9 100644 (file)
@@ -2,6 +2,7 @@
 
        * Added feature #13608: htmlArea RTE: Make height of the context menu configurable
        * Fixed bug #13618: htmlArea RTE: RTE iframe is sometimes collapsed
+       * Fixed bug #13619: htmlArea RTE: url not detected on enter
 
 2010-02-21  Stanislas Rolland  <typo3@sjbr.ca>
 
index 5253037..9265b24 100644 (file)
@@ -645,9 +645,8 @@ HTMLArea.Editor.prototype._detectURL = function(event) {
                        var a = textNode.parentNode.insertBefore(tag, rightText);
                        HTMLArea.removeFromParent(textNode);
                        a.appendChild(textNode);
-                       rightText.data += " ";
-                       s.collapse(rightText, rightText.data.length);
-                       event.stopEvent();
+                       s.collapse(rightText, 0);
+                       rightText.parentNode.normalize();
        
                        editor._unLink = function() {
                                var t = a.firstChild;
@@ -665,9 +664,7 @@ HTMLArea.Editor.prototype._detectURL = function(event) {
        
                switch(ev.which) {
                                // Space or Enter or >, see if the text just typed looks like a URL, or email address and link it accordingly
-                       case 13:        // Enter
-                               if(ev.shiftKey || editor.config.disableEnterParagraphs) break;
-                                       //Space
+                       case 13:
                        case 32:
                                if(s && s.isCollapsed && s.anchorNode.nodeType == 3 && s.anchorNode.data.length > 3 && s.anchorNode.data.indexOf('.') >= 0) {
                                        var midStart = s.anchorNode.data.substring(0,s.anchorOffset).search(/[a-zA-Z0-9]+\S{3,}$/);
index ad4c0e9..e3ec5c7 100644 (file)
@@ -1286,7 +1286,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                }
                if (!event.altKey && !event.ctrlKey) {
                                // Detect URL in non-IE browsers
-                       if (!Ext.isIE) {
+                       if (!Ext.isIE && (event.getKey() != Ext.EventObject.ENTER || event.shiftKey)) {
                                this.getEditor()._detectURL(event);
                        }
                                // Handle option+SPACE for Mac users
@@ -1344,6 +1344,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for ENTER key in non-IE browsers
         */
        onEnter: function (key, event) {
+               this.getEditor()._detectURL(event);
                if (!event.shiftKey) {
                        if (this.getEditor()._checkInsertP()) {
                                event.stopEvent();