/[Frey]/trunk/lib/Frey/View/NoPager.pm
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 /trunk/lib/Frey/View/NoPager.pm

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

revision 842 by dpavlin, Tue Dec 9 20:31:27 2008 UTC revision 843 by dpavlin, Sun Dec 14 23:26:54 2008 UTC
# Line 17  has search => ( Line 17  has search => (
17          default => '',          default => '',
18  );  );
19    
20  has 'sort' => (  has 'on_page' => (      # FIXME Frey::Web->page, sigh!
21          is => 'rw',          is => 'rw',
22          isa => 'Str',          isa => 'Int',
23            default => 1,
24  );  );
25    
26  has page => (  has 'sort' => (
27          is => 'rw',          is => 'rw',
28          isa => 'Int',          isa => 'Str',
         default => 1,  
29  );  );
30    
31  our $v = {  our $v = {
# Line 49  sub json { Line 49  sub json {
49    
50  sub results_as_markup {  sub results_as_markup {
51          my $self = shift;          my $self = shift;
         my $p = {@_};  
52    
53          my ($search,$page) = ( $p->{search} , $p->{page} );          my ($search,$page) = ( $self->search , $self->on_page );
54    
55          sub next_page {          sub next_page {
56                  my ($self) = @_;                  my ($self) = @_;
# Line 86  sub results_as_markup { Line 85  sub results_as_markup {
85          $cond->set_phrase( $search );          $cond->set_phrase( $search );
86          $cond->set_max( $on_page * $page );     ## FIXME * $page is needed by hest 1.3.8          $cond->set_max( $on_page * $page );     ## FIXME * $page is needed by hest 1.3.8
87          $cond->set_skip( $skip );          $cond->set_skip( $skip );
88          $cond->set_order( $p->{sort} ) if ($p->{sort});          $cond->set_order( $self->sort ) if $self->sort;
89    
90          my $nres = $node->search($cond, ( $self->config->{estraier}->{depth} || 0 ) );          my $nres = $node->search($cond, ( $self->config->{estraier}->{depth} || 0 ) );
91    
# Line 188  sub as_markup { Line 187  sub as_markup {
187          my ($self) = @_;          my ($self) = @_;
188    
189          $self->add_css('static/Frey/NoPager.css');          $self->add_css('static/Frey/NoPager.css');
190          $self->add_css('static/Frey/NoPager.js');          $self->add_js ('static/Frey/NoPager.js');
191    
192          $self->add_js(qq|          $self->add_js(qq|
193                  $(document).ready( function() {                  \$(document).ready( function() {
194                          $.log.info('hook onchange to #search_form' );                          \$.log.info('hook onchange to #search_form' );
195                          $('#search_form').change( function() {                          \$('#search_form').change( function() {
196                                  //logDebug('submit #search_form');                                  //logDebug('submit #search_form');
197                                  this.submit();                                  this.submit();
198                          });                          });

Legend:
Removed from v.842  
changed lines
  Added in v.843

  ViewVC Help
Powered by ViewVC 1.1.26