1 |
package Frey::Web; |
package Frey::Web; |
2 |
use Moose::Role; |
use Moose::Role; |
3 |
|
|
4 |
|
#with 'Frey::Escape'; |
5 |
|
|
6 |
use Frey::Types; |
use Frey::Types; |
7 |
|
|
8 |
use Continuity::Widget::DomNode; |
use Continuity::Widget::DomNode; |
129 |
foreach my $name ( keys %$part ) { |
foreach my $name ( keys %$part ) { |
130 |
my $content = $part->{$name}; |
my $content = $part->{$name}; |
131 |
if ( ref($content) ) { |
if ( ref($content) ) { |
132 |
$content = '<code>' . dump( $content ) . '</code>'; |
$content = '<code>' . dump($content) . '</code>'; |
133 |
|
my $l = length($content); |
134 |
|
$content = qq|<span>$l bytes</span>| if $l > 1024; |
135 |
} else { |
} else { |
136 |
$content = qq|<span>$content</span>|; |
$content = qq|<span>$content</span>|; |
137 |
} |
} |
138 |
warn "### part [$name] = ", length( $content ), " bytes" if $self->debug; |
warn "### part [$name] = ", length( $content ), " bytes" if $self->debug; |
139 |
$status_line .= qq|<span class="frey-popup">$name $content</span>|; |
$status_line .= qq|<span class="frey-popup">$name $content</span>\n|; |
140 |
} |
} |
141 |
} |
} |
142 |
|
|
164 |
} |
} |
165 |
|
|
166 |
sub error { |
sub error { |
167 |
my ( $self, $error ) = @_; |
my $self = shift; |
168 |
|
my $error = join(" ", @_); |
169 |
my ($package, $filename, $line) = caller; |
my ($package, $filename, $line) = caller; |
170 |
$error .= " at $filename line $line"; |
$error .= " at $filename line $line"; |
171 |
warn "WARN: $error\n"; |
warn "WARN: $error\n"; |