* Follow-up to bug #14066: htmlArea RTE: Erratic handling of oncut and onpaste events
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Apr 2010 23:40:55 +0000 (23:40 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 12 Apr 2010 23:40:55 +0000 (23:40 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@7322 709f56b5-9817-0410-a4d7-c38de5d9e867

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

index c0a0dc8..4b32d0d 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,7 @@
 
        * 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
+       * Follow-up to bug #14066: htmlArea RTE: Erratic handling of oncut and onpaste events
 
 2010-04-12  Susanne Moog  <typo3@susanne-moog.de>
 
index 2d0a774..fe8d8a5 100644 (file)
@@ -2,6 +2,7 @@
 
        * 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
+       * Follow-up to bug #14066: htmlArea RTE: Erratic handling of oncut and onpaste events
 
 2010-04-11  Stanislas Rolland  <typo3@sjbr.ca>
 
index f416d0a..32f09aa 100644 (file)
@@ -1170,9 +1170,7 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for other key events
         */
        onAnyKey: function(event) {
-                       // Inhibit key events while server-based cleaning is being processed
-               if (this.getEditor().inhibitKeyboardInput) {
-                       event.stopEvent();
+               if (this.inhibitKeyboardInput(event)) {
                        return false;
                }
                /*****************************************************
@@ -1207,6 +1205,18 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
                return true;
        },
        /*
+        * On any key input event, check if input is currently inhibited
+        */
+       inhibitKeyboardInput: function (event) {
+                       // Inhibit key events while server-based cleaning is being processed
+               if (this.getEditor().inhibitKeyboardInput) {
+                       event.stopEvent();
+                       return true;
+               } else {
+                       return false;
+               }
+       },
+       /*
         * Handler for mouse events
         */
        onMouse: function () {
@@ -1235,6 +1245,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * If available, BlockElements plugin will handle the TAB key
         */
        onTab: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                var keyName = (event.shiftKey ? 'SHIFT-' : '') + 'TAB';
                if (this.config.hotKeyList[keyName] && this.config.hotKeyList[keyName].cmd) {
                        var button = this.getButton(this.config.hotKeyList[keyName].cmd);
@@ -1250,6 +1263,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for BACKSPACE and DELETE keys
         */
        onBackSpace: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                if ((!Ext.isIE && !event.shiftKey) || Ext.isIE) {
                        if (this.getEditor()._checkBackspace()) {
                                event.stopEvent();
@@ -1263,6 +1279,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for ENTER key in non-IE browsers
         */
        onEnter: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                this.getEditor()._detectURL(event);
                if (this.getEditor()._checkInsertP()) {
                        event.stopEvent();
@@ -1275,6 +1294,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for ENTER key in WebKit browsers
         */
        onWebKitEnter: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                if (event.shiftKey || this.config.disableEnterParagraphs) {
                        this.getEditor()._detectURL(event);
                }
@@ -1286,6 +1308,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for CTRL-SPACE keys
         */
        onCtrlSpace: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                this.getEditor().insertHTML('&nbsp;');
                event.stopEvent();
                return false;
@@ -1294,6 +1319,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for OPTION-SPACE keys on Mac
         */
        onOptionSpace: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                this.getEditor().insertHTML('&nbsp;');
                event.stopEvent();
                return false;
@@ -1302,6 +1330,9 @@ HTMLArea.Iframe = Ext.extend(Ext.BoxComponent, {
         * Handler for configured hotkeys
         */
        onHotKey: function (key, event) {
+               if (this.inhibitKeyboardInput(event)) {
+                       return false;
+               }
                var hotKey = String.fromCharCode(key).toLowerCase();
                this.getButton(this.config.hotKeyList[hotKey].cmd).fireEvent('hotkey', hotKey, event);
                return false;