/[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 957 by dpavlin, Wed Jan 7 17:50:03 2009 UTC revision 986 by dpavlin, Sat Jan 10 18:53:15 2009 UTC
# Line 3  use Moose::Role; Line 3  use Moose::Role;
3    
4  with 'Frey::Session';  with 'Frey::Session';
5    
 #use Continuity::Widget::DomNode;  
6  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
7  use Carp qw/confess cluck carp/;  use Carp qw/confess cluck carp/;
8  use File::Slurp;  use File::Slurp;
# Line 83  my $escape_re  = join '|' => keys %escap Line 82  my $escape_re  = join '|' => keys %escap
82    
83  sub html_escape {  sub html_escape {
84          my ( $self, $html ) = @_;          my ( $self, $html ) = @_;
85            return '' unless defined $html;
86          $html =~ s/($escape_re)/$escape{$1}/g;          $html =~ s/($escape_re)/$escape{$1}/g;
87          return $html;          return $html;
88  }  }
# Line 245  sub add_js { Line 245  sub add_js {
245  our $reload_counter = 0;  our $reload_counter = 0;
246    
247    
248  =head2 page  =head2 html_page
249    
250    $self->page(    $self->html_page(
251          title => 'page title',          title => 'page title',
252          head  => '<!-- optional head markup -->',          head  => '<!-- optional head markup -->',
253          body  => '<b>Page Body</b>',          body  => '<b>Page Body</b>',
# Line 260  sub status { @status }; Line 260  sub status { @status };
260    
261  our $icon_html;  our $icon_html;
262    
263  sub page {  sub html_page {
264          my $self = shift;          my $self = shift;
265          my $a = {@_};          my $a = {@_};
266    
# Line 320  sub page { Line 320  sub page {
320    
321  #       $title =~ s{(\w)\w+::}{$1:}g; # XXX compress names of classes  #       $title =~ s{(\w)\w+::}{$1:}g; # XXX compress names of classes
322    
323            $self->add_css(qq|
324                    body {
325                            padding-bottom: 3em; /* don't overlap status line */
326                    }
327            |);
328    
329          my $html = join("\n",          my $html = join("\n",
330                  qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|,                  qq|<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"><html><head>|,
331                  $self->_head_html,                  $self->_head_html,

Legend:
Removed from v.957  
changed lines
  Added in v.986

  ViewVC Help
Powered by ViewVC 1.1.26