// from the search input, because the user may immediately start
// keyboard navigation after that. Thus, we need to ensure that a
// message click loses focus on the search input.
- $('quicksearch').blur();
+ $('quicksearch_input').blur();
if (opts.shift) {
if (selcount) {
onAjaxRequest: function(id) {
var p = this.isSearch(id)
? $H({
- qsearch: $F('quicksearch'),
+ qsearch: $F('quicksearch_input'),
qsearchmbox: this.sfolder
})
: $H();
// Check for search strings
if (this.isSearch()) {
- re = new RegExp("(" + $F('quicksearch') + ")", "i");
+ re = new RegExp("(" + $F('quicksearch_input') + ")", "i");
[ 'from', 'subject' ].each(function(h) {
row[h] = row[h].gsub(re, '<span class="quicksearchMatch">#{1}</span>');
});
_quicksearchOnFocus: function()
{
- if ($('quicksearch').hasClassName('quicksearchDefault')) {
+ if (!$('quicksearch').hasClassName('quicksearchActive')) {
this._setFilterText(false);
}
},
_quicksearchOnBlur: function()
{
- if (!$F('quicksearch')) {
+ if (!$F('quicksearch_input')) {
this._setFilterText(true);
}
},
// d = (boolean) Deactivate filter input?
_setFilterText: function(d)
{
- var qs = $('quicksearch');
- qs.setValue(d ? DIMP.text.search : '');
- [ qs ].invoke(d ? 'addClassName' : 'removeClassName', 'quicksearchDefault');
+ $('quicksearch_input').setValue(d ? DIMP.text.search : '');
+ [ $('quicksearch') ].invoke(d ? 'removeClassName' : 'addClassName', 'quicksearchActive');
},
/* Enable/Disable DIMP action buttons as needed. */
case Event.KEY_ESC:
case Event.KEY_TAB:
// Catch escapes in search box
- if (elt.readAttribute('id') == 'quicksearch') {
+ if (elt.readAttribute('id') == 'quicksearch_input') {
if (kc == Event.KEY_ESC || !elt.getValue()) {
this.quicksearchClear();
}
if (form.readAttribute('id') == 'RB_folder') {
this.cfolderaction(e);
e.stop();
- } else if (elt.readAttribute('id') == 'quicksearch') {
- if ($F('quicksearch')) {
+ } else if (elt.readAttribute('id') == 'quicksearch_input') {
+ if ($F('quicksearch_input')) {
this.quicksearchRun();
} else {
this.quicksearchClear();
DimpCore.init();
var DM = DimpCore.DMenu,
- qs = $('quicksearch');
+ qs = $('quicksearch_input');
/* Register global handlers now. */
document.observe('keydown', this.keydownHandler.bindAsEventListener(this));
</div>
<div class="dimpActions">
- <form action="#" method="post">
- <input autocomplete="off" class="quicksearchDefault" id="quicksearch" type="text" size="30" />
- </form>
- <?php echo IMP::img('close.png', '', array('id' => 'quicksearch_close', 'style' => 'display:none', 'title' => _("Clear Search")), $hordeimg) ?>
+ <div id="quicksearch">
+ <form action="#" method="post">
+ <input autocomplete="off" id="quicksearch_input" type="text" size="25" />
+ </form>
+ <span>
+ <?php echo IMP::img('close.png', '', array('id' => 'quicksearch_close', 'style' => 'display:none', 'title' => _("Clear Search")), $hordeimg) ?>
+ </span>
+ </div>
<span>
<?php _createDA(_("Reply"), 'Reply', 'button_reply', 'noselectDisable', $show_text) ?>
</span>
padding: 1px 3px 3px 3px;
cursor: pointer;
}
-.dimpActions form {
- float: right;
- padding: 0;
-}
.dimpActions .disabled a, .dimpActions .disabled a:visited, .dimpActions .disabled a:active, .dimpActions .disabled a:hover {
cursor: default;
text-decoration: none;
}
/* Search-related styles */
-.quicksearchDefault {
+#quicksearch {
+ background: #f3f3f3 url("graphics/search.png") 1px center no-repeat;
+ padding: 1px 0 1px 20px;
+ float: right;
+ border: 1px solid #999;
+ cursor: default;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+}
+#quicksearch form {
+ display: inline;
+}
+#quicksearch span {
+ display: -moz-inline-stack;
+ display: inline-block;
+ width: 20px;
+}
+#quicksearch_input {
+ border: none;
color: #a0a0a0;
+ margin-bottom: 1px;
+ padding: 0;
+}
+#quicksearch_close {
+ margin-top: -1px;
+}
+.quicksearchActive {
+ background-color: #fff !important;
+}
+.quicksearchActive #quicksearch_input {
+ color: #000 !important;
}
.quicksearchMatch {
font-weight: bold;
text-decoration: underline;
}
-#quicksearch_close {
- cursor: pointer;
- float: right;
- padding: 2px 5px 0 0;
-}
/* Redbox styles. */
.RBForm {