Add Alt + PGUP/PGDN shortcut to scroll through preview message
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 29 May 2009 04:58:22 +0000 (22:58 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 29 May 2009 04:58:22 +0000 (22:58 -0600)
imp/docs/CHANGES
imp/js/src/DimpBase.js
imp/templates/index/index-dimp.inc

index 5e18938..a63b5ca 100644 (file)
@@ -2,6 +2,7 @@
 v5.0-git
 --------
 
+[mms] Add Alt + PGUP/PGDN shortcut to scroll through preview message (DIMP).
 [jan] Show possible event conflicts in iTip viewer (Request #3991, Gonçalo
       Queirós <goncalo.queiros@portugalmail.net>).
 [mms] Move subfolders of special folders to lower folder display tree in
index b2af69d..d35820e 100644 (file)
@@ -1307,7 +1307,7 @@ var DimpBase = {
     /* Keydown event handler */
     keydownHandler: function(e)
     {
-        var co, form, ps, r, row, rowoff, sel,
+        var co, form, h, pp, ps, r, row, rowoff, sel,
             elt = e.element(),
             kc = e.keyCode || e.charCode;
 
@@ -1382,7 +1382,22 @@ var DimpBase = {
 
         case Event.KEY_PAGEUP:
         case Event.KEY_PAGEDOWN:
-            if (!e.ctrlKey && !e.shiftKey && !e.altKey && !e.metaKey) {
+            if (e.altKey) {
+                pp = $('previewPane');
+                h = pp.getHeight();
+                if (h != pp.scrollHeight) {
+                    switch (kc) {
+                    case Event.KEY_PAGEUP:
+                        pp.scrollTop = Math.max(pp.scrollTop - h, 0);
+                        break;
+
+                    case Event.KEY_PAGEDOWN:
+                        pp.scrollTop = Math.min(pp.scrollTop + h, pp.scrollHeight - h + 1);
+                        break;
+                    }
+                }
+                e.stop();
+            } else if (!e.ctrlKey && !e.shiftKey && !e.metaKey) {
                 ps = this.viewport.getPageSize() - 1;
                 move = ps * (kc == Event.KEY_PAGEUP ? -1 : 1);
                 if (sel.size() == 1) {
index 77329e0..3c6f05c 100644 (file)
@@ -248,6 +248,7 @@ function _simpleButton($id, $text, $image, $imagedir = null)
        <?php echo _("The following keyboard shortcuts are available:") ?><br />
        <span class="iconImg keyupImg"></span> / <span class="iconImg keydownImg"></span> : <?php echo _("Move up/down through the message list.") ?><br />
        <span class="kbd"><?php echo _("PgUp") ?></span> / <span class="kbd"><?php echo _("PgDown") ?></span> : <?php echo _("Move one page up/down through the message list.") ?><br />
+       <span class="kbd"><?php echo _("Alt") ?></span> + <span class="kbd"><?php echo _("PgUp") ?></span> / <span class="kbd"><?php echo _("PgDown") ?></span> : <?php echo _("Scroll up/down through the display of the previewed message.") ?><br />
        <span class="kbd"><?php echo _("Home") ?></span> / <span class="kbd"><?php echo _("End") ?></span> : <?php echo  _("Move to the beginning/end of the message list.") ?><br />
        <span class="kbd"><?php echo _("Del") ?></span> : <?php echo _("Delete the currently selected message(s).") ?> <?php printf(_("%s will delete the current message and move to the next message if a single message is selected."), '<span class="kbd">' . _("Shift") . '</span> + <span class="kbd">' . _("Del") . '</span>') ?><br />
        <span class="kbd"><?php echo _("Enter") ?></span> : <?php echo _("Open message in a popup window.") ?><br />