From 30b152b1947e773a618bc29bfa3b5b505ceeb1d7 Mon Sep 17 00:00:00 2001 From: alecpl Date: Sat, 2 May 2009 14:19:24 +0000 Subject: - Added quick search box menu (#1484304) --- skins/default/common.css | 9 +++++- skins/default/functions.js | 50 +++++++++++++++++++++++++++++-- skins/default/images/icons/glass.gif | Bin 0 -> 909 bytes skins/default/images/searchfield.gif | Bin 484 -> 397 bytes skins/default/mail.css | 13 +++++++- skins/default/templates/addressbook.html | 4 ++- skins/default/templates/mail.html | 15 +++++++++- 7 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 skins/default/images/icons/glass.gif (limited to 'skins/default') diff --git a/skins/default/common.css b/skins/default/common.css index a01985413..b445cd2c9 100644 --- a/skins/default/common.css +++ b/skins/default/common.css @@ -347,7 +347,7 @@ table.records-table tr.unfocused td background: url('images/searchfield.gif') top left no-repeat; } -#quicksearchbar a +#searchreset { position: absolute; top: 3px; @@ -355,6 +355,13 @@ table.records-table tr.unfocused td text-decoration: none; } +#searchmod +{ + position: absolute; + top: 3px; + right: 162px; +} + #quicksearchbar img { vertical-align: middle; diff --git a/skins/default/functions.js b/skins/default/functions.js index fd6e612ee..31c464792 100644 --- a/skins/default/functions.js +++ b/skins/default/functions.js @@ -121,6 +121,7 @@ function rcmail_init_compose_form() function rcube_mail_ui() { this.markmenu = $('#markmessagemenu'); + this.searchmenu = $('#searchmenu'); } rcube_mail_ui.prototype = { @@ -137,16 +138,61 @@ show_markmenu: function(show) this.markmenu[show?'show':'hide'](); }, +show_searchmenu: function(show) +{ + if (typeof show == 'undefined') + show = this.searchmenu.is(':visible') ? false : true; + + var ref = rcube_find_object('searchmod'); + if (show && ref) { + var pos = $(ref).offset(); + this.searchmenu.css({ left:pos.left, top:(pos.top + ref.offsetHeight + 2)}); + + if (rcmail.env.search_mods) { + for (var n in rcmail.env.search_mods) { + box = rcube_find_object('s_mod_' + n); + box.checked = 'checked'; + } + } + } + this.searchmenu[show?'show':'hide'](); +}, + +set_searchmod: function(elem) +{ + if (!rcmail.env.search_mods) + rcmail.env.search_mods = new Object(); + + if (!elem.checked) + delete(rcmail.env.search_mods[elem.value]); + else + rcmail.env.search_mods[elem.value] = elem.value; +}, + body_mouseup: function(evt, p) { if (this.markmenu && this.markmenu.is(':visible') && rcube_event.get_target(evt) != rcube_find_object('markreadbutton')) this.show_markmenu(false); + else if (this.searchmenu && this.searchmenu.is(':visible') && rcube_event.get_target(evt) != rcube_find_object('searchmod')) { + var menu = rcube_find_object('searchmenu'); + var target = rcube_event.get_target(evt); + while (target.parentNode) { + if (target.parentNode == menu) + return; + target = target.parentNode; + } + this.show_searchmenu(false); + } }, body_keypress: function(evt, p) { - if (rcube_event.get_keycode(evt) == 27 && this.markmenu && this.markmenu.is(':visible')) - this.show_markmenu(false); + if (rcube_event.get_keycode(evt) == 27) { + if (this.markmenu && this.markmenu.is(':visible')) + this.show_markmenu(false); + if (this.searchmenu && this.searchmenu.is(':visible')) + this.show_searchmenu(false); + } } }; diff --git a/skins/default/images/icons/glass.gif b/skins/default/images/icons/glass.gif new file mode 100644 index 000000000..9a705b410 Binary files /dev/null and b/skins/default/images/icons/glass.gif differ diff --git a/skins/default/images/searchfield.gif b/skins/default/images/searchfield.gif index b1dc9389e..756a17e47 100644 Binary files a/skins/default/images/searchfield.gif and b/skins/default/images/searchfield.gif differ diff --git a/skins/default/mail.css b/skins/default/mail.css index 93c63de0f..00f8ca327 100644 --- a/skins/default/mail.css +++ b/skins/default/mail.css @@ -45,7 +45,8 @@ padding-left: 2px; } -#markmessagemenu +#markmessagemenu, +#searchmenu { position: absolute; top: 32px; @@ -60,6 +61,11 @@ z-index: 240; } +#searchmenu +{ + width: 172px; +} + ul.toolbarmenu { margin: 0; @@ -89,6 +95,11 @@ ul.toolbarmenu li a.active:hover background-color: #ddd; } +ul.toolbarmenu li input +{ + vertical-align: middle; +} + #searchfilter { position: absolute; diff --git a/skins/default/templates/addressbook.html b/skins/default/templates/addressbook.html index 431c0589e..b341172f1 100644 --- a/skins/default/templates/addressbook.html +++ b/skins/default/templates/addressbook.html @@ -41,7 +41,9 @@
- + + +
diff --git a/skins/default/templates/mail.html b/skins/default/templates/mail.html index 4e1d7ce3a..735144646 100644 --- a/skins/default/templates/mail.html +++ b/skins/default/templates/mail.html @@ -136,8 +136,21 @@ +
+
    +
  • +
  • +
  • +
  • +
  • +
  • +
+
+
- + + +
-- cgit v1.2.3