/[Frey]/branches/zimbardo/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 /branches/zimbardo/lib/Frey/Web.pm

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

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

Legend:
Removed from v.859  
changed lines
  Added in v.865

  ViewVC Help
Powered by ViewVC 1.1.26