/[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 444 by dpavlin, Wed Nov 19 02:52:42 2008 UTC revision 446 by dpavlin, Wed Nov 19 03:11:11 2008 UTC
# Line 1  Line 1 
1  package Frey::Web;  package Frey::Web;
2  use Moose::Role;  use Moose::Role;
3    
 #with 'Frey::Escape';  
   
4  use Frey::Types;  use Frey::Types;
5    
6  use Continuity::Widget::DomNode;  use Continuity::Widget::DomNode;
# Line 81  sub _head_html { Line 79  sub _head_html {
79                          $out .= $self->_inline_path( $path ) ?                          $out .= $self->_inline_path( $path ) ?
80                                  qq|<!-- $path --><style type="text/css">\n| . read_file( $path ) . qq|\n</style>| :                                  qq|<!-- $path --><style type="text/css">\n| . read_file( $path ) . qq|\n</style>| :
81                                  qq|<link type="text/css" rel="stylesheet" href="/$path" media="screen">|;                                  qq|<link type="text/css" rel="stylesheet" href="/$path" media="screen">|;
82                  } elsif ( $path =~ m{<.+>} ) {                  } elsif ( $path =~ m{<.+>}s ) {
83                          $out .= $path;                          $out .= $path;
84                  } else {                  } else {
85                          confess "don't know how to render $path";                          confess "don't know how to render $path";
# Line 97  sub _head_html { Line 95  sub _head_html {
95    
96    my $size = $o->add_head( 'path/to/external.css' );    my $size = $o->add_head( 'path/to/external.css' );
97    
98      $o->add_head( '<!-- html content -->' );
99    
100  =cut  =cut
101    
102  sub add_head {  sub add_head {
# Line 104  sub add_head { Line 104  sub add_head {
104          return if ! defined $path || $path eq '';          return if ! defined $path || $path eq '';
105          $path =~ s!^/!!;          $path =~ s!^/!!;
106    
107          if ( $path =~ m{<.*>} ) {          if ( $path =~ m{<.*>}s ) {
108                  push @{ $self->head }, $path;                  push @{ $self->head }, $path;
109          } elsif ( -e $path ) {          } elsif ( -e $path ) {
110                  if ( $path =~ m/\.(?:js|css)$/ ) {                  if ( $path =~ m/\.(?:js|css)$/ ) {

Legend:
Removed from v.444  
changed lines
  Added in v.446

  ViewVC Help
Powered by ViewVC 1.1.26