[dev] PATCH : Add range when selecting mails

Cariad Ilmàra cariad at adnx.net
Mon Dec 8 13:21:47 PST 2003


Hello,

Here's a small patch for IMP to add 'Range' when selecting mails. Select 
  the first mail, the last one, and Range to select every mail 
in-between. May be useful when displaying 40 or 50 mails at once.

Patch for
imp/templates/mailbox/javascript.inc
imp/templates/mailbox/actions.inc

--- javascript.inc.old  Mon Dec  8 16:00:49 2003
+++ javascript.inc      Mon Dec  8 19:52:24 2003
@@ -16,6 +16,22 @@
      }
  }

+function chkrange() {
+               length = document.messages.length;
+               ok = 0;
+
+               for (i=0; i<length; i++) {
+                       if (document.messages[i].type == "checkbox") {
+                               if (document.messages[i].checked == true) {
+                                       ok = (ok == 1) ? 0 : 1;
+                               }
+                               if (document.messages[i].checked == 
false && ok == 1) {
+                                       document.messages[i].checked = true;
+                               }
+                       }
+               }
+}
+
  function Submit(actID)
  {
  <?php if ($imp['base_protocol'] == 'pop3'): ?>


--- actions.inc.old Mon Dec  8 22:15:38 2003
+++ actions.inc     Mon Dec  8 22:15:58 2003
@@ -18,6 +18,7 @@
  <?php if ($show_whitelist_link): ?>
          | <?php echo Horde::widget('', _("Whitelist"), 'widget', '', 
"Submit('whitelist'); return false;", _("Whitelist")); ?>
  <?php endif; ?>
+       | <?php echo Horde::widget('', _("Range"), 'widget', '', 
"chkrange(); return false;", _("Range")) ?>
      | <?php echo Horde::widget('', _("Forward"), 'widget', '', 
"Submit('fwd_digest'); return false;", _("Forward")) ?>
  <?php if ($conf['spam']['reporting']): ?>
      | <?php echo Horde::widget('', _("Report as Spam"), 'widget', '', 
"Submit('spam_report'); return false;", _("Report as Spam")); ?>

-- 
Cariad Ilmàra
http://cariad.adnx.net/
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it." - Brian W. Kernighan


More information about the dev mailing list