diff options
| author | Nathan Kinkade <nkinkade@nkinka.de> | 2009-03-12 16:10:53 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@nkinka.de> | 2009-03-12 16:10:53 +0000 |
| commit | 9499dbdd72d387bb8d0cafa569d749a46b6c51f3 (patch) | |
| tree | 7f12803b4474ebfa85fb7c8fe1c4b36021820676 | |
| parent | 328ab0054b24d376f77e6fe6f9c602877d5d3ee4 (diff) | |
Moved functionality of toggling 'Not Spam' and 'Shred' buttons to app.js instead of in the skin, where it seemed impossible to implement it cleanly.
| -rw-r--r-- | roundcubemail/program/js/app.js | 22 | ||||
| -rw-r--r-- | roundcubemail/program/localization/en_US/labels.inc | 9 | ||||
| -rw-r--r-- | roundcubemail/skins/npk/functions.js | 42 | ||||
| -rw-r--r-- | roundcubemail/skins/npk/templates/mail.html | 4 |
4 files changed, 29 insertions, 48 deletions
diff --git a/roundcubemail/program/js/app.js b/roundcubemail/program/js/app.js index d8721fdde..626756af6 100644 --- a/roundcubemail/program/js/app.js +++ b/roundcubemail/program/js/app.js @@ -547,6 +547,28 @@ function rcube_webmail() this.reset_qsearch(); this.list_mailbox(props); + + // Only show the "Not Spam" button if we are currently + // in the configured Junk mailbox + notjunkbutton_elm = rcube_find_object('notjunkbutton'); + if (notjunkbutton_elm) + { + if (this.env.mailbox == this.env.junk_mailbox) + notjunkbutton_elm.style.display = 'inline'; + else + notjunkbutton_elm.style.display = 'none'; + } + + // Only show the "Shred" button if we are currently + // in the configured Trash mailbox + shredbutton_elm = rcube_find_object('shredbutton'); + if (shredbutton_elm) + { + if (this.env.mailbox == this.env.trash_mailbox) + shredbutton_elm.style.display = 'inline'; + else + shredbutton_elm.style.display = 'none'; + } if (this.env.trash_mailbox) this.set_alttext('delete', this.env.mailbox != this.env.trash_mailbox ? 'movemessagetotrash' : 'deletemessage'); diff --git a/roundcubemail/program/localization/en_US/labels.inc b/roundcubemail/program/localization/en_US/labels.inc index 994d05b48..38a70f21b 100644 --- a/roundcubemail/program/localization/en_US/labels.inc +++ b/roundcubemail/program/localization/en_US/labels.inc @@ -37,7 +37,7 @@ $labels['inbox'] = 'Inbox'; $labels['drafts'] = 'Drafts'; $labels['sent'] = 'Sent'; $labels['trash'] = 'Trash'; -$labels['junk'] = 'Junk'; +$labels['junk'] = 'Spam'; // message listing $labels['subject'] = 'Subject'; @@ -179,17 +179,18 @@ $labels['buttonbarreplyall'] = 'Reply to all'; $labels['buttonbarforward'] = 'Forward'; $labels['buttonbarmove'] = 'Move'; $labels['buttonbarcopy'] = 'Copy'; -$labels['buttonbarnotspam'] = 'Not Spam'; +$labels['buttonbarnotjunk'] = 'Not Spam'; $labels['buttonbarviewsource'] = 'Source'; $labels['buttonbarback'] = 'Back'; $labels['buttonbarsend'] = 'Send'; +$labels['buttonbarshred'] = 'Shred'; $labels['buttonbarspellcheck'] = 'Spellcheck'; $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'; -$labels['deletemessages'] = 'Delete message(s)'; +$labels['notjunkmessages'] = 'Copy to Inbox, then move to HamNotSpam'; +$labels['shredmessages'] = 'Permanently delete message(s)'; // message compose $labels['compose'] = 'Compose a message'; diff --git a/roundcubemail/skins/npk/functions.js b/roundcubemail/skins/npk/functions.js index 3a59ef781..b3da71093 100644 --- a/roundcubemail/skins/npk/functions.js +++ b/roundcubemail/skins/npk/functions.js @@ -180,30 +180,6 @@ 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 these - // purposes, but here goes, and it keeps the code inside the skin - // and seems to work well enough for now. - if (evt.target) - { - if (evt.target.childNodes[0].nodeValue=="Spam") - toggle_hamnotspambutton('inline'); - else if (evt.target.childNodes[0].nodeValue=="Not Spam") - toggle_hamnotspambutton('inline'); - else - toggle_hamnotspambutton('none'); - } - - if (evt.target) - { - if (evt.target.childNodes[0].nodeValue=="Trash") - toggle_deletebutton('inline'); - else if (evt.target.childNodes[0].nodeValue=="Delete") - toggle_deletebutton('inline'); - else - toggle_deletebutton('none'); - } - }, // hide menus if user presses Escape key @@ -233,21 +209,3 @@ function rcube_init_mail_ui() if (this.rcmail.env.mailbox=="Trash") toggle_deletebutton('inline'); } - -// 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; -} - -// Only display the "Delete" button if the current -// mailbox is "Trash", otherwise hide it. -function toggle_deletebutton(disposition) -{ - var delete_elm = rcube_find_object('deleteli'); - if (delete_elm) - delete_elm.style.display = disposition; -} diff --git a/roundcubemail/skins/npk/templates/mail.html b/roundcubemail/skins/npk/templates/mail.html index 51e582e55..104cd989e 100644 --- a/roundcubemail/skins/npk/templates/mail.html +++ b/roundcubemail/skins/npk/templates/mail.html @@ -101,8 +101,8 @@ <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> -<li id="deleteli" style="display: none"><roundcube:button name="deletebutton" id="deletebutton" type="link" label="delete" title="deletemessages" onclick="rcmail.command('delete', this)" /></li> +<li id="notjunkbutton" style="display: none"><roundcube:button name="notjunk" id="notjunk" type="link" label="buttonbarnotjunk" title="notjunkmessages" onclick="rcmail.command('copyto','INBOX',this);rcmail.command('moveto','HamNotSpam',this)" /></li> +<li id="shredbutton" style="display: none"><roundcube:button name="shred" id="shred" type="link" label="buttonbarshred" title="shredmessages" onclick="rcmail.command('delete', this)" /></li> <a href="#" onclick="return rcmail.command('checkmail','',this)">Refresh</a> </ul> |
