/[Frey]/trunk/lib/Frey/Web.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Web.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 856 by dpavlin, Sun Dec 14 22:47:48 2008 UTC revision 857 by dpavlin, Tue Dec 16 14:10:09 2008 UTC
# Line 116  sub popup_dropdown { Line 116  sub popup_dropdown {
116          }          }
117  }  }
118    
119  sub _inline_path {  sub _inline_path_size {
120          my ( $self, $path ) = @_;          my ( $self, $path ) = @_;
121          -s $path < $self->inline_smaller_than;          -s $path < $self->inline_smaller_than && -s $path;
122  }  }
123    
124  sub _head_html {  sub _head_html {
# Line 126  sub _head_html { Line 126  sub _head_html {
126          my $out = '';          my $out = '';
127          foreach my $path ( @head ) {          foreach my $path ( @head ) {
128                  $path =~ s!^/!!;                  $path =~ s!^/!!;
129                    my $size = $self->_inline_path_size( $path );
130                  if ( $path =~ m/\.js$/ ) {                  if ( $path =~ m/\.js$/ ) {
131                          $out .= $self->_inline_path( $path ) ?                          $out .= $size ?
132                                  qq|<script type="text/javascript">\n/* inline $path */\n\n| . read_file($path) . qq|\n</script>| :                                  qq|<script type="text/javascript">\n/* inline $path $size bytes */\n\n| . read_file($path) . qq|\n</script>| :
133                                  qq|<script type="text/javascript" src="/$path"></script>|;                                  qq|<script type="text/javascript" src="/$path"></script>|;
134                  } elsif ( $path =~ m/\.css$/ ) {                  } elsif ( $path =~ m/\.css$/ ) {
135                          $out .= $self->_inline_path( $path ) ?                          $out .= $size ?
136                                  qq|<style type="text/css">\n/* inline $path */\n\n| . read_file( $path ) . qq|\n</style>| :                                  qq|<style type="text/css">\n/* inline $path $size bytes */\n\n| . read_file( $path ) . qq|\n</style>| :
137                                  qq|<link type="text/css" rel="stylesheet" href="/$path" media="screen">|;                                  qq|<link type="text/css" rel="stylesheet" href="/$path" media="screen">|;
138                  } elsif ( $path =~ m{<.+>}s ) {                  } elsif ( $path =~ m{<.+>}s ) {
139                          $out .= $path;                          $out .= $path;

Legend:
Removed from v.856  
changed lines
  Added in v.857

  ViewVC Help
Powered by ViewVC 1.1.26