From 80d2c93f8fd1e8e1d155e3ad2ba5abd3ae872ce8 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Fri, 19 Nov 2010 13:05:23 -0700 Subject: [PATCH] Add ability to select search mailboxes in context menu in dimp --- imp/docs/CHANGES | 3 ++- imp/js/dimpbase.js | 17 +++++++++++++++-- imp/templates/dimp/index.inc | 6 ++++++ imp/themes/dimp/screen.css | 3 +++ imp/themes/silver/dimp/screen.css | 3 +++ 5 files changed, 29 insertions(+), 3 deletions(-) diff --git a/imp/docs/CHANGES b/imp/docs/CHANGES index fc110e643..3d830d3ae 100644 --- a/imp/docs/CHANGES +++ b/imp/docs/CHANGES @@ -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. diff --git a/imp/js/dimpbase.js b/imp/js/dimpbase.js index d85a5eb3d..cc2259251 100644 --- a/imp/js/dimpbase.js +++ b/imp/js/dimpbase.js @@ -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'); diff --git a/imp/templates/dimp/index.inc b/imp/templates/dimp/index.inc index a4cab8501..2c03086b9 100644 --- a/imp/templates/dimp/index.inc +++ b/imp/templates/dimp/index.inc @@ -307,6 +307,9 @@ function _simpleButton($id, $text, $image, $nodisplay = false) +
+ +
@@ -323,6 +326,9 @@ function _simpleButton($id, $text, $image, $nodisplay = false)
+ + +
diff --git a/imp/themes/dimp/screen.css b/imp/themes/dimp/screen.css index c08be3686..2e7c0912a 100644 --- a/imp/themes/dimp/screen.css +++ b/imp/themes/dimp/screen.css @@ -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"); } diff --git a/imp/themes/silver/dimp/screen.css b/imp/themes/silver/dimp/screen.css index c03241689..b79189f93 100644 --- a/imp/themes/silver/dimp/screen.css +++ b/imp/themes/silver/dimp/screen.css @@ -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"); } -- 2.11.0