43 |
}, |
}, |
44 |
); |
); |
45 |
|
|
46 |
|
has 'content_type' => ( |
47 |
|
is => 'rw', |
48 |
|
isa => 'Str', |
49 |
|
default => 'text/html', |
50 |
|
); |
51 |
|
|
52 |
=head2 inline_smaller_than |
=head2 inline_smaller_than |
53 |
|
|
54 |
Inline JavaScript and CSS smaller than this size into page reducing |
Inline JavaScript and CSS smaller than this size into page reducing |
168 |
my $url = $self->request_url; |
my $url = $self->request_url; |
169 |
$url =~ s{\?reload=\d+}{}; |
$url =~ s{\?reload=\d+}{}; |
170 |
|
|
171 |
|
my $body = $a->{body} || $self->markup; |
172 |
|
return $body if $self->content_type !~ m{html}; |
173 |
|
$body ||= '<!-- no body -->'; |
174 |
|
|
175 |
my $html = join("\n", |
my $html = join("\n", |
176 |
qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|, |
qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|, |
177 |
$self->_head_html, |
$self->_head_html, |
178 |
'<title>' . ( $self->title || $a->{title} || ref($self) ) . '</title>', |
'<title>' . ( $self->title || $a->{title} || ref($self) ) . '</title>', |
179 |
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">', |
'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">', |
180 |
( $a->{head} || '' ), |
( $a->{head} || '' ), |
|
'</head><body>', |
|
|
( $a->{body} || $self->markup || '<!-- no body -->' ), |
|
181 |
qq| |
qq| |
182 |
|
</head><body> |
183 |
|
$body |
184 |
<div class="frey-status-line"> |
<div class="frey-status-line"> |
185 |
<a href="/">Frey</a> $Frey::VERSION |
<a href="/">Frey</a> $Frey::VERSION |
186 |
<a href="?reload=$reload_counter"><code>$url</code></a> |
<a href="?reload=$reload_counter"><code>$url</code></a> |