/[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 859 by dpavlin, Tue Dec 16 14:26:23 2008 UTC revision 892 by dpavlin, Wed Dec 24 21:32:14 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;          return unless defined $path;
122            warn "# _inline $path";
123            -e $path && -s $path < $self->inline_smaller_than && -s $path;
124  }  }
125    
126  sub _head_html {  sub _head_html {
# Line 126  sub _head_html { Line 128  sub _head_html {
128          my $out = '';          my $out = '';
129          foreach my $path ( @head ) {          foreach my $path ( @head ) {
130                  $path =~ s!^/!!;                  $path =~ s!^/!!;
                 my $size = $self->_inline_path_size( $path );  
131                  if ( $path =~ m/\.js$/ ) {                  if ( $path =~ m/\.js$/ ) {
132                          $out .= $size ?                          my $size;
133                            $out .= $size = _inline( $path ) ?
134                                  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>| :
135                                  qq|<script type="text/javascript" src="/$path"></script>|;                                  qq|<script type="text/javascript" src="/$path"></script>|;
136                  } elsif ( $path =~ m/\.css$/ ) {                  } elsif ( $path =~ m/\.css$/ ) {
137                          $out .= $size ?                          my $size;
138                            $out .= $size = _inline( $path ) ?
139                                  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>| :
140                                  qq|<link type="text/css" rel="stylesheet" href="/$path" media="screen">|;                                  qq|<link type="text/css" rel="stylesheet" href="/$path" media="screen">|;
141                  } elsif ( $path =~ m{<.+>}s ) {                  } elsif ( $path =~ m{<.+>}s ) {
# Line 246  sub page { Line 249  sub page {
249          my $self = shift;          my $self = shift;
250          my $a = {@_};          my $a = {@_};
251    
         warn "## page ",dump($a);  
   
252          $reload_counter++;          $reload_counter++;
253    
254          my $status_line = '';          my $status_line = '';

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

  ViewVC Help
Powered by ViewVC 1.1.26