/[Frey]/trunk/lib/Frey/Designer.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/Designer.pm

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

revision 166 by dpavlin, Mon Aug 11 19:32:29 2008 UTC revision 175 by dpavlin, Sat Aug 16 23:37:42 2008 UTC
# Line 1  Line 1 
1  package Frey::Designer;  package Frey::Designer;
2    
3  use Moose;  use Moose;
4  use Moose::Util::TypeConstraints;  use Frey::Types;
5    #use MooseX::Types::URI qw(Uri FileUri DataUri);
 use URI ();  
   
 subtype 'Uri'  
         => as 'Object'  
         => where { $_->isa('URI') };  
     
 coerce 'Uri'  
         => from 'Object'  
         => via { $_->isa('URI')  
                 ? $_  
                 : Params::Coerce::coerce( 'URI', $_ ) }  
         => from 'Str'  
                 => via { URI->new( $_ ) };  
6    
7  has 'uri' => (  has 'uri' => (
8          is => 'rw',          is => 'rw',
9          isa => 'Uri',          isa => 'Uri', coerce => 1,
         coerce => 1,  
10          required => 1,          required => 1,
11  );  );
12    
# Line 67  sub handler { Line 53  sub handler {
53    
54          my $path = template_path( $c->req->path );          my $path = template_path( $c->req->path );
55    
56            if ( $path =~ m{/__bookmarklet} ) {
57                    $c->res->content_type( "text/html" );
58                    my $js = read_file( 'static/xpath.js' );
59                    $js =~ s{//.*}{}gm;     # remove comments so that compaction below doesn't screw code
60                    $js =~ s/\s\s+/ /gs;
61            $c->res->body(qq{
62                            drag this look to bookmark <a href="javascript:void($js);">xpath?</a> to install XPATH inspector
63                            <p><a href="http://www.google.com/">link test</a>
64                    });
65                    return;
66            }
67    
68          $path .= '.html' if $path !~ m/\.\w+$/;          $path .= '.html' if $path !~ m/\.\w+$/;
69    
70          my $url = $self->uri;          my $url = $self->uri;

Legend:
Removed from v.166  
changed lines
  Added in v.175

  ViewVC Help
Powered by ViewVC 1.1.26