[FEATURE] htmlArea RTE: Possiblity to set pastetoggle to ON by default
authorStanislas Rolland <typo3@sjbr.ca>
Sat, 30 Jul 2011 05:41:28 +0000 (01:41 -0400)
committerStanislas Rolland <typo3@sjbr.ca>
Sat, 30 Jul 2011 22:14:31 +0000 (00:14 +0200)
Two new Page TSConfig properties are added:

* RTE.default.buttons.pastetoggle.setActiveOnRteOpen
  If set, and if the pastetoggle button is enabled, the button is
  toggled to ON when the RTE opens.

* RTE.default.buttons.pastetoggle.hidden
  If set, and if the pastetoggle button is enabled, the button is hidden
  in both the toolbar and the context menu.
  Hence, if buttons.pastetoggle.setActiveOnRteOpen is also set, all
  paste operations will be performed using the current clean paste
  behaviour.

The manual is updated to document the fact that default and/or
overriding values may be set for the clean paste behaviour.
For example:
  setup.override.rteCleanPasteBehaviour = plainText

Change-Id: I3f479846d5ce373f7f386fd450603faed08f7e8d
Resolves: #25039
Releases: 4.6
Reviewed-on: http://review.typo3.org/3896
Reviewed-by: Stanislas Rolland
Tested-by: Stanislas Rolland
typo3/sysext/rtehtmlarea/doc/manual.sxw
typo3/sysext/rtehtmlarea/htmlarea/plugins/PlainText/plain-text.js

index b8c997e..33f297a 100644 (file)
Binary files a/typo3/sysext/rtehtmlarea/doc/manual.sxw and b/typo3/sysext/rtehtmlarea/doc/manual.sxw differ
index 6cf80c1..6a7ce07 100644 (file)
@@ -37,7 +37,7 @@ HTMLArea.PlainText = Ext.extend(HTMLArea.Plugin, {
                 * Registering plugin "About" information
                 */
                var pluginInformation = {
-                       version         : '1.1',
+                       version         : '1.2',
                        developer       : 'Stanislas Rolland',
                        developerUrl    : 'http://www.sjbr.ca/',
                        copyrightOwner  : 'Stanislas Rolland',
@@ -57,6 +57,12 @@ HTMLArea.PlainText = Ext.extend(HTMLArea.Plugin, {
                                action          : 'onButtonPress',
                                dialog          : buttonConf[2]
                        };
+                       if (buttonId == 'PasteToggle' && this.buttonsConfiguration && this.buttonsConfiguration[buttonConf[0]] && this.buttonsConfiguration[buttonConf[0]].hidden) {
+                               buttonConfiguration.hide = true;
+                               buttonConfiguration.hideInContextMenu = true;
+                               buttonConfiguration.hotKey = null;
+                               this.buttonsConfiguration[buttonConf[0]].hotKey = null;
+                       }
                        this.registerButton(buttonConfiguration);
                }, this);
                return true;
@@ -107,6 +113,10 @@ HTMLArea.PlainText = Ext.extend(HTMLArea.Plugin, {
                if (this.buttonsConfiguration && this.buttonsConfiguration['pastebehaviour'] && this.buttonsConfiguration['pastebehaviour']['current']) {
                        this.currentBehaviour = this.buttonsConfiguration['pastebehaviour']['current'];
                }
+                       // Set the toggle ON, if configured
+               if (this.buttonsConfiguration && this.buttonsConfiguration['pastetoggle'] && this.buttonsConfiguration['pastetoggle'].setActiveOnRteOpen) {
+                       this.toggleButton('PasteToggle');
+               }
                        // Start monitoring paste events
                this.editor.iframe.mon(Ext.get(Ext.isIE ? this.editor.document.body : this.editor.document.documentElement), 'paste', this.onPaste, this);
        },