/[jquery]/no_pager/index.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /no_pager/index.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 22 by dpavlin, Thu Aug 17 01:08:23 2006 UTC revision 23 by dpavlin, Thu Aug 17 19:18:26 2006 UTC
# Line 136  sub get_results { Line 136  sub get_results {
136                          return $text;                          return $text;
137                  }                  }
138    
139                    my @template;
140                    open(my $t, 'result.html')  || die "result.html: $!";
141                    while(<$t>) {
142                            push @template, $_;
143                    }
144                    close($t);
145    
146                  # for each document in results                  # for each document in results
147                  for my $i ( 0 ... $nres->doc_num - 1 ) {                  for my $i ( 0 ... $nres->doc_num - 1 ) {
148    
149                          my $rdoc = $nres->get_doc($i);                          my $rdoc = $nres->get_doc($i);
   
                         $out .= '<div class="item">' .  
                                 '<h1>' . attr_regex( $rdoc, '@title' ) . '</h1>' .  
                                 '<p>' . html_snippet( $rdoc->snippet ) . '</p>' .  
                                 '<strong>' . attr_regex( $rdoc, 'source' ) . '</strong>' .  
                                 ' [' . attr_regex( $rdoc, '@size' ) . ' bytes]<br/>';  
150                          my $uri = attr_regex( $rdoc, '@uri' );                          my $uri = attr_regex( $rdoc, '@uri' );
151                          $out .=                          my $nr = $skip + $i + 1;
152                                  qq{<a href="$uri"><tt>$uri</tt></a> } .  
153                                  attr_regex( $rdoc, '@mdate' ) .                          map {
154                                  ' [' . ( $skip + $i + 1 ) . ']';                                  my $l = $_;
155                                    $l =~ s/<%(.+?)%>/eval "$1"/ge;
156                                    $out .= $l;
157                            } @template;
158    
159                  }                  }
160    
161          } else {          } else {
# Line 158  sub get_results { Line 163  sub get_results {
163          }          }
164    
165          if ($v->{page} == $v->{max_page}) {          if ($v->{page} == $v->{max_page}) {
166                  $out .= next_page('<strong>All results shown</strong>');                  $out .= next_page('<br/><strong>All results shown</strong>');
167          } else {          } else {
168                  $out .= next_page(                  $out .= next_page(
169                          '<strong>Loading results...</strong><br/>',                          '<br/><strong>Loading results...</strong><br/>',
170                          'If you are using the scroll bar, release the mouse to see more results.'                          'If you are using the scroll bar, release the mouse to see more results.'
171                  );                  );
172          }          }
# Line 196  if ($q->path_info() eq '/snippet') { Line 201  if ($q->path_info() eq '/snippet') {
201                  s/<%(.+?)%>/eval "$1"/ge;                  s/<%(.+?)%>/eval "$1"/ge;
202                  print;                  print;
203          }          }
204          close($f);          close($s);
205    
206  }  }

Legend:
Removed from v.22  
changed lines
  Added in v.23

  ViewVC Help
Powered by ViewVC 1.1.26