--- trunk/lib/Frey/Web.pm 2008/12/09 20:31:26 764
+++ trunk/lib/Frey/Web.pm 2008/12/11 21:06:41 813
@@ -11,7 +11,7 @@
use File::Slurp;
use Frey::Bookmarklet;
-use Frey::ClassBrowser;
+use Frey::Class::Browser;
use Frey::INC;
use Frey::SVK;
@@ -93,7 +93,7 @@
sub popup { my $self = shift; $self->popup_dropdown('popup', @_); }
sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); }
-our $re_html = qr{<(?:!--.+?--|(\w+).+?/\1|[^>]+/)>}s; # relaxed html check for one semi-valid tag
+our $re_html = qr{<(?:!--.+?--|(\w+).+?/\1|[^>]+/?)>}s; # relaxed html check for one semi-valid tag
sub popup_dropdown {
my ( $self, $type, $name, $content, $full ) = @_;
@@ -185,14 +185,23 @@
}
sub add_js {
- my ($self,$css) = @_;
+ my ($self,$js) = @_;
my ( $package, $path, $line ) = caller;
- $self->add_head( qq|
-
- | );
+
+ if ( $js =~ m{http.*\.js} ) {
+ $self->add_head( qq|
+
+ |);
+ } else {
+ $self->add_head( qq|
+
+ | );
+ };
}
our $reload_counter = 0;
@@ -419,7 +428,7 @@
my ($self) = shift;
@head = ( 'static/frey.css' );
@status = (
- { 'ClassBrowser' => Frey::ClassBrowser->new( usage_on_top => 0 )->as_markup },
+ { 'ClassBrowser' => Frey::Class::Browser->new( usage_sort => 1, usage_on_top => 0 )->as_markup },
{ 'Bookmarklets' => Frey::Bookmarklet->new->as_markup },
{ 'INC' => Frey::INC->new->as_markup },
);
@@ -679,4 +688,20 @@
qq||;
}
+=head2 strip
+
+Strip whitespace around content
+
+ my $stripped = strip(' no more whitespace around this ');
+
+=cut
+
+sub strip {
+ my $t = shift;
+ $t =~ s{^\s+}{}gs;
+ $t =~ s{>\s+<}{><}gs;
+ $t =~ s{\s+$}{}gs;
+ return $t;
+}
+
1;