Fixed bug #8905: option+space for inserting non-braking space on Mac OSX does not...
authorStanislas Rolland <typo3@sjbr.ca>
Fri, 20 Feb 2009 15:49:59 +0000 (15:49 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Fri, 20 Feb 2009 15:49:59 +0000 (15:49 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5041 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index c9bb0cd..e87704d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-02-20  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #8905: option+space for inserting non-braking space on Mac OSX does not work properly
+
 2009-02-19  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Follow-up for feature #10374: Add helper function for additional frontend editing controllers and views
 2009-02-19  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Follow-up for feature #10374: Add helper function for additional frontend editing controllers and views
index 8e74fcf..34971ad 100644 (file)
@@ -1,3 +1,7 @@
+2009-02-20  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #8905: option+space for inserting non-braking space on Mac OSX does not work properly
+
 2009-02-18  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #10479: htmlArea RTE: JS error is raised when using the delete icon on a flexform
 2009-02-18  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Fixed bug #10479: htmlArea RTE: JS error is raised when using the delete icon on a flexform
index b34757e..45b4328 100644 (file)
@@ -1756,12 +1756,11 @@ HTMLArea._editorEvent = function(ev) {
                                }
                        }
                }
                                }
                        }
                }
-               if(ev.ctrlKey && !ev.shiftKey) {
-                       if(!ev.altKey) {
-                                       // execute hotkey command
+               if (ev.ctrlKey && !ev.shiftKey) {
+                       if (!ev.altKey) {
+                                       // Execute hotkey command
                                var key = String.fromCharCode((HTMLArea.is_ie || HTMLArea.is_safari || HTMLArea.is_opera) ? ev.keyCode : ev.charCode).toLowerCase();
                                var key = String.fromCharCode((HTMLArea.is_ie || HTMLArea.is_safari || HTMLArea.is_opera) ? ev.keyCode : ev.charCode).toLowerCase();
-                               if (HTMLArea.is_gecko && ev.keyCode == 32) key = String.fromCharCode(ev.keyCode).toLowerCase();
-                               if (key == " ") {
+                               if (key == " " || ev.keyCode == 32) {
                                        editor.insertHTML("&nbsp;");
                                        editor.updateToolbar();
                                        HTMLArea._stopEvent(ev);
                                        editor.insertHTML("&nbsp;");
                                        editor.updateToolbar();
                                        HTMLArea._stopEvent(ev);
@@ -1855,7 +1854,24 @@ HTMLArea._editorEvent = function(ev) {
                                                editor._timerToolbar = window.setTimeout("HTMLArea.updateToolbar(\'" + editor._editorNumber + "\');", 10);
                                                return true;
                                        }
                                                editor._timerToolbar = window.setTimeout("HTMLArea.updateToolbar(\'" + editor._editorNumber + "\');", 10);
                                                return true;
                                        }
+                                       break;
+                               default:
+                                       break;
                        }
                        }
+                       switch (ev.charCode) {
+                               case 160:
+                                               // Handle option+SPACE for Mac users
+                                       if (navigator.platform.indexOf("Mac") != -1) {
+                                               editor.insertHTML("&nbsp;");
+                                               editor.updateToolbar();
+                                               HTMLArea._stopEvent(ev);
+                                               return false;
+                                       }
+                                       break;
+                               default:
+                                       break;
+                       }
+                       return true;
                }
        } else {
                        // mouse event
                }
        } else {
                        // mouse event