17 |
use Frey::SVK; |
use Frey::SVK; |
18 |
|
|
19 |
our @head; |
our @head; |
20 |
|
sub head { @head } |
21 |
|
|
22 |
has 'request_url' => ( |
has 'request_url' => ( |
23 |
is => 'rw', |
is => 'rw', |
80 |
$dump =~ s{(\n[^\n]{$width})([^\n]+?)([^\n]{5})}{\n$1...$3}gs; |
$dump =~ s{(\n[^\n]{$width})([^\n]+?)([^\n]{5})}{\n$1...$3}gs; |
81 |
$dump = $self->html_escape( $dump ); |
$dump = $self->html_escape( $dump ); |
82 |
$dump =~ s{\Q...\E}{…}gs; |
$dump =~ s{\Q...\E}{…}gs; |
83 |
|
# $dump =~ $self->editor_links( $dump ); # FIXME include this |
84 |
return "<code>$dump</code>"; |
return "<code>$dump</code>"; |
85 |
} |
} |
86 |
|
|
96 |
|
|
97 |
$content = qq|<span>$content</span>| unless $content =~ m{^\s*<(span|a|code).+?/\1>\s*}; |
$content = qq|<span>$content</span>| unless $content =~ m{^\s*<(span|a|code).+?/\1>\s*}; |
98 |
|
|
99 |
|
$content =~ s{<span>(<code>[^<]+</code>)</span>}{$1} && $self->TODO("code wrapped in span"); |
100 |
|
|
101 |
warn "## $type [$name] = ", length( $content ), " bytes" if $self->debug; |
warn "## $type [$name] = ", length( $content ), " bytes" if $self->debug; |
102 |
|
|
103 |
if ( $name =~ m{::} && $name !~ $re_html ) { |
if ( $name =~ m{::} && $name !~ $re_html ) { |
170 |
my ( $package, $path, $line ) = caller; |
my ( $package, $path, $line ) = caller; |
171 |
$self->add_head( qq| |
$self->add_head( qq| |
172 |
<style type="text/css"> |
<style type="text/css"> |
173 |
/* via package $package at $path line $line */ |
/* via $package at $path line $line */ |
174 |
$css |
$css |
175 |
</style> |
</style> |
176 |
| ); |
| ); |
204 |
|
|
205 |
my $status_line = ''; |
my $status_line = ''; |
206 |
|
|
|
unshift @status, { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup }; |
|
|
# unshift @status, { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup }; |
|
|
unshift @status, { 'INC' => Frey::INC->new->as_markup }; |
|
|
|
|
207 |
foreach my $part ( @status ) { |
foreach my $part ( @status ) { |
208 |
foreach my $name ( keys %$part ) { |
foreach my $name ( keys %$part ) { |
209 |
$status_line .= $self->popup( $name, $part->{$name} ); |
$status_line .= $self->popup( $name, $part->{$name} ); |
303 |
$error =~ s{at\s+(\S+)\s+line\s+(\d+)} |
$error =~ s{at\s+(\S+)\s+line\s+(\d+)} |
304 |
{at <a target="editor" href="/editor+$1+$2">$1</a> line $2}gsm; |
{at <a target="editor" href="/editor+$1+$2">$1</a> line $2}gsm; |
305 |
|
|
306 |
$error =~ s{(via package ")([\w:]+)(")} |
$error =~ s{(via (?:package) "?)([\w:]+)("?)} |
307 |
{$1<a target="editor" href="/editor+$2+1">$2</a>$3}gsm; |
{$1<a target="editor" href="/editor+$2+1">$2</a>$3}gsm; |
308 |
|
|
309 |
return $error; |
return $error; |
328 |
|
|
329 |
=head2 add_status |
=head2 add_status |
330 |
|
|
331 |
$self->add_status( name => { some => 'data' } ); |
$self->add_status( { name => { some => 'data' } } ); |
332 |
|
|
333 |
$self->add_status( "append to last status popup" ); |
$self->add_status( "append to last status popup" ); |
334 |
|
|
336 |
|
|
337 |
sub add_status { |
sub add_status { |
338 |
my ( $self, $data ) = @_; |
my ( $self, $data ) = @_; |
339 |
|
push @status, { 'X' => [ $self->backtrace ] }; |
340 |
if ( ref($data) ) { |
if ( ref($data) ) { |
341 |
push @status, $data; |
push @status, $data; |
342 |
} else { |
} else { |
343 |
$status[ $#status ]->{added} = $data; |
if ( defined $status[ $#status ] ) { |
344 |
|
$status[ $#status ]->{ '+' } = $data; |
345 |
|
} else { |
346 |
|
push @status, { '+' => $data }; |
347 |
|
} |
348 |
} |
} |
349 |
} |
} |
350 |
|
|
359 |
sub clean_status { |
sub clean_status { |
360 |
my ($self) = shift; |
my ($self) = shift; |
361 |
@head = ( 'static/frey.css' ); |
@head = ( 'static/frey.css' ); |
362 |
@status = (); |
@status = ( |
363 |
|
{ 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup }, |
364 |
|
{ 'Bookmarklets' => Frey::Bookmarklet->new->as_markup }, |
365 |
|
{ 'INC' => Frey::INC->new->as_markup }, |
366 |
|
); |
367 |
$icon_html = ''; |
$icon_html = ''; |
368 |
} |
} |
369 |
|
|
532 |
) = caller($_) or last; |
) = caller($_) or last; |
533 |
|
|
534 |
push @backtrace, |
push @backtrace, |
535 |
qq|via package $package at $path line $line|; |
qq|via $package at $path line $line|; |
536 |
} |
} |
537 |
warn "# backtrace: ", dump( @backtrace ) if @backtrace; |
warn "# backtrace: ", dump( @backtrace ) if @backtrace; |
538 |
return @backtrace; |
return @backtrace; |