7 |
use Carp qw/confess cluck carp/; |
use Carp qw/confess cluck carp/; |
8 |
use File::Slurp; |
use File::Slurp; |
9 |
use Text::Tabs; # expand, unexpand |
use Text::Tabs; # expand, unexpand |
10 |
|
use Digest::MD5 qw/md5/; |
11 |
|
|
12 |
use lib 'lib'; |
use lib 'lib'; |
13 |
|
|
197 |
sub _add_css_js { |
sub _add_css_js { |
198 |
my ( $self, $what, $content ) = @_; |
my ( $self, $what, $content ) = @_; |
199 |
|
|
200 |
|
my $md5 = md5( $content ); |
201 |
|
return if $self->{_add_css_js_seen}->{$what}->{$md5}++; |
202 |
|
|
203 |
my $tag = $what eq 'css' ? 'style' : 'script'; |
my $tag = $what eq 'css' ? 'style' : 'script'; |
204 |
my $type = $what eq 'css' ? 'text/css' : 'text/javascript'; |
my $type = $what eq 'css' ? 'text/css' : 'text/javascript'; |
205 |
my $head; |
my $head; |
207 |
my ( $package, $path, $line ) = caller(1); |
my ( $package, $path, $line ) = caller(1); |
208 |
|
|
209 |
$content = "/$content" if $content !~ m{[\n\r]} && -e $content; |
$content = "/$content" if $content !~ m{[\n\r]} && -e $content; |
210 |
if ( $content =~ $re_html ) { |
if ( $content =~ $re_html && $what ne 'js' ) { |
211 |
$head = qq| |
$head = qq| |
212 |
$content |
$content |
213 |
<!-- $type via $package at $path line $line --> |
<!-- $type via $package at $path line $line --> |
303 |
|
|
304 |
my $right = |
my $right = |
305 |
qq| |
qq| |
306 |
<span class="right"> |
<span class="frey-status-right"> |
307 |
<a title="reload $url" href="/reload$url">reload</a> |
<a title="reload $url" href="/reload$url">reload</a> |
308 |
<a title="$description" href="/exit$url" target="exit">$exit</a> |
<a title="$description" href="/exit$url" target="exit">$exit</a> |
309 |
</span> |
</span> |