--- trunk/lib/Frey/Web.pm 2009/01/10 18:53:15 986 +++ trunk/lib/Frey/Web.pm 2009/04/27 18:43:18 1065 @@ -7,6 +7,7 @@ use Carp qw/confess cluck carp/; use File::Slurp; use Text::Tabs; # expand, unexpand +use Digest::MD5 qw/md5/; use lib 'lib'; @@ -196,6 +197,9 @@ sub _add_css_js { my ( $self, $what, $content ) = @_; + my $md5 = md5( $content ); + return if $self->{_add_css_js_seen}->{$what}->{$md5}++; + my $tag = $what eq 'css' ? 'style' : 'script'; my $type = $what eq 'css' ? 'text/css' : 'text/javascript'; my $head; @@ -203,7 +207,7 @@ my ( $package, $path, $line ) = caller(1); $content = "/$content" if $content !~ m{[\n\r]} && -e $content; - if ( $content =~ $re_html ) { + if ( $content =~ $re_html && $what ne 'js' ) { $head = qq| $content @@ -299,7 +303,7 @@ my $right = qq| - + reload $exit