diff options
| author | Simon | 2011-04-05 10:58:06 +0200 |
|---|---|---|
| committer | Simon | 2011-04-05 10:58:06 +0200 |
| commit | be2bf7f171d70966b92025ca7d0a302d12e775f2 (patch) | |
| tree | d16651fa95cdf35e8f24cb375d2b4051b32d25b1 /library/Pbs/Search.php | |
| parent | Sortierung der Filter wiederhergestellt (diff) | |
| download | pbs2-be2bf7f171d70966b92025ca7d0a302d12e775f2.tar.gz pbs2-be2bf7f171d70966b92025ca7d0a302d12e775f2.tar.xz pbs2-be2bf7f171d70966b92025ca7d0a302d12e775f2.zip | |
such-aussehen geändert
Diffstat (limited to 'library/Pbs/Search.php')
| -rw-r--r-- | library/Pbs/Search.php | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/library/Pbs/Search.php b/library/Pbs/Search.php index 86d3dde..c06f519 100644 --- a/library/Pbs/Search.php +++ b/library/Pbs/Search.php @@ -10,17 +10,32 @@ class Pbs_Search{ $str = "<form style='text-align:right;' action='/user/client/search'> <input type='text' id='search' name='search' ".(($this->searchTerm != '')?'value="'.$this->searchTerm.'"':'')."> <button type='submit' class='searchbutton' value='search'> Search</button>"; - if($this->searchTerm != ''){ - $str .= "<a href='/user/client/'><img src='/media/img/delete.png' alt='Delete Client'/></a> - <script type='text/javascript' src='/media/js/jquery.highlight-3.js'></script> - <script> + $highlight = array(); + if($this->searchTerm != ''){ + $str .= "<a href='/user/client/'><img src='/media/img/delete.png' alt='Delete Client'/></a> + <script type='text/javascript' src='/media/js/jquery.highlight-3.js'></script>"; + foreach($this->getSearchTerms() as $term){ + $highlight[] = "$('table').highlight('".$term."');"; + } + + } + $str .= "<script> $(document).ready(function(){"; - foreach($this->getSearchTerms() as $term){ - $str .= "$('table').highlight('".$term."');"; - } - $str .= "}); + $str .= implode("\n",$highlight); + $str .= "$('#search') + .focus(function() { + $('table tr .code').show(); + }).focusout(function() { + $('table tr .code').css('verticalAlign','-2px').animate({ + opacity: 0, + width:0 + }, 1000, function() { + $(this).attr({'style': 'display:none'}); + }); + + });"; + $str .= "}); </script>"; - } $str .= "</form>"; return $str; } |
