diff options
Diffstat (limited to 'cgi-bin')
-rw-r--r-- | cgi-bin/css/lxrng.css | 22 | ||||
-rwxr-xr-x | cgi-bin/lxr | 33 |
2 files changed, 46 insertions, 9 deletions
diff --git a/cgi-bin/css/lxrng.css b/cgi-bin/css/lxrng.css index d8c18d3..f5d84c0 100644 --- a/cgi-bin/css/lxrng.css +++ b/cgi-bin/css/lxrng.css @@ -1,3 +1,5 @@ +/* -*- mode: fundamental -*- */ + body { font-family: sans-serif; margin-top: 3px; @@ -114,8 +116,28 @@ body.popup div.search_results { margin: 1px; } +span.identtype { + display: block; +/* font-weight: bold; */ + font-style: italic; + margin-top: 10px; + margin-left: 1em; +} + +span.resultline { + display: block; + margin-left: 2em; +} + +span.resultdetails { + font-size: 75%; +/* font-style: italic; */ +} + div.query_desc { font-weight: bold; + margin-top: 10px; + margin-bottom: 5px; } span.close-button { diff --git a/cgi-bin/lxr b/cgi-bin/lxr index 375b640..719bf96 100755 --- a/cgi-bin/lxr +++ b/cgi-bin/lxr @@ -307,9 +307,24 @@ sub search { if ($find =~ /\S/) { + if ($find =~ /^(ident|code):(.*)/) { + $type = 'code'; + $find = $2; + } + elsif ($find =~ /^(file|path):(.*)/) { + $type = 'file'; + $find = $2; + } + elsif ($find =~ /^(text):(.*)/) { + $type = 'text'; + $find = $2; + } + if ($type eq 'file' or $type eq 'search') { - # $template_args{'file_res'} = {'query' => $find, - # 'files' => \@args,} + my $files = $index->files_by_wildcard($context->tree, + $ver, $find); + $template_args{'file_res'} = {'query' => $find, + 'files' => $files,} } if ($type eq 'text' or $type eq 'search') { my $hash = $context->config->{'search'}; @@ -320,12 +335,14 @@ sub search { 'files' => $res}; } if ($type eq 'code' or $type eq 'search') { - my $result = $index->symbols_by_name($context->tree, $ver, $find); - my @cooked = (map { $$_[1] = $LXRng::Lang::deftypes{$$_[1]}; - $$_[5] &&= $LXRng::Lang::deftypes{$$_[5]}; + my $result = $index->identifiers_by_name($context->tree, + $ver, $find); + my @cooked = (map { $$_[1] = ucfirst($LXRng::Lang::deftypes{$$_[1]}); $_ } sort { $LXRng::Lang::defweight{$$a[1]} cmp - $LXRng::Lang::defweight{$$b[1]} } + $LXRng::Lang::defweight{$$b[1]} || + $$a[2] cmp $$b[2] || + $$a[3] <=> $$b[3] } @$result); $template_args{'code_res'} = {'query' => $find, 'idents' => \@cooked}; @@ -335,11 +352,9 @@ sub search { my ($symname, $symid, $ident, $refs) = $index->get_identifier_info($usage, $find, $rel_id); - $$ident[1] = $LXRng::Lang::deftypes{$$ident[1]}; + $$ident[1] = ucfirst($LXRng::Lang::deftypes{$$ident[1]}); $$ident[5] &&= $LXRng::Lang::deftypes{$$ident[5]}; - # use Data::Dumper; - # warn Dumper($symname, $symid, $ident, $refs); $template_args{'ident_res'} = {'query' => $symname, 'ident' => $ident, 'refs' => $refs}; |