From 93ddb86d8f0cfc568da734afbc5b24ff659d5a7c Mon Sep 17 00:00:00 2001 From: Nathan Kinkade Date: Wed, 11 Mar 2009 12:42:06 +0000 Subject: Add a Not Spam button and code toggle it's visibility depending on whether the user is viewing the Spam folder. --- roundcubemail/program/localization/en_US/labels.inc | 2 ++ roundcubemail/skins/npk/functions.js | 18 ++++++++++++++++++ roundcubemail/skins/npk/templates/mail.html | 1 + 3 files changed, 21 insertions(+) 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 @@
  • +   Refresh -- cgit v1.2.3