summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2009-03-11 12:42:06 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2009-03-11 12:51:52 +0000
commit93ddb86d8f0cfc568da734afbc5b24ff659d5a7c (patch)
tree3d6f16a5b97e6f5915f4759421fe3157ff278485
parentf807a4f4b549c285c5ebf91d77cf207cb9ef8e6d (diff)
Add a Not Spam button and code toggle it's visibility depending on whether the user is viewing the Spam folder.
-rw-r--r--roundcubemail/program/localization/en_US/labels.inc2
-rw-r--r--roundcubemail/skins/npk/functions.js18
-rw-r--r--roundcubemail/skins/npk/templates/mail.html1
3 files changed, 21 insertions, 0 deletions
diff --git a/roundcubemail/program/localization/en_US/labels.inc b/roundcubemail/program/localization/en_US/labels.inc
index 3b73363bd..bc250100e 100644
--- a/roundcubemail/program/localization/en_US/labels.inc
+++ b/roundcubemail/program/localization/en_US/labels.inc
@@ -179,10 +179,12 @@ $labels['buttonbarreplyall'] = 'Reply to all';
$labels['buttonbarforward'] = 'Forward';
$labels['buttonbarmove'] = 'Move';
$labels['buttonbarcopy'] = 'Copy';
+$labels['buttonbarnotspam'] = 'Not Spam';
$labels['archivemessages'] = 'Move to archives folder';
$labels['movemessages'] = 'Move to selected folder';
$labels['copymessages'] = 'Copy to selected folder';
+$labels['notspammessages'] = 'Copy to INBOX, then move to HamNotSpam';
// message compose
$labels['compose'] = 'Compose a message';
diff --git a/roundcubemail/skins/npk/functions.js b/roundcubemail/skins/npk/functions.js
index d8123e462..5c77d9a85 100644
--- a/roundcubemail/skins/npk/functions.js
+++ b/roundcubemail/skins/npk/functions.js
@@ -180,6 +180,15 @@ body_mouseup: function(evt, p)
this.show_movemenu(false);
if (this.copymenu && this.copymenu.visible && evtElm.parentNode != rcube_find_object('copymessagebutton') && evtElm != rcube_find_object('copymessagearrow'))
this.show_copymenu(false);
+
+ // It's a bit questionable to coopt the mouseup event for this
+ // purpose, but it keeps the code inside the skin and seems to
+ // work well enough for now.
+ if (evt.target.childNodes[0].nodeValue=="Spam")
+ toggle_hamnotspambutton('inline');
+ else
+ toggle_hamnotspambutton('none');
+
},
// hide menus if user presses Escape key
@@ -203,3 +212,12 @@ function rcube_init_mail_ui()
rcube_event.add_listener({ object:rcmail_ui, method:'body_mouseup', event:'mouseup' });
rcube_event.add_listener({ object:rcmail_ui, method:'body_keypress', event:'keypress' });
}
+
+// Only display the "Not Spam" button if the current
+// mailbox is "Spam", otherwise hide it.
+function toggle_hamnotspambutton(disposition)
+{
+ var hamnotspam_elm = rcube_find_object('hamnotspamli');
+ if (hamnotspam_elm)
+ hamnotspam_elm.style.display = disposition;
+}
diff --git a/roundcubemail/skins/npk/templates/mail.html b/roundcubemail/skins/npk/templates/mail.html
index 40001928f..65deb0d0c 100644
--- a/roundcubemail/skins/npk/templates/mail.html
+++ b/roundcubemail/skins/npk/templates/mail.html
@@ -101,6 +101,7 @@
<li id="markmessagebutton"><roundcube:button name="markmessagearrow" id="markmessagearrow" title="markmessages" onclick="rcmail_ui.show_markmenu();return false" label="buttonbarmark" image="/images/arrow_down.png" /></li>
<li id="movemessagebutton"><roundcube:button name="movemessagearrow" id="movemessagearrow" title="movemessages" onclick="rcmail_ui.show_movemenu();return false" label="buttonbarmove" image="/images/arrow_down.png" /></li>
<li id="copymessagebutton"><roundcube:button name="copymessagearrow" id="copymessagearrow" title="copymessages" onclick="rcmail_ui.show_copymenu();return false" label="buttonbarcopy" image="/images/arrow_down.png" /></li>
+<li id="hamnotspamli" style="display: none"><roundcube:button name="hamnotspambutton" id="hamnotspambutton" type="link" label="buttonbarnotspam" title="notspammessages" onclick="rcmail.command('copyto','INBOX',this);rcmail.command('moveto','HamNotSpam',this)" /></li>
&nbsp;&nbsp;<a href="#" onclick="return rcmail.command('checkmail','',this)">Refresh</a>
</ul>