summaryrefslogtreecommitdiff
path: root/skins
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-04-18 16:53:12 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-04-18 16:53:12 +0200
commit9429087f67d5babe32ff496eadca52788e9f2547 (patch)
treec112d83ba8a0a853509ef68e4792f78293da698c /skins
parent26b5200322dbb1b52333f7e2db1c303ef0ace1f4 (diff)
Add multi-folder search capabilities to classic skin (#1485234)
Diffstat (limited to 'skins')
-rw-r--r--skins/classic/functions.js43
-rw-r--r--skins/classic/mail.css10
-rw-r--r--skins/classic/templates/mail.html6
-rw-r--r--skins/larry/mail.css4
-rw-r--r--skins/larry/templates/mail.html4
5 files changed, 42 insertions, 25 deletions
diff --git a/skins/classic/functions.js b/skins/classic/functions.js
index 144923d0d..7445dba80 100644
--- a/skins/classic/functions.js
+++ b/skins/classic/functions.js
@@ -202,11 +202,13 @@ searchmenu: function(show)
var n, all,
list = $('input:checkbox[name="s_mods[]"]', obj),
mbox = rcmail.env.mailbox,
- mods = rcmail.env.search_mods;
+ mods = rcmail.env.search_mods,
+ scope = rcmail.env.search_scope || 'base';
if (rcmail.env.task == 'mail') {
mods = mods[mbox] ? mods[mbox] : mods['*'];
all = 'text';
+ $('input:radio[name="s_scope"]').prop('checked', false).filter('#s_scope_'+scope).prop('checked', true);
}
else {
all = '*';
@@ -231,7 +233,11 @@ set_searchmod: function(elem)
{
var all, m, task = rcmail.env.task,
mods = rcmail.env.search_mods,
- mbox = rcmail.env.mailbox;
+ mbox = rcmail.env.mailbox,
+ scope = $('input[name="s_scope"]:checked').val();
+
+ if (scope == 'all')
+ mbox = '*';
if (!mods)
mods = {};
@@ -253,23 +259,24 @@ set_searchmod: function(elem)
m[elem.value] = 1;
// mark all fields
- if (elem.value != all)
- return;
-
- $('input:checkbox[name="s_mods[]"]').map(function() {
- if (this == elem)
- return;
+ if (elem.value == all) {
+ $('input:checkbox[name="s_mods[]"]').map(function() {
+ if (this == elem)
+ return;
+
+ this.checked = true;
+ if (elem.checked) {
+ this.disabled = true;
+ delete m[this.value];
+ }
+ else {
+ this.disabled = false;
+ m[this.value] = 1;
+ }
+ });
+ }
- this.checked = true;
- if (elem.checked) {
- this.disabled = true;
- delete m[this.value];
- }
- else {
- this.disabled = false;
- m[this.value] = 1;
- }
- });
+ rcmail.set_searchmods(m);
},
listmenu: function(show)
diff --git a/skins/classic/mail.css b/skins/classic/mail.css
index b1c8a0ea9..fc066e023 100644
--- a/skins/classic/mail.css
+++ b/skins/classic/mail.css
@@ -1010,6 +1010,16 @@ table.messagelist.fixedcopy
padding: 0 2px;
}
+.messagelist tr td.folder
+{
+ width: 135px;
+}
+
+.messagelist tr td.hidden
+{
+ display: none;
+}
+
.messagelist tr.message
{
background-color: #FFF;
diff --git a/skins/classic/templates/mail.html b/skins/classic/templates/mail.html
index e760eb4fd..7a169c8ab 100644
--- a/skins/classic/templates/mail.html
+++ b/skins/classic/templates/mail.html
@@ -114,6 +114,10 @@
<li><label><input type="checkbox" name="s_mods[]" value="bcc" id="s_mod_bcc" onclick="rcmail_ui.set_searchmod(this)" /> <span><roundcube:label name="bcc" /></span></label></li>
<li><label><input type="checkbox" name="s_mods[]" value="body" id="s_mod_body" onclick="rcmail_ui.set_searchmod(this)" /> <span><roundcube:label name="body" /></span></label></li>
<li><label><input type="checkbox" name="s_mods[]" value="text" id="s_mod_text" onclick="rcmail_ui.set_searchmod(this)" /> <span><roundcube:label name="msgtext" /></span></label></li>
+ <li><label class="comment"><roundcube:label name="searchscope" /></label></li>
+ <li><label><input type="radio" name="s_scope" value="base" id="s_scope_base" onclick="rcmail.set_searchscope(this.value)" /> <span><roundcube:label name="currentfolder" /></span></label></li>
+ <li><label><input type="radio" name="s_scope" value="sub" id="s_scope_sub" onclick="rcmail.set_searchscope(this.value)" /> <span><roundcube:label name="subfolders" /></span></label></li>
+ <li><label><input type="radio" name="s_scope" value="all" id="s_scope_all" onclick="rcmail.set_searchscope(this.value)" /> <span><roundcube:label name="allfolders" /></span></label></li>
</ul>
</div>
@@ -138,7 +142,7 @@
<ul>
<li><roundcube:button command="expunge" type="link" label="compact" classAct="active" /></li>
<li><roundcube:button command="purge" type="link" label="empty" classAct="active" /></li>
- <li class="separator_below"><roundcube:button name="messageimport" type="link" class="active" label="importmessages" id="uploadformlink" onclick="rcmail_ui.show_popup('uploadform', true); return false" /></li>
+ <li class="separator_below"><roundcube:button command="import-messages" name="messageimport" type="link" classAct="active" label="importmessages" id="uploadformlink" onclick="if(rcmail.command_enabled('import-messages'))rcmail_ui.show_popup('uploadform', true); return false" /></li>
<li><roundcube:button command="folders" task="settings" type="link" label="managefolders" classAct="active" /></li>
<roundcube:container name="mailboxoptions" id="mailboxoptionsmenu" />
</ul>
diff --git a/skins/larry/mail.css b/skins/larry/mail.css
index 34ce789d0..b9f24b8d0 100644
--- a/skins/larry/mail.css
+++ b/skins/larry/mail.css
@@ -518,10 +518,6 @@ table.messagelist.fixedcopy {
width: 135px;
}
-.messagelist tr td.folder {
- width: 135px;
-}
-
.messagelist tr td.hidden {
display: none;
}
diff --git a/skins/larry/templates/mail.html b/skins/larry/templates/mail.html
index 2f6fbe28c..1e4a3ce8c 100644
--- a/skins/larry/templates/mail.html
+++ b/skins/larry/templates/mail.html
@@ -127,7 +127,7 @@
<li><label><input type="checkbox" name="s_mods[]" value="bcc" id="s_mod_bcc" onclick="UI.set_searchmod(this)" /> <span><roundcube:label name="bcc" /></span></label></li>
<li><label><input type="checkbox" name="s_mods[]" value="body" id="s_mod_body" onclick="UI.set_searchmod(this)" /> <span><roundcube:label name="body" /></span></label></li>
<li><label><input type="checkbox" name="s_mods[]" value="text" id="s_mod_text" onclick="UI.set_searchmod(this)" /> <span><roundcube:label name="msgtext" /></span></label></li>
- <li class="separator" id=""><label><roundcube:label name="searchscope" /></label></li>
+ <li class="separator"><label><roundcube:label name="searchscope" /></label></li>
<li><label><input type="radio" name="s_scope" value="base" id="s_scope_base" onclick="UI.set_searchscope(this)" /> <span><roundcube:label name="currentfolder" /></span></label></li>
<li><label><input type="radio" name="s_scope" value="sub" id="s_scope_sub" onclick="UI.set_searchscope(this)" /> <span><roundcube:label name="subfolders" /></span></label></li>
<li><label><input type="radio" name="s_scope" value="all" id="s_scope_all" onclick="UI.set_searchscope(this)" /> <span><roundcube:label name="allfolders" /></span></label></li>
@@ -145,7 +145,7 @@
<ul class="toolbarmenu" id="mailboxoptionsmenu">
<li><roundcube:button command="expunge" type="link" label="compact" classAct="active" /></li>
<li><roundcube:button command="purge" type="link" label="empty" classAct="active" /></li>
- <li><roundcube:button name="messageimport" type="link" class="active" label="importmessages" onclick="UI.show_uploadform()" /></li>
+ <li><roundcube:button command="import-messages" name="messageimport" type="link" classAct="active" label="importmessages" onclick="if(rcmail.command_enabled('import-messages'))UI.show_uploadform();return false" /></li>
<li><roundcube:button command="folders" task="settings" type="link" label="managefolders" classAct="active" /></li>
<roundcube:container name="mailboxoptions" id="mailboxoptionsmenu" />
</ul>