Improvements to PGP & S/MIME verifying UI
authorMichael M Slusarz <slusarz@curecanti.org>
Sat, 21 Feb 2009 23:57:24 +0000 (16:57 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Sat, 21 Feb 2009 23:57:24 +0000 (16:57 -0700)
imp/js/src/DimpCore.js
imp/lib/DIMP.php
imp/lib/Mime/Viewer/pgp.php
imp/lib/Mime/Viewer/smime.php

index c1ae197..9b493b6 100644 (file)
@@ -491,12 +491,20 @@ DimpCore = {
                 // CSS class based matching
                 if (elt.hasClassName('unblockImageLink')) {
                     IMP.unblockImages(e);
-                } else if (elt.match('SPAN.toggleQuoteShow')) {
+                } else if (elt.hasClassName('toggleQuoteShow')) {
                     [ elt, elt.next() ].invoke('toggle');
                     Effect.BlindDown(elt.next(1), { duration: 0.2, queue: { position: 'end', scope: 'showquote', limit: 2 } });
-                } else if (elt.match('SPAN.toggleQuoteHide')) {
+                } else if (elt.hasClassName('toggleQuoteHide')) {
                     [ elt, elt.previous() ].invoke('toggle');
                     Effect.BlindUp(elt.next(), { duration: 0.2, queue: { position: 'end', scope: 'showquote', limit: 2 } });
+                } else if (elt.hasClassName('pgpVerifyMsg')) {
+                    elt.replace(DIMP.text.verify);
+                    DimpCore.reloadMessage({ pgp_verify_msg: 1 });
+                    e.stop();
+                } else if (elt.hasClassName('smimeVerifyMsg')) {
+                    elt.replace(DIMP.text.verify);
+                    DimpCore.reloadMessage({ smime_verify_msg: 1 });
+                    e.stop();
                 }
                 break;
             }
index 869e91d..3c7607e 100644 (file)
@@ -204,6 +204,7 @@ class DIMP
             'cancel' => _("Cancel"),
             'loading' => _("Loading..."),
             'check' => _("Checking..."),
+            'verify' => _("Verifying..."),
             'onlogout' => _("Logging Out..."),
             'ajax_timeout' => _("There has been no contact with the remote server for several minutes. The server may be temporarily unavailable or network problems may be interrupting your session. You will not see any updates until the connection is restored."),
             'ajax_recover' => _("The connection to the remote server has been restored."),
index a5edd66..c9b5d47 100644 (file)
@@ -177,7 +177,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver
                 case 'imp':
                     /* Ask for the correct passphrase if this is encrypted
                      * symmetrically. */
-                    $status[] = Horde::link('#', '', null, null, IMP::passphraseDialogJS('PGPSymmetric', $js_action, array('symmetricid' => $symmetric_id)) . ';return false;') . _("You must enter the passphrase used to encrypt this message to view it.") . '</a>';
+                    $status[] = Horde::link('#', '', '', '', IMP::passphraseDialogJS('PGPSymmetric', $js_action, array('symmetricid' => $symmetric_id)) . ';return false;') . _("You must enter the passphrase used to encrypt this message to view it.") . '</a>';
                     break;
                 }
                 return null;
@@ -213,7 +213,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver
                         case 'imp':
                             /* Ask for the private key's passphrase if this is
                              * encrypted asymmetrically. */
-                            $status[] = Horde::link('#', '', null, null, IMP::passphraseDialogJS('PGPPersonal', $js_action) . ';return false;') . _("You must enter the passphrase for your PGP private key to view this message.") . '</a>';
+                            $status[] = Horde::link('#', '', '', '', IMP::passphraseDialogJS('PGPPersonal', $js_action) . ';return false;') . _("You must enter the passphrase for your PGP private key to view this message.") . '</a>';
                             break;
                         }
                         return null;
@@ -356,7 +356,7 @@ class IMP_Horde_Mime_Viewer_pgp extends Horde_Mime_Viewer_Driver
                 break;
 
             case 'dimp':
-                $status[] = Horde::link('#', '', '', '', 'DimpCore.reloadMessage({ pgp_verify_msg: 1 });return false;') . _("Click HERE to verify the message.") . '</a>';
+                $status[] = Horde::link('#', '', 'pgpVerifyMsg') . _("Click HERE to verify the message.") . '</a>';
                 break;
             }
         }
index df9f7a7..2e3a138 100644 (file)
@@ -146,7 +146,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver
                 // Fall through
 
             case 'imp':
-                $status[] = Horde::link('#', '', null, null, IMP::passphraseDialogJS('SMIMEPersonal', $js_action) . ';return false;') . _("You must enter the passphrase for your S/MIME private key to view this message.") . '</a>';
+                $status[] = Horde::link('#', '', '', '', IMP::passphraseDialogJS('SMIMEPersonal', $js_action) . ';return false;') . _("You must enter the passphrase for your S/MIME private key to view this message.") . '</a>';
                 break;
             }
             return null;
@@ -247,7 +247,7 @@ class IMP_Horde_Mime_Viewer_smime extends Horde_Mime_Viewer_Driver
                 break;
 
             case 'dimp':
-                $status[] = Horde::link('#', '', '', '', 'DimpCore.reloadMessage({ smime_verify_msg: 1 });return false;') . _("Click HERE to verify the message.") . '</a>';
+                $status[] = Horde::link('#', '', 'smimeVerifyMsg') . _("Click HERE to verify the message.") . '</a>';
                 break;
             }
             return $ret;