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', |
102 |
|
|
103 |
if ( $name =~ m{::} && $name !~ $re_html ) { |
if ( $name =~ m{::} && $name !~ $re_html ) { |
104 |
return qq|<a class="frey-$type" target="$name" href="/$name">$name $content</a>\n|; |
return qq|<a class="frey-$type" target="$name" href="/$name">$name $content</a>\n|; |
105 |
|
} elsif ( $name =~ s{^\s*(<a)\s+}{$1 class="frey-$type"} ) { |
106 |
|
return qq|$name $content\n|; |
107 |
} else { |
} else { |
108 |
return qq|<span class="frey-$type">$name $content</span>\n|; |
return qq|<span class="frey-$type">$name $content</span>\n|; |
109 |
} |
} |
461 |
$level ||= $self->debug, |
$level ||= $self->debug, |
462 |
my $path = $self->log_path; |
my $path = $self->log_path; |
463 |
|
|
464 |
my $warnings; |
my $max = 50; |
465 |
|
my $pos = 0; |
466 |
|
my @warnings = ( '' x $max ); # XXX circualar buffer for 50 lines |
467 |
my $line = 0; |
my $line = 0; |
468 |
my $multiline_end; |
my $multiline_end; |
469 |
|
|
474 |
|
|
475 |
my $style = ''; |
my $style = ''; |
476 |
|
|
477 |
|
=for filter |
478 |
|
|
479 |
if ( $multiline_end ) { |
if ( $multiline_end ) { |
480 |
if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) { |
if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) { |
481 |
# warn "## $line end of $multiline_end in '$_'\n"; |
# warn "## $line end of $multiline_end in '$_'\n"; |
492 |
next; |
next; |
493 |
} |
} |
494 |
|
|
495 |
|
=cut |
496 |
|
if ( m{^(#*)\s+} ) { # FIXME |
497 |
|
|
498 |
$style = $warn_colors->{$1} |
$style = $warn_colors->{$1} |
499 |
? ' style="color:' . $warn_colors->{$1} . '"' |
? ' style="color:' . $warn_colors->{$1} . '"' |
500 |
: ''; |
: ''; |
505 |
$msg = substr( $msg, 0, $self->html_dump_width ); |
$msg = substr( $msg, 0, $self->html_dump_width ); |
506 |
$spacer = '…' |
$spacer = '…' |
507 |
} |
} |
508 |
$msg =~ s{^\s}{ }g; |
$warnings[ $pos++ % $max ] |
509 |
$warnings .= qq|<tt$style>$msg</tt>$spacer<small><a target="editor" href="/editor+$path+$line">+$line</a></small><br/>|; |
= $msg |
510 |
|
# = ( $style ? qq|<span$style>$msg</span>| : $msg ) |
511 |
|
. $spacer |
512 |
|
. qq|<a target="editor" href="/editor+$path+$line" style="float: right;">+$line</a><br/>|; |
513 |
# FIXME <tt> should be <code> but CSS hates me |
# FIXME <tt> should be <code> but CSS hates me |
514 |
} |
} |
515 |
} |
} |
516 |
close($log) || die "can't close $path: $!"; |
close($log) || die "can't close $path: $!"; |
517 |
|
|
518 |
|
my $size = -s $path; |
519 |
|
|
520 |
|
my $warnings = join('', |
521 |
|
map { $warnings[ ( $pos + $_ ) % $max ] || '' } 0 .. $max |
522 |
|
); |
523 |
|
|
524 |
|
my $s = length($warnings); |
525 |
|
|
526 |
return |
return |
527 |
qq|<span class="frey-popup"><a target="editor" href="/editor+$path+$line" title="open $path level $level">warn</a><span>| |
# need to wrap into span so we can have links in warnings |
528 |
. $self->editor_links( $warnings ) |
qq|<span class="frey-popup"><a target="editor" href="/editor+$path+$line" title="$path \| $size -> $s bytes \| $line -> $pos lines \| level $level">warn</a><code>| |
529 |
. qq|</span></span>| |
. $warnings |
530 |
|
# . $self->editor_links( $warnings ) |
531 |
|
. qq|</code></span></a>| |
532 |
; |
; |
533 |
} |
} |
534 |
|
|