159 |
|
|
160 |
our $icon_html; |
our $icon_html; |
161 |
|
|
162 |
|
sub popup { |
163 |
|
my ( $self, $name, $content, $full ) = @_; |
164 |
|
|
165 |
|
if ( ref($content) ) { |
166 |
|
$content = '<code>' . dump($content) . '</code>'; |
167 |
|
my $l = length($content); |
168 |
|
$content = qq|<span>$l bytes</span>| if ! $full && $l > $self->dump_max_bytes; |
169 |
|
} else { |
170 |
|
$content = qq|<span>$content</span>|; |
171 |
|
} |
172 |
|
|
173 |
|
warn "## popup [$name] = ", length( $content ), " bytes" if $self->debug; |
174 |
|
return qq|<span class="frey-popup">$name $content</span>\n|; |
175 |
|
} |
176 |
|
|
177 |
sub page { |
sub page { |
178 |
my $self = shift; |
my $self = shift; |
179 |
my $a = {@_}; |
my $a = {@_}; |
185 |
my $status_line = ''; |
my $status_line = ''; |
186 |
|
|
187 |
unshift @status, { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup }; |
unshift @status, { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup }; |
188 |
unshift @status, { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup }; |
# unshift @status, { 'Bookmarklets' => Frey::Bookmarklet->new->as_markup }; |
189 |
|
|
190 |
foreach my $part ( @status ) { |
foreach my $part ( @status ) { |
191 |
foreach my $name ( keys %$part ) { |
foreach my $name ( keys %$part ) { |
192 |
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|; |
|
193 |
} |
} |
194 |
} |
} |
195 |
|
|
208 |
|
|
209 |
$status_line .= $self->warnings_html; |
$status_line .= $self->warnings_html; |
210 |
|
|
211 |
|
$status_line .= $self->popup( INC => { %INC }, 1 ); |
212 |
|
|
213 |
my ($exit,$description) = ('exit','stop server'); |
my ($exit,$description) = ('exit','stop server'); |
214 |
($exit,$description) = ('restart','restart server') |
($exit,$description) = ('restart','restart server') |
215 |
if $ENV{FREY_RESTART}; # tune labels on exit link |
if $ENV{FREY_RESTART}; # tune labels on exit link |
411 |
|
|
412 |
if ( $multiline_end ) { |
if ( $multiline_end ) { |
413 |
if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) { |
if ( m{^\Q$multiline_end\E} || m{^\s.+\Q$multiline_end\E;$} ) { |
414 |
warn "## $line end of $multiline_end in '$_'\n"; |
# warn "## $line end of $multiline_end in '$_'\n"; |
415 |
undef $multiline_end; |
undef $multiline_end; |
416 |
} else { |
} else { |
417 |
warn "## $line skipped\n"; |
# warn "## $line skipped\n"; |
418 |
} |
} |
419 |
} elsif ( m{^(#*)\s+} ) { |
} elsif ( m{^(#*)\s+} ) { |
420 |
my $l = $1 ? length($1) : 0; |
my $l = $1 ? length($1) : 0; |
421 |
if ( $l > $level ) { |
if ( $l > $level ) { |
422 |
undef $multiline_end; |
undef $multiline_end; |
423 |
$multiline_end = $multiline_markers->{$1} if m{($multiline_re)$}; |
$multiline_end = $multiline_markers->{$1} if m{($multiline_re)$}; |
424 |
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; |
425 |
next; |
next; |
426 |
} |
} |
427 |
|
|