Move dimp help text out of preview space
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 3 Dec 2010 19:26:53 +0000 (12:26 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 3 Dec 2010 19:26:53 +0000 (12:26 -0700)
imp/js/dimpbase.js
imp/templates/dimp/index.inc
imp/templates/dimp/javascript_defs.php
imp/themes/default/dimp/screen.css
imp/themes/default/graphics/help.png [new file with mode: 0644]
imp/themes/silver/dimp/screen.css
imp/themes/silver/graphics/help.png [new file with mode: 0644]

index c2aeac9..fe00bc7 100644 (file)
@@ -902,6 +902,10 @@ var DimpBase = {
             this.purgeDeleted();
             break;
 
+        case 'oa_help':
+            this.toggleHelp();
+            break;
+
         case 'ctx_vfolder_edit':
             tmp = { edit_query: e.findElement('LI').retrieve('mbox') };
             // Fall through
@@ -1398,10 +1402,28 @@ var DimpBase = {
 
     clearPreviewPane: function()
     {
+        var sel, txt;
+
         this.loadingImg('msg', false);
         $('previewMsg').hide();
         $('previewPane').scrollTop = 0;
-        $('previewInfo').show();
+
+        sel = this.selectedCount();
+        switch (sel) {
+        case 0:
+            txt = DIMP.text.nomessages;
+            break;
+
+        case 1:
+            txt = 1 + ' ' + DIMP.text.message;
+            break;
+
+        default:
+            txt = sel + ' ' + DIMP.text.messages;
+            break;
+        }
+        $('previewInfo').update(txt + ' ' + DIMP.text.selected + '.').show();
+
         this.pp = null;
     },
 
@@ -2206,6 +2228,11 @@ var DimpBase = {
                 e.stop();
                 return;
 
+            case 'helptext_close':
+                this.toggleHelp();
+                e.stop();
+                return;
+
             default:
                 if (elt.hasClassName('printAtc')) {
                     DimpCore.popupWindow(DimpCore.addURLParam(DIMP.conf.URI_VIEW, { uid: this.pp.imapuid, mailbox: this.pp.view, actionID: 'print_attach', id: elt.readAttribute('mimeid') }, true), this.pp.imapuid + '|' + this.pp.view + '|print', IMP.printWindow);
@@ -2261,6 +2288,18 @@ var DimpBase = {
         }
     },
 
+    toggleHelp: function()
+    {
+        Effect.toggle($('helptext').down('DIV'), 'blind', {
+            duration: 0.75,
+            queue: {
+                position: 'end',
+                scope: 'DimpHelp',
+                limit: 2
+            }
+        });
+    },
+
     /* Handle rename folder actions. */
     renameFolder: function(folder)
     {
index bdd2ecb..a15f069 100644 (file)
@@ -172,27 +172,7 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
 
     <div id="previewPane" style="display:none">
      <span id="msgLoading" class="loadingImg" style="display:none"></span>
-     <div id="previewInfo" style="display:none">
-      <?php echo _("To preview a message, select it from the message list.") ?>
-      <br />
-<?php if ($browser->isBrowser('opera')): ?>
-      <?php echo _("A left click") ?> + <span class="kbd"><?php echo _("Shift") ?></span> + <span class="kbd"><?php echo _("Ctrl") ?></span> <?php echo _("will display available actions.") ?>
-<?php else: ?>
-      <?php echo _("A right-click on a message or a folder will display available actions.") ?>
-<?php endif; ?>
-      <br />
-      <?php printf(_("Click on a message while holding down the %s key to select multiple messages.  To select a range of messages, click the first message of the range, navigate to the last message of the range, and then click on the last message while holding down the %s key."), '<span class="kbd">' . _("Ctrl") . '</span>', '<span class="kbd">' . _("Shift") . '</span>') ?><br /><br />
-      <?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 _("Shift") ?></span> + <span class="kbd"><?php echo _("N") ?></span> : <?php echo _("Move to the next unseen message (non-search folders only).") ?><br />
-      <span class="kbd"><?php echo _("Enter") ?></span> : <?php echo _("Open message in a popup window.") ?><br />
-      <span class="kbd"><?php echo _("Ctrl") ?></span> + <span class="kbd"><?php echo 'A' ?></span> : <?php echo _("Select all messages in the current mailbox.") ?><br />
-     </div>
-
+     <div id="previewInfo" style="display:none"></div>
      <div id="previewMsg" style="display:none">
       <div class="msgHeaders">
        <div id="toggleHeaders">
@@ -447,6 +427,8 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
  <a id="oa_purge_deleted"><span class="iconImg"></span><?php echo _("Purge Deleted") ?></a>
  <a id="oa_undeleted"><span class="iconImg"></span><?php echo _("Undelete") ?></a>
 <?php endif; ?>
+ <div class="sep"></div>
+ <a id="oa_help"><span class="iconImg"></span><?php echo _("Help") ?></a>
 </div>
 
 <div class="context" id="ctx_filter" style="display:none">
@@ -493,3 +475,27 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
   <span class="dispaddrlist" style="display:none"></span>
  </span>
 </div>
+
+<div id="helptext">
+ <div style="display:none">
+  <span class="iconImg closeImg" id="helptext_close" title="<?php echo _("Close") ?>"></span>
+  <?php echo _("To preview a message, select it from the message list.") ?>
+  <br />
+<?php if ($browser->isBrowser('opera')): ?>
+  <?php echo _("A left click") ?> + <span class="kbd"><?php echo _("Shift") ?></span> + <span class="kbd"><?php echo _("Ctrl") ?></span> <?php echo _("will display available actions.") ?>
+<?php else: ?>
+  <?php echo _("A right-click on a message or a folder will display available actions.") ?>
+<?php endif; ?>
+  <br />
+  <?php printf(_("Click on a message while holding down the %s key to select multiple messages.  To select a range of messages, click the first message of the range, navigate to the last message of the range, and then click on the last message while holding down the %s key."), '<span class="kbd">' . _("Ctrl") . '</span>', '<span class="kbd">' . _("Shift") . '</span>') ?><br /><br />
+  <?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 _("Shift") ?></span> + <span class="kbd"><?php echo _("N") ?></span> : <?php echo _("Move to the next unseen message (non-search folders only).") ?><br />
+  <span class="kbd"><?php echo _("Enter") ?></span> : <?php echo _("Open message in a popup window.") ?><br />
+  <span class="kbd"><?php echo _("Ctrl") ?></span> + <span class="kbd"><?php echo 'A' ?></span> : <?php echo _("Select all messages in the current mailbox.") ?>
+ </div>
+</div>
index f0bfec8..17e90af 100644 (file)
@@ -161,6 +161,7 @@ $code['text'] = array(
     'prefs' => _("User Options"),
     'rename_prompt' => _("Rename folder to:"),
     'search' => _("Search"),
+    'selected' => _("selected"),
     'verify' => _("Verifying..."),
     'vfolder' => _("Virtual Folder: %s"),
     'vp_empty' => _("There are no messages in this mailbox."),
index c817aea..8a161ce 100644 (file)
@@ -976,6 +976,9 @@ span.dimpactionResume {
 #oa_layout_vert span.iconImg {
     background-image: url("../graphics/application_tile_horizontal.png");
 }
+#oa_help span.iconImg {
+    background-image: url("../graphics/help.png");
+}
 #ctx_folder_create span.iconImg, #ctx_container_create span.iconImg, #ctx_folderopts_new span.iconImg {
     background-image: url("../graphics/folders/create.png");
 }
@@ -1073,3 +1076,23 @@ span.readonlyImg {
 #Growler div.imp-forward, div.imp-redirect, span.imp-forward, span.imp-redirect {
     background-image: url("../graphics/mail_forwarded.png");
 }
+
+/* Help screen */
+#helptext {
+    bottom: 0;
+    left: 0;
+    line-height: 18px;
+    position: fixed;
+    width: 100%;
+    z-index: 10001;
+}
+#helptext div {
+    background: lightgrey;
+    border: 1px solid grey;
+    line-height: 18px;
+    padding: 10px 30px 15px;
+}
+#helptext_close {
+    cursor: pointer;
+    float: right;
+}
diff --git a/imp/themes/default/graphics/help.png b/imp/themes/default/graphics/help.png
new file mode 100644 (file)
index 0000000..6601a40
Binary files /dev/null and b/imp/themes/default/graphics/help.png differ
index edd9841..8e556c8 100644 (file)
@@ -115,6 +115,9 @@ span.dimpactionEditsearch {
 #oa_layout_vert span.iconImg {
     background-image: url("../graphics/application_tile_horizontal.png");
 }
+#oa_help span.iconImg {
+    background-image: url("../graphics/help.png");
+}
 #ctx_folder_create span.iconImg, #ctx_container_create span.iconImg, #ctx_folderopts_new span.iconImg {
     background-image: url("../graphics/folders/create.png");
 }
diff --git a/imp/themes/silver/graphics/help.png b/imp/themes/silver/graphics/help.png
new file mode 100644 (file)
index 0000000..4e434bb
Binary files /dev/null and b/imp/themes/silver/graphics/help.png differ