summaryrefslogtreecommitdiff
path: root/skins/default
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-06-01 13:44:51 +0000
committeralecpl <alec@alec.pl>2011-06-01 13:44:51 +0000
commit3cacf941fa30e8c02f3f7aebcc8747036d0d8d20 (patch)
tree3d873bb15f9454b28c3c4a8ba3216421ededdfd4 /skins/default
parent2912de6f9bea6c0491a7bc4321e66637da0a6746 (diff)
- Add popup with basic fields selection for addressbook search
Diffstat (limited to 'skins/default')
-rw-r--r--skins/default/common.css16
-rw-r--r--skins/default/functions.js70
-rw-r--r--skins/default/mail.css15
-rw-r--r--skins/default/templates/addressbook.html16
4 files changed, 88 insertions, 29 deletions
diff --git a/skins/default/common.css b/skins/default/common.css
index 675a80cc0..a76220b53 100644
--- a/skins/default/common.css
+++ b/skins/default/common.css
@@ -617,7 +617,6 @@ table.records-table tr.unfocused td
border: none;
}
-
/***** roundcube webmail pre-defined classes *****/
#rcmversion
@@ -815,6 +814,21 @@ ul.toolbarmenu li.separator_above
padding-top: 2px;
}
+#searchmenu
+{
+ width: 160px;
+}
+
+#searchmenu ul.toolbarmenu
+{
+ margin: 0;
+}
+
+#searchmenu ul.toolbarmenu li
+{
+ margin: 1px 4px 1px;
+}
+
/***** tabbed interface elements *****/
diff --git a/skins/default/functions.js b/skins/default/functions.js
index 9057d97c4..603c703b2 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -186,9 +186,25 @@ searchmenu: function(show)
.find(':checked').prop('checked', false);
if (rcmail.env.search_mods) {
- var search_mods = rcmail.env.search_mods[rcmail.env.mailbox] ? rcmail.env.search_mods[rcmail.env.mailbox] : rcmail.env.search_mods['*'];
- for (var n in search_mods)
- $('#s_mod_' + n).prop('checked', true);
+ var n, mbox = rcmail.env.mailbox, mods = rcmail.env.search_mods;
+
+ if (rcmail.env.task != 'addressbook') {
+ mods = mods[mbox] ? mods[mbox] : mods['*'];
+
+ for (n in mods)
+ $('#s_mod_' + n).prop('checked', true);
+ }
+ else {
+ if (mods['*'])
+ $('input:checkbox[name="s_mods[]"]').map(function() {
+ this.checked = true;
+ this.disabled = this.value != '*';
+ });
+ else {
+ for (n in mods)
+ $('#s_mod_' + n).prop('checked', true);
+ }
+ }
}
}
obj[show?'show':'hide']();
@@ -196,16 +212,46 @@ searchmenu: function(show)
set_searchmod: function(elem)
{
- if (!rcmail.env.search_mods)
- rcmail.env.search_mods = {};
-
- if (!rcmail.env.search_mods[rcmail.env.mailbox])
- rcmail.env.search_mods[rcmail.env.mailbox] = rcube_clone_object(rcmail.env.search_mods['*']);
+ var task = rcmail.env.task,
+ mods = rcmail.env.search_mods,
+ mbox = rcmail.env.mailbox;
+
+ if (!mods)
+ mods = {};
+
+ if (task == 'mail') {
+ if (!mods[mbox])
+ mods[mbox] = rcube_clone_object(mods['*']);
+ if (!elem.checked)
+ delete(mods[mbox][elem.value]);
+ else
+ mods[mbox][elem.value] = 1;
+ }
+ else { //addressbook
+ if (!elem.checked)
+ delete(mods[elem.value]);
+ else
+ mods[elem.value] = 1;
+
+ // mark all fields
+ if (elem.value == '*') {
+ $('input:checkbox[name="s_mods[]"]').map(function() {
+ if (this == elem)
+ return;
+
+ if (elem.checked) {
+ mods[this.value] = 1;
+ this.checked = true;
+ this.disabled = true;
+ }
+ else {
+ this.disabled = false;
+ }
+ });
+ }
+ }
- if (!elem.checked)
- delete(rcmail.env.search_mods[rcmail.env.mailbox][elem.value]);
- else
- rcmail.env.search_mods[rcmail.env.mailbox][elem.value] = elem.value;
+ rcmail.env.search_mods = mods;
},
listmenu: function(show)
diff --git a/skins/default/mail.css b/skins/default/mail.css
index a96dd48d5..a2400ec0c 100644
--- a/skins/default/mail.css
+++ b/skins/default/mail.css
@@ -154,21 +154,6 @@
padding-left: 2px;
}
-#searchmenu
-{
- width: 160px;
-}
-
-#searchmenu ul.toolbarmenu
-{
- margin: 0;
-}
-
-#searchmenu ul.toolbarmenu li
-{
- margin: 1px 4px 1px;
-}
-
#messagemenu li a.active:hover,
#markmessagemenu li a.active:hover
{
diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html
index 668b309a7..97cd13c2f 100644
--- a/skins/default/templates/addressbook.html
+++ b/skins/default/templates/addressbook.html
@@ -29,11 +29,25 @@
</div>
<div id="quicksearchbar">
-<roundcube:button name="searchmenulink" id="searchmenulink" image="/images/icons/glass.png" />
+<roundcube:button name="searchmenulink" id="searchmenulink" image="/images/icons/glass_roll.png" onclick="rcmail_ui.show_popup('searchmenu');return false" title="searchmod" />
<roundcube:object name="searchform" id="quicksearchbox" />
<roundcube:button command="reset-search" id="searchreset" image="/images/icons/reset.gif" title="resetsearch" />
</div>
+<div id="searchmenu" class="popupmenu">
+ <ul class="toolbarmenu">
+ <li><input type="checkbox" name="s_mods[]" value="name" id="s_mod_name" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_name"><roundcube:label name="name" /></label></li>
+ <li><input type="checkbox" name="s_mods[]" value="firstname" id="s_mod_firstname" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_firstname"><roundcube:label name="firstname" /></label></li>
+ <li><input type="checkbox" name="s_mods[]" value="surname" id="s_mod_surname" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_surname"><roundcube:label name="surname" /></label></li>
+ <li><input type="checkbox" name="s_mods[]" value="email" id="s_mod_email" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_email"><roundcube:label name="email" /></label></li>
+ <li><input type="checkbox" name="s_mods[]" value="*" id="s_mod_all" onclick="rcmail_ui.set_searchmod(this)" /><label for="s_mod_all"><roundcube:label name="allfields" /></label></li>
+<!--
+ <li class="separator_below">
+ <li><roundcube:button command="advsearch" type="link" label="advsearch" style="padding-left: 0" classAct="active" /></li>
+-->
+ </ul>
+</div>
+
<div id="directorylistbox">
<div id="directorylist-title" class="boxtitle"><roundcube:label name="groups" /></div>
<div class="boxlistcontent">