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

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

revision 518 by dpavlin, Tue Nov 25 14:58:59 2008 UTC revision 519 by dpavlin, Tue Nov 25 17:15:18 2008 UTC
# Line 20  has 'head' => ( Line 20  has 'head' => (
20          default => sub { [ 'static/frey.css' ] },          default => sub { [ 'static/frey.css' ] },
21  );  );
22    
 has 'status' => (  
         is => 'rw',  
         isa => 'ArrayRef[HashRef[Str]]',  
         lazy => 1,  
         default => sub { [  
 #               { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup },  
 #               { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup },  
         ] },  
 );  
   
23  has 'request_url' => (  has 'request_url' => (
24          is => 'rw',          is => 'rw',
25          isa => 'Uri', coerce => 1,          isa => 'Uri', coerce => 1,
# Line 149  our $reload_counter = 0; Line 139  our $reload_counter = 0;
139    
140  =cut  =cut
141    
142    our @status;
143    sub status { @status };
144    
145  sub page {  sub page {
146          my $self = shift;          my $self = shift;
147          my $a = {@_};          my $a = {@_};
148    
149            warn "## page ",dump($a);
150    
151          $reload_counter++;          $reload_counter++;
152    
153          my $status_line = '';          my $status_line = '';
154          foreach my $part ( @{ $self->status } ) {  
155            unshift @status, { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup };
156            unshift @status, { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup };
157    
158            foreach my $part ( @status ) {
159                  foreach my $name ( keys %$part ) {                  foreach my $name ( keys %$part ) {
160                          my $content = $part->{$name};                          my $content = $part->{$name};
161                          if ( ref($content) ) {                          if ( ref($content) ) {
# Line 212  sub page { Line 211  sub page {
211          my $right =          my $right =
212                  qq|                  qq|
213                          <span class="right">                          <span class="right">
214                          <a title="reload"  href="/reload$url"><code>$url</code></a>                          <a title="reload $url"  href="/reload$url">reload</a>
215                          <a title="$description" href="/exit$url">$exit</a>                          <a title="$description" href="/exit$url">$exit</a>
216                          </span>                          </span>
217                  |;                  |;
# Line 255  Create HTML editor link with optional li Line 254  Create HTML editor link with optional li
254  sub editor {  sub editor {
255          my ( $self, $class, $line, $title ) = @_;          my ( $self, $class, $line, $title ) = @_;
256          confess "need class" unless $class;          confess "need class" unless $class;
257          $line ||= 1;          if ( ! defined $title ) {
258                    $title  = "edit $class";
259                    $title .= " line $line" if $line;
260            }
261            $line  ||= 1;
262          qq|<a target="editor" href="/editor+$class+$line"| .          qq|<a target="editor" href="/editor+$class+$line"| .
263          ( $title ? qq| title="$title"| : '' ) .          ( $title ? qq| title="$title"| : '' ) .
264          qq|>$class</a>|;          qq|>$class</a>|;
# Line 298  sub error { Line 301  sub error {
301    
302  sub add_status {  sub add_status {
303          my ( $self, $data ) = @_;          my ( $self, $data ) = @_;
304          push @{ $self->status }, $data;          push @status, $data;
305    }
306    
307    sub clean_status {
308            @status = ();
309    }
310    
311    sub status_parts {
312            warn "## status parts ", dump( map { keys %$_ } @status );
313  }  }
314    
315  sub DEMOLISH {  sub DEMOLISH {
316          my ( $self ) = @_;          my ( $self ) = @_;
317          cluck "## DEMOLISH status ", $#{ $self->status } + 1, " elements ", dump( map { keys %$_ } @{ $self->status } );          cluck "## DEMOLISH status ", $#status + 1, " elements ", dump( map { keys %$_ } @status ) if @status;
318  }  }
319    
320  1;  1;

Legend:
Removed from v.518  
changed lines
  Added in v.519

  ViewVC Help
Powered by ViewVC 1.1.26