/[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 535 by dpavlin, Wed Nov 26 16:17:17 2008 UTC revision 540 by dpavlin, Wed Nov 26 18:02:38 2008 UTC
# Line 12  use File::Slurp; Line 12  use File::Slurp;
12    
13  use Frey::Bookmarklet;  use Frey::Bookmarklet;
14  use Frey::ClassBrowser;  use Frey::ClassBrowser;
15    use Frey::INC;
16    
17  use Frey::SVK;  use Frey::SVK;
18    
19  has 'head' => (  has 'head' => (
# Line 159  sub status { @status }; Line 161  sub status { @status };
161    
162  our $icon_html;  our $icon_html;
163    
164    sub popup {
165            my ( $self, $name, $content, $full ) = @_;
166    
167            if ( ref($content) ) {
168                    $content = '<code>' . dump($content) . '</code>';
169                    my $l = length($content);
170                    $content = qq|<span>$l bytes</span>| if ! $full && $l > $self->dump_max_bytes;
171            } else {
172                    $content = qq|<span>$content</span>|;
173            }
174    
175            warn "## popup [$name] = ", length( $content ), " bytes" if $self->debug;
176            return qq|<span class="frey-popup">$name $content</span>\n|;
177    }
178    
179  sub page {  sub page {
180          my $self = shift;          my $self = shift;
181          my $a = {@_};          my $a = {@_};
# Line 170  sub page { Line 187  sub page {
187          my $status_line = '';          my $status_line = '';
188    
189          unshift @status, { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup };          unshift @status, { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup };
190          unshift @status, { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup };  #       unshift @status, { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup };
191            unshift @status, { 'INC' => Frey::INC->new->as_markup };
192    
193          foreach my $part ( @status ) {          foreach my $part ( @status ) {
194                  foreach my $name ( keys %$part ) {                  foreach my $name ( keys %$part ) {
195                          my $content = $part->{$name};                          $status_line .= $self->popup( $name, $part->{$name} );
                         if ( ref($content) ) {  
                                 $content = '<code>' . dump($content) . '</code>';  
                                 my $l = length($content);  
                                 $content = qq|<span>$l bytes</span>| if $l > $self->dump_max_bytes;  
                         } else {  
                                 $content = qq|<span>$content</span>|;  
                         }  
                         warn "### part [$name] = ", length( $content ), " bytes" if $self->debug;  
                         $status_line .= qq|<span class="frey-popup">$name $content</span>\n|;  
196                  }                  }
197          }          }
198    
# Line 403  sub warnings_html { Line 412  sub warnings_html {
412    
413                  if ( $multiline_end ) {                  if ( $multiline_end ) {
414                          if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) {                          if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) {
415                                  warn "## $line end of $multiline_end in '$_'\n";  #                               warn "## $line end of $multiline_end in '$_'\n";
416                                  undef $multiline_end;                                  undef $multiline_end;
417                          } else {                          } else {
418                                  warn "## $line skipped\n";  #                               warn "## $line skipped\n";
419                          }                          }
420                  } elsif ( m{^(#*)\s+} ) {                  } elsif ( m{^(#*)\s+} ) {
421                          my $l = $1 ? length($1) : 0;                          my $l = $1 ? length($1) : 0;
422                          if ( $l > $level ) {                          if ( $l > $level ) {
423                                  undef $multiline_end;                                  undef $multiline_end;
424                                  $multiline_end = $multiline_markers->{$1} if m{($multiline_re)$};                                  $multiline_end = $multiline_markers->{$1} if m{($multiline_re)$};
425                                  warn "## $line start $1 .. $multiline_end level $l > $level for '$_'\n" if $multiline_end;  #                               warn "## $line start $1 .. $multiline_end level $l > $level for '$_'\n" if $multiline_end;
426                                  next;                                  next;
427                          }                          }
428    

Legend:
Removed from v.535  
changed lines
  Added in v.540

  ViewVC Help
Powered by ViewVC 1.1.26