/[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 857 by dpavlin, Tue Dec 16 14:10:09 2008 UTC revision 859 by dpavlin, Tue Dec 16 14:26:23 2008 UTC
# Line 94  sub html_dump { Line 94  sub html_dump {
94  sub popup    { my $self = shift; $self->popup_dropdown('popup',    @_); }  sub popup    { my $self = shift; $self->popup_dropdown('popup',    @_); }
95  sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); }  sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); }
96    
97  our $re_html = qr{<(?:!--.+?--|(\w+).+?/\1|[^>]+/?)>}s; # relaxed html check for one semi-valid tag  our $re_html = qr{<(?:!--|(\w+)|[^>]+)/?>}s; # relaxed html check for one semi-valid tag
98    
99  sub popup_dropdown {  sub popup_dropdown {
100          my ( $self, $type, $name, $content, $full ) = @_;          my ( $self, $type, $name, $content, $full ) = @_;
# Line 186  sub _add_css_js { Line 186  sub _add_css_js {
186    
187          if ( $content =~ m{\.(js|css)} ) {          if ( $content =~ m{\.(js|css)} ) {
188                  $content = "/$content" if -e $content;                  $content = "/$content" if -e $content;
189                  if ( $what eq 'js' ) {                  if ( $content =~ $re_html ) {
190                            $head = qq|
191                                    $content
192                                    <!-- $type via $package at $path line $line -->
193                            |;
194                    } elsif ( $what eq 'js' ) {
195                          $head = qq|                          $head = qq|
196                                  <$tag type="$type" src="$content">                                  <$tag type="$type" src="$content">
197                                  /* via $package at $path line $line */                                  /* $what via $package at $path line $line */
198                                  </$tag>                                  </$tag>
199                          |;                          |;
200                  } else {                  } else {
201                          $head = qq|                          $head = qq|
202                                  <link rel="stylesheet" type="$type" href="$content">                                  <link rel="stylesheet" type="$type" href="$content">
203                                  <!-- via $package at $path line $line -->                                  <!-- $what via $package at $path line $line -->
204                          |;                          |;
205                  }                  }
206          } else {          } else {

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

  ViewVC Help
Powered by ViewVC 1.1.26