Add ability to select search mailboxes in context menu in dimp
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Nov 2010 20:05:23 +0000 (13:05 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 19 Nov 2010 20:10:49 +0000 (13:10 -0700)
imp/docs/CHANGES
imp/js/dimpbase.js
imp/templates/dimp/index.inc
imp/themes/dimp/screen.css
imp/themes/silver/dimp/screen.css

index fc110e6..3d830d3 100644 (file)
@@ -2,7 +2,8 @@
 v5.0-git
 --------
 
-[mms] Add subfolder searching.
+[mms] Add subfolder searching (subfolders dynamically determined at time of
+      search).
 [mms] Refactor inline message image blocking to operate on all messages, not
       just HTML messages.
 [mms] Add attachment message filter.
index d85a5eb..cc22592 100644 (file)
@@ -234,8 +234,11 @@ var DimpBase = {
 
         switch (loc) {
         case 'search':
-            // data: 'edit_query' = folder to edit; otherwise, loads search
-            //       screen with current mailbox as default search mailbox
+            // data: 'edit_query' = folder to edit
+            //       'search_mailbox' = folders to search
+            //       'subfolder' = do subfolder search
+            //       If not set, loads search screen with current mailbox as
+            //       default search mailbox
             if (!data) {
                 data = { search_mailbox: f };
             }
@@ -814,6 +817,16 @@ var DimpBase = {
             this._toggleSubFolder(e.findElement('LI').next(), (id == 'ctx_container_expand' || id == 'ctx_folder_expand') ? 'expall' : 'colall', true);
             break;
 
+        case 'ctx_container_search':
+        case 'ctx_container_searchsub':
+        case 'ctx_folder_search':
+        case 'ctx_folder_searchsub':
+            this.go('search', {
+                search_mailbox: e.findElement('LI').retrieve('mbox'),
+                subfolder: Number(id.endsWith('searchsub'))
+            });
+            break;
+
         case 'ctx_message_spam':
         case 'ctx_message_ham':
             this.reportSpam(id == 'ctx_message_spam');
index a4cab85..2c03086 100644 (file)
@@ -307,6 +307,9 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
  <a id="ctx_folder_sub"><span class="iconImg"></span><?php echo _("Subscribe") ?></a>
  <a id="ctx_folder_unsub"><span class="iconImg"></span><?php echo _("Unsubscribe") ?></a>
 <?php endif; ?>
+ <div class="sep"></div>
+ <a id="ctx_folder_search"><span class="iconImg"></span><?php echo _("Search") ?></a>
+ <a id="ctx_folder_searchsub"><span class="iconImg"></span><?php echo _("Search All Subfolders") ?></a>
  <div style="display:none">
   <div class="sep"></div>
   <a id="ctx_folder_expand"><span class="iconImg"></span><?php echo _("Expand All") ?></a>
@@ -323,6 +326,9 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
  <a id="ctx_container_create"><span class="iconImg"></span><?php echo _("Create subfolder") ?></a>
  <a id="ctx_container_rename"><span class="iconImg"></span><?php echo _("Rename Folder") ?></a>
  <div class="sep"></div>
+ <a id="ctx_container_search"><span class="iconImg"></span><?php echo _("Search") ?></a>
+ <a id="ctx_container_searchsub"><span class="iconImg"></span><?php echo _("Search All Subfolders") ?></a>
+ <div class="sep"></div>
  <a id="ctx_container_expand"><span class="iconImg"></span><?php echo _("Expand All") ?></a>
  <a id="ctx_container_collapse"><span class="iconImg"></span><?php echo _("Collapse All") ?></a>
 </div>
index c08be36..2e7c091 100644 (file)
@@ -983,6 +983,9 @@ span.dimpactionResume {
 #ctx_folder_rename span.iconImg, #ctx_container_rename span.iconImg, #ctx_vcontainer_edit span.iconImg, #ctx_vfolder_edit span.iconImg {
     background-image: url("../graphics/folders/edit.png");
 }
+#ctx_folder_search span.iconImg, #ctx_folder_searchsub span.iconImg, #ctx_container_search span.iconImg, #ctx_container_searchsub span.iconImg {
+    background-image: url("../graphics/search.png");
+}
 #ctx_folder_delete span.iconImg, #ctx_vfolder_delete span.iconImg {
     background-image: url("../graphics/folders/delete.png");
 }
index c032416..b79189f 100644 (file)
@@ -124,6 +124,9 @@ span.dimpactionEditsearch {
 #ctx_folder_rename span.iconImg, #ctx_container_rename span.iconImg, #ctx_vcontainer_edit span.iconImg, #ctx_vfolder_edit span.iconImg {
     background-image: url("../graphics/folders/edit.png");
 }
+#ctx_folder_search span.iconImg, #ctx_folder_searchsub span.iconImg, #ctx_container_search span.iconImg, #ctx_container_searchsub span.iconImg {
+    background-image: url("../graphics/search.png");
+}
 #ctx_folder_delete span.iconImg, #ctx_vfolder_delete span.iconImg {
     background-image: url("../graphics/folders/delete.png");
 }