--- trunk/lib/Frey/Web.pm 2008/07/17 22:26:21 163 +++ trunk/lib/Frey/Web.pm 2008/11/17 20:14:12 385 @@ -12,6 +12,13 @@ default => sub { [ 'static/frey.css' ] }, ); +=head2 inline_smaller_than + +Inline JavaScript and CSS smaller than this size into page reducing +round-trips to server. + +=cut + has 'inline_smaller_than' => ( is => 'rw', isa => 'Int', @@ -77,6 +84,20 @@ our $reload_counter = 0; + +=head2 page + + $self->page( + title => 'page title', + head => '', + body => 'Page Body', + ); + +=cut + +use Frey::Bookmarklet; +use Frey::ClassBrowser; + sub page { my $self = shift; my $a = {@_}; @@ -86,16 +107,30 @@ my $html = qq|| . $self->_head_html . '' . ( $a->{title} || ref($self) ) . '' + . '' . ( $a->{head} || '' ) . '' . ( $a->{body} || '' ) - . qq|
Frey $Frey::VERSION reload
| - . '' - ; + . qq|
+ Frey $Frey::VERSION + | . dump( $ENV{'REQUEST_URI'} ) . qq| + Bookmarklets| . Frey::Bookmarklet->markup . qq| + ClassBrowser| . Frey::ClassBrowser->markup . qq| + ENV| . dump( %ENV ) . qq| +
+ + |; warn "## >>> page ",length($html), " bytes\n" if $self->debug; return $html; } +sub error { + my ( $self, $error ) = @_; + warn $error; + $error =~ s{at\s+(\S+)\s+line\s+(\d+)}{ $1 line $2}gsm; + return qq|
$error
|; +} + 1;