/[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 15 by dpavlin, Wed Aug 16 21:34:37 2006 UTC revision 17 by dpavlin, Wed Aug 16 22:26:45 2006 UTC
# Line 27  my $json; Line 27  my $json;
27    
28  #warn "config = ", dump($config);  #warn "config = ", dump($config);
29    
30    sub json {
31            return
32            '<textarea id="json" style="display:none">' .
33            $q->escapeHTML( JSON::Syck::Dump( $v ) ) .
34            '</textarea>';
35    }
36    
37  sub get_results {  sub get_results {
38          my ($search, $page) = @_;          my ($search, $page) = @_;
39    
40          if (! $search) {          warn "get_results( $search , $page )\n";
41    
42            if (! $search || $search =~ m/^\s*$/) {
43                  $v->{status} = 'Enter search query';                  $v->{status} = 'Enter search query';
44                  return;                  return('', json);
45          }          }
46    
47          if (! $page) {          if (! $page) {
48                  $v->{status} = 'Error: no page number?';                  $v->{status} = 'Error: no page number?';
49                  return;                  return('', json);
50          }          }
51    
52          $search = join(" AND ", split(/\s+/, $search)) unless ($search =~ m/(?:AND|OR|\[|\])/);          $search = join(" AND ", split(/\s+/, $search)) unless ($search =~ m/(?:AND|OR|\[|\])/);
# Line 119  sub get_results { Line 128  sub get_results {
128                  $out .= 'error: ' . $node->status;                  $out .= 'error: ' . $node->status;
129          }          }
130    
131          $json = '<textarea id="json" style="display:none">' .          return ($out,json);
                 $q->escapeHTML( JSON::Syck::Dump( $v ) ) .  
                 '</textarea>';  
   
         return ($out,$json);  
132    
133  }  }
134    
# Line 139  if ($q->path_info() eq '/snippet') { Line 144  if ($q->path_info() eq '/snippet') {
144    
145  } else {  } else {
146    
147          my ($get_results, $json) = get_results( $q->param('search'), 1 );          my ($get_results,$json);
148    
149            if ($q->param('search')) {
150                    ($get_results, $json) = get_results( $q->param('search'), 1 );
151            } else {
152                    $v->{status} = 'Enter search query';
153                    ($get_results, $json) = ('', json);
154            }
155    
156          my $f = $q->path_info;          my $f = $q->path_info;
157          $f =~ s/\W+//g;          $f =~ s/\W+//g;

Legend:
Removed from v.15  
changed lines
  Added in v.17

  ViewVC Help
Powered by ViewVC 1.1.26