Fix spam actions on the IMP message screen
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Feb 2009 19:11:12 +0000 (12:11 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 20 Feb 2009 19:11:12 +0000 (12:11 -0700)
imp/js/src/message.js
imp/message.php

index 373b4c9..661ecff 100644 (file)
@@ -174,6 +174,10 @@ var ImpMessage = {
                     this._transfer('move_message');
                 } else if (elt.hasClassName('copyAction')) {
                     this._transfer('copy_message');
+                } else if (elt.hasClassName('spamAction')) {
+                    this.submit('spam_report');
+                } else if (elt.hasClassName('notspamAction')) {
+                    this.submit('notspam_report');
                 }
             } else if (elt.match('SPAN.toggleQuoteShow')) {
                 [ elt, elt.next() ].invoke('toggle');
index 9838ac0..60edac8 100644 (file)
@@ -546,14 +546,14 @@ if (!IMP::$printMode) {
         $conf['spam']['reporting'] &&
         ($conf['spam']['spamfolder'] ||
          ($mailbox_name != IMP::folderPref($prefs->getValue('spam_folder'), true)))) {
-        $a_template->set('spam', Horde::widget('#', _("Report as Spam"), 'widget', '', "message_submit('spam_report'); return false;", _("Report as Spam"), true));
+        $a_template->set('spam', Horde::widget('#', _("Report as Spam"), 'widget spamAction', '', '', _("Report as Spam"), true));
     }
 
     if (!$readonly &&
         $conf['notspam']['reporting'] &&
         (!$conf['notspam']['spamfolder'] ||
          ($mailbox_name == IMP::folderPref($prefs->getValue('spam_folder'), true)))) {
-        $a_template->set('notspam', Horde::widget('#', _("Report as Innocent"), 'widget', '', "message_submit('notspam_report'); return false;", _("Report as Innocent"), true));
+        $a_template->set('notspam', Horde::widget('#', _("Report as Innocent"), 'widget notspamAction', '', '', _("Report as Innocent"), true));
     }
 
     $a_template->set('redirect', Horde::widget(IMP::composeLink(array(), array('actionID' => 'redirect_compose') + $compose_params), _("Redirect"), 'widget', '', '', _("Redirec_t"), true));