25 |
lazy => 1, |
lazy => 1, |
26 |
default => sub { [ |
default => sub { [ |
27 |
{ 'Bookmarklets' => Frey::Bookmarklet->new->markup }, |
{ 'Bookmarklets' => Frey::Bookmarklet->new->markup }, |
28 |
{ 'ClassBrowser' => Frey::ClassBrowser->new->markup }, |
{ 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->markup }, |
29 |
] }, |
] }, |
30 |
); |
); |
31 |
|
|
35 |
default => '/', |
default => '/', |
36 |
); |
); |
37 |
|
|
38 |
|
has 'title' => ( |
39 |
|
is => 'rw', |
40 |
|
isa => 'Str', |
41 |
|
lazy => 1, |
42 |
|
default => sub { |
43 |
|
my ($self) = @_; |
44 |
|
ref($self); |
45 |
|
}, |
46 |
|
); |
47 |
|
|
48 |
=head2 inline_smaller_than |
=head2 inline_smaller_than |
49 |
|
|
50 |
Inline JavaScript and CSS smaller than this size into page reducing |
Inline JavaScript and CSS smaller than this size into page reducing |
136 |
|
|
137 |
my $status_line = ''; |
my $status_line = ''; |
138 |
foreach my $part ( @{ $self->status } ) { |
foreach my $part ( @{ $self->status } ) { |
139 |
confess "part not hash ",dump( $part ) unless ref($part) eq 'HASH'; |
if ( ref($part) ne 'HASH' ) { |
140 |
|
warn "part not hash ",dump( $part ) ; |
141 |
|
#$self->status( $part ); |
142 |
|
next; |
143 |
|
} |
144 |
foreach my $name ( keys %$part ) { |
foreach my $name ( keys %$part ) { |
145 |
my $content = $part->{$name}; |
my $content = $part->{$name}; |
146 |
if ( ref($content) ) { |
if ( ref($content) ) { |
155 |
} |
} |
156 |
} |
} |
157 |
|
|
158 |
|
my $url = $self->request_url; |
159 |
|
$url =~ s{\?reload=\d+}{}; |
160 |
|
|
161 |
my $html = join("\n", |
my $html = join("\n", |
162 |
qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|, |
qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|, |
163 |
$self->_head_html, |
$self->_head_html, |
164 |
'<title>' . ( $a->{title} || ref($self) ) . '</title>', |
'<title>' . ( $self->title || $a->{title} || ref($self) ) . '</title>', |
165 |
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">', |
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">', |
166 |
( $a->{head} || '' ), |
( $a->{head} || '' ), |
167 |
'</head><body>', |
'</head><body>', |
168 |
( $a->{body} || '<!-- no body -->' ), |
( $a->{body} || $self->markup || '<!-- no body -->' ), |
169 |
qq| |
qq| |
170 |
<div class="frey-status-line"> |
<div class="frey-status-line"> |
171 |
<a href="/">Frey</a> $Frey::VERSION |
<a href="/">Frey</a> $Frey::VERSION |
172 |
<a href="?reload=$reload_counter"><code>| . $self->request_url . qq|</code></a> |
<a href="?reload=$reload_counter"><code>$url</code></a> |
173 |
$status_line |
$status_line |
174 |
</div> |
</div> |
175 |
</body></html> |
</body></html> |