--- trunk/lib/Frey/Web.pm 2008/12/16 14:26:23 859 +++ trunk/lib/Frey/Web.pm 2009/01/02 13:22:13 908 @@ -116,9 +116,11 @@ } } -sub _inline_path_size { +sub _inline { my ( $self, $path ) = @_; - -s $path < $self->inline_smaller_than && -s $path; + return unless defined $path; + warn "# _inline $path"; + -e $path && -s $path < $self->inline_smaller_than && -s $path; } sub _head_html { @@ -126,13 +128,14 @@ my $out = ''; foreach my $path ( @head ) { $path =~ s!^/!!; - my $size = $self->_inline_path_size( $path ); if ( $path =~ m/\.js$/ ) { - $out .= $size ? + my $size; + $out .= $size = _inline( $path ) ? qq|| : qq||; } elsif ( $path =~ m/\.css$/ ) { - $out .= $size ? + my $size; + $out .= $size = _inline( $path ) ? qq|| : qq||; } elsif ( $path =~ m{<.+>}s ) { @@ -184,14 +187,14 @@ my ( $package, $path, $line ) = caller(1); - if ( $content =~ m{\.(js|css)} ) { - $content = "/$content" if -e $content; - if ( $content =~ $re_html ) { - $head = qq| - $content - - |; - } elsif ( $what eq 'js' ) { + $content = "/$content" if -e $content; + if ( $content =~ $re_html ) { + $head = qq| + $content + + |; + } elsif ( $content =~ m{^(/|https?://)} ) { + if ( $what eq 'js' ) { $head = qq| <$tag type="$type" src="$content"> /* $what via $package at $path line $line */ @@ -246,8 +249,6 @@ my $self = shift; my $a = {@_}; - warn "## page ",dump($a); - $reload_counter++; my $status_line = '';