/[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 473 by dpavlin, Thu Nov 20 11:56:41 2008 UTC revision 480 by dpavlin, Thu Nov 20 14:39:43 2008 UTC
# Line 49  has 'content_type' => ( Line 49  has 'content_type' => (
49          is => 'rw',          is => 'rw',
50          isa => 'Str',          isa => 'Str',
51          default => 'text/html',          default => 'text/html',
52            documentation => 'Content-type header',
53    );
54    
55    has 'dump_max_bytes' => (
56            is => 'rw',
57            isa => 'Int',
58            default => 4096,
59            documentation => 'Maximum dump size sent to browser before truncation',
60  );  );
61    
62  =head2 inline_smaller_than  =head2 inline_smaller_than
# Line 158  sub page { Line 166  sub page {
166                          if ( ref($content) ) {                          if ( ref($content) ) {
167                                  $content = '<code>' . dump($content) . '</code>';                                  $content = '<code>' . dump($content) . '</code>';
168                                  my $l = length($content);                                  my $l = length($content);
169                                  $content = qq|<span>$l bytes</span>| if $l > 1024;                                  $content = qq|<span>$l bytes</span>| if $l > $self->dump_max_bytes;
170                          } else {                          } else {
171                                  $content = qq|<span>$content</span>|;                                  $content = qq|<span>$content</span>|;
172                          }                          }
# Line 186  sub page { Line 194  sub page {
194                  . qq|</code></span>|                  . qq|</code></span>|
195                  if $self->warnings;                  if $self->warnings;
196    
197            my      ($exit,$description) = ('exit','stop server');
198                    ($exit,$description) = ('restart','restart server')
199                    if $ENV{FREY_RESTART}; # tune labels on exit link
200    
201          my $right =          my $right =
202                  qq|                  qq|
203                          <span class="right">                          <span class="right">
204                          <a href="?reload=$reload_counter"><code>$url</code></a>                          <a title="reload"  href="/reload$url"><code>$url</code></a>
205                            <a title="$description" href="/exit$url">$exit</a>
206                          </span>                          </span>
207                  |;                  |;
208    
# Line 216  sub page { Line 229  sub page {
229          return $html;          return $html;
230  }  }
231    
232    =head2 editor
233    
234    Create HTML editor link with optional line and title
235    
236      my $html = $self->editor( $class, $line, $title );
237    
238    =cut
239    
240    sub editor {
241            my ( $self, $class, $line, $title ) = @_;
242            confess "need class" unless $class;
243            $line ||= 1;
244            qq|<a target="editor" href="/editor+$class+$line"| .
245            ( $title ? qq| title="$title"| : '' ) .
246            qq|>$class</a>|;
247    }
248    
249    =head2 editor_links
250    
251    Create HTML links to editor for perl error message
252    
253      my $html = $self->editor_links( $error )
254    
255    =cut
256    
257  sub editor_links {  sub editor_links {
258          my ( $self, $error ) = @_;          my ( $self, $error ) = @_;
259    

Legend:
Removed from v.473  
changed lines
  Added in v.480

  ViewVC Help
Powered by ViewVC 1.1.26