87 |
sub popup { my $self = shift; $self->popup_dropdown('popup', @_); } |
sub popup { my $self = shift; $self->popup_dropdown('popup', @_); } |
88 |
sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); } |
sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); } |
89 |
|
|
90 |
our $re_html = qr{<(?:!--.+?--|(\w+).+?/\1)>}s; # relaxed html check for one semi-valid tag |
our $re_html = qr{<(?:!--.+?--|(\w+).+?/\1|[^>]+/)>}s; # relaxed html check for one semi-valid tag |
91 |
|
|
92 |
sub popup_dropdown { |
sub popup_dropdown { |
93 |
my ( $self, $type, $name, $content, $full ) = @_; |
my ( $self, $type, $name, $content, $full ) = @_; |
98 |
|
|
99 |
$content =~ s{<span>(<code>[^<]+</code>)</span>}{$1} && $self->TODO("code wrapped in span"); |
$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; # FIXME |
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|; |
216 |
$url =~ s{\?reload=\d+}{}; |
$url =~ s{\?reload=\d+}{}; |
217 |
|
|
218 |
my $body = $a->{body}; |
my $body = $a->{body}; |
219 |
$body ||= $self->as_markup if $self->can('as_markup'); |
if ( ! $body ) { |
220 |
|
my $run = $a->{run} || 'as_markup'; |
221 |
|
warn "# no body, invoke $self->$run"; |
222 |
|
$body = $self->$run; |
223 |
|
} |
224 |
if ( $self->content_type !~ m{html} ) { |
if ( $self->content_type !~ m{html} ) { |
225 |
warn "# return only $self body ", $self->content_type; |
warn "# return only $self body ", $self->content_type; |
226 |
return $body |
return $body |
306 |
sub editor_links { |
sub editor_links { |
307 |
my ( $self, $error ) = @_; |
my ( $self, $error ) = @_; |
308 |
|
|
309 |
|
# $error =~ s[(bless\({\s+.+?\s+},\s+)("[^"]+")(\) at)][<span class="frey-dropdown">$1<code>$2</code>$3</span>]gs; # FIXME insert bless hiding back |
310 |
|
|
311 |
$error =~ s{at\s+(\S+)\s+line\s+(\d+)} |
$error =~ s{at\s+(\S+)\s+line\s+(\d+)} |
312 |
{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; |
313 |
|
|
562 |
push @backtrace, |
push @backtrace, |
563 |
qq|via $package at $path line $line|; |
qq|via $package at $path line $line|; |
564 |
} |
} |
565 |
warn "# backtrace: ", dump( @backtrace ) if @backtrace; |
#warn "# backtrace: ", dump( @backtrace ) if @backtrace; |
566 |
return @backtrace; |
return @backtrace; |
567 |
} |
} |
568 |
|
|