Fixed bug #15820: htmlArea RTE: Failure to install AllowClipboard Helper extension...
authorStanislas Rolland <typo3@sjbr.ca>
Mon, 27 Sep 2010 15:15:21 +0000 (15:15 +0000)
committerStanislas Rolland <typo3@sjbr.ca>
Mon, 27 Sep 2010 15:15:21 +0000 (15:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-4@8907 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/rtehtmlarea/ChangeLog
typo3/sysext/rtehtmlarea/htmlarea/locallang_msg.xml
typo3/sysext/rtehtmlarea/htmlarea/plugins/CopyPaste/copy-paste.js

index d3b4330..0fb22de 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-09-27  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #15820: htmlArea RTE: Failure to install AllowClipboard Helper extension raises js error
+
 2010-09-26  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Follow-up to bug #15797: htmlArea RTE: Problem in Firefox inserting non-breaking space with Insert Special Character dialogue
index 63cf9d4..dcfb2a6 100644 (file)
@@ -1,3 +1,7 @@
+2010-09-27  Stanislas Rolland  <typo3@sjbr.ca>
+
+       * Fixed bug #15820: htmlArea RTE: Failure to install AllowClipboard Helper extension raises js error
+
 2010-09-26  Stanislas Rolland  <typo3@sjbr.ca>
 
        * Follow-up to bug #15797: htmlArea RTE: Problem in Firefox inserting non-breaking space with Insert Special Character dialogue
index dab3541..2abf81c 100644 (file)
@@ -15,8 +15,8 @@
                        <label index="Moz-Extension-Success">The installation was successful. You need to exit and restart your browser for the change to take effect.</label>
                        <label index="Moz-Extension-Failure">Sorry, the installation failed.</label>
                        <label index="Moz-Extension-Install-Not-Enabled">The installation cannot be performed. Please change your browser preferences in order to allow installation of sofware from this site.</label>
-                       <label index="Allow-Clipboard-Helper-Extension">For security reasons, unprivileged applications cannot access the clipboard. Click OK to install a component that will enable you to specify the sites or pages that will be allowed to access the clipboard and perform copy, cut and paste operations.</label>
-                       <label index="Mozilla-Org-Install-Not-Enabled">The installation cannot be performed. Please change your browser preferences in order to allow installation of sofware from http://ftp.mozilla.org.</label>
+                       <label index="Allow-Clipboard-Helper-Extension">For security reasons, unprivileged applications cannot access the clipboard. Click YES to install a component that will enable you to specify the sites or pages that will be allowed to access the clipboard and perform copy, cut and paste operations.</label>
+                       <label index="Mozilla-Org-Install-Not-Enabled">The installation cannot be performed. Please change your browser preferences in order to allow installation of sofware from http://addons.mozilla.org.</label>
                        <label index="Allow-Clipboard-Helper-Extension-Success">The installation was successful. You need to exit and restart your browser for the change to take effect. Afterwards, use the AllowClipboard Helper from the tools menu to allow specific sites to use the clipboard.</label>
                </languageKey>
        </data>
index 2a19549..99fe9ff 100644 (file)
@@ -444,32 +444,38 @@ HTMLArea.CopyPaste = HTMLArea.Plugin.extend({
         * Mozilla clipboard access exception handler
         */
        mozillaClipboardAccessException: function () {
-               if (this.buttonsConfiguration.paste && this.buttonsConfiguration.paste.mozillaAllowClipboardURL) {
-                       if (confirm(this.localize('Allow-Clipboard-Helper-Extension'))) {
-                               if (InstallTrigger.enabled()) {
-                                       var mozillaXpi = new Object();
-                                       mozillaXpi['AllowClipboard Helper'] = this.buttonsConfiguration.paste.mozillaAllowClipboardURL;
-                                       InstallTrigger.install(mozillaXpi, this.mozillaInstallCallback);
-                               } else {
-                                       alert(this.localize('Mozilla-Org-Install-Not-Enabled'));
-                                       this.appendToLog('mozillaClipboardAccessException', 'Mozilla install was not enabled.');
-                                       return;
+               if (InstallTrigger && this.buttonsConfiguration.paste && this.buttonsConfiguration.paste.mozillaAllowClipboardURL) {
+                       Ext.MessageBox.confirm('', this.localize('Allow-Clipboard-Helper-Extension'), function (button) {
+                               if (button == 'yes') {
+                                       if (InstallTrigger.enabled()) {
+                                               var self = this;
+                                               function mozillaInstallCallback(url, returnCode) {
+                                                       if (returnCode == 0) {
+                                                               Ext.MessageBox.alert('', self.localize('Allow-Clipboard-Helper-Extension-Success'));
+                                                       } else {
+                                                               Ext.MessageBox.alert('', self.localize('Moz-Extension-Failure'));
+                                                               self.appendToLog('mozillaInstallCallback', 'Mozilla install return code was: ' + returnCode + '.');
+                                                       }
+                                                       return;
+                                               }
+                                               var mozillaXpi = new Object();
+                                               mozillaXpi['AllowClipboard Helper'] = this.buttonsConfiguration.paste.mozillaAllowClipboardURL;
+                                               InstallTrigger.install(mozillaXpi, mozillaInstallCallback);
+                                       } else {
+                                               Ext.MessageBox.alert('', this.localize('Mozilla-Org-Install-Not-Enabled'));
+                                               this.appendToLog('mozillaClipboardAccessException', 'Mozilla install was not enabled.');
+                                       }
                                }
-                       }
-               } else if (confirm(this.localize('Moz-Clipboard'))) {
-                       window.open('http://mozilla.org/editor/midasdemo/securityprefs.html');
-               }
-       },
-       /*
-        * Mozilla Add-on installer call back
-        */
-       mozillaInstallCallback: function (url, returnCode) {
-               if (returnCode == 0) {
-                       alert(this.localize('Allow-Clipboard-Helper-Extension-Success'));
+                       }, this);
                } else {
-                       alert(this.localize('Moz-Extension-Failure'));
-                       this.appendToLog('mozillaInstallCallback', 'Mozilla install return code was: ' + returnCode + '.');
+                       Ext.MessageBox.confirm('', this.localize('Moz-Clipboard'), function (button) {
+                               if (button == 'yes') {
+                                       window.open('http://mozilla.org/editor/midasdemo/securityprefs.html');
+                               }
+                       }, this);
+                       if (!InstallTrigger) {
+                               this.appendToLog('mozillaClipboardAccessException', 'Firefox InstallTrigger was not defined.');
+                       }
                }
-               return;
        }
 });