* Bugfix #6836: htmlArea RTE cannot enter line break in Safari (Windows)
authorStanislas Rolland <typo3@sjbr.ca>
Tue, 27 Nov 2007 16:31:00 +0000 (16:31 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Tue, 27 Nov 2007 16:31:00 +0000 (16:31 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@2776 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index 385eac1..f079445 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-11-27  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Bugfix #6836: htmlArea RTE cannot enter line break in Safari (Windows)
+
 2007-11-26  Ingo Renner        <ingo@typo3.org>
 
        * moved interface t3lib_backendToolbarItem to typo3/interfaces/interface.backend_toolbaritem.php
index ebeef15..cd39e63 100644 (file)
@@ -1,3 +1,7 @@
+2007-11-27  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
+
+       * Bugfix #6836: htmlArea RTE cannot enter line break in Safari (Windows)
+
 2007-11-22  Stanislas Rolland  <stanislas.rolland@fructifor.ca>
 
        * Feature/bugfix: htmlArea RTE: Enter paragraph on return key corrected and improved
index 914a994..2addd14 100644 (file)
@@ -1800,8 +1800,8 @@ HTMLArea.prototype.updateToolbar = function(noStatus) {
                                                var el = this.getParentElement();
                                                while (el && !HTMLArea.isBlockElement(el)) { el = el.parentNode; }
                                                if (el) btn.state("active",(el.style.direction == ((cmd == "RightToLeft") ? "rtl" : "ltr")));
-                                               break;
                                        }
+                                       break;
                                case "Paste":
                                        if(!text) {
                                                btn.state("enabled", doc.queryCommandEnabled('Paste'));
@@ -2422,8 +2422,19 @@ HTMLArea._editorEvent = function(ev) {
                        if (HTMLArea.is_gecko) editor._detectURL(ev);
                        switch (ev.keyCode) {
                                case 13 : // KEY enter
-                                       if (HTMLArea.is_gecko && !ev.shiftKey && !editor.config.disableEnterParagraphs) {
-                                               if (editor._checkInsertP()) {
+                                       if (HTMLArea.is_gecko) { 
+                                               if (!ev.shiftKey && !editor.config.disableEnterParagraphs) {
+                                                       if (editor._checkInsertP()) {
+                                                               HTMLArea._stopEvent(ev);
+                                                       }
+                                               } else if (HTMLArea.is_safari) {
+                                                       var brNode = document.createElement("br");
+                                                       editor.insertNodeAtSelection(brNode);
+                                                       if (!brNode.nextSibling || !HTMLArea.getInnerText(brNode.nextSibling)) {
+                                                               var secondBrNode = document.createElement("br");
+                                                               secondBrNode = brNode.parentNode.appendChild(secondBrNode);
+                                                               editor.selectNode(secondBrNode, false);
+                                                       }
                                                        HTMLArea._stopEvent(ev);
                                                }
                                                        // update the toolbar state after some time