94 |
sub popup { my $self = shift; $self->popup_dropdown('popup', @_); } |
sub popup { my $self = shift; $self->popup_dropdown('popup', @_); } |
95 |
sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); } |
sub dropdown { my $self = shift; $self->popup_dropdown('dropdown', @_); } |
96 |
|
|
97 |
our $re_html = qr{<(?:!--.+?--|(\w+).+?/\1|[^>]+/?)>}s; # relaxed html check for one semi-valid tag |
our $re_html = qr{<(?:!--|(\w+)|[^>]+)/?>}s; # relaxed html check for one semi-valid tag |
98 |
|
|
99 |
sub popup_dropdown { |
sub popup_dropdown { |
100 |
my ( $self, $type, $name, $content, $full ) = @_; |
my ( $self, $type, $name, $content, $full ) = @_; |
186 |
|
|
187 |
if ( $content =~ m{\.(js|css)} ) { |
if ( $content =~ m{\.(js|css)} ) { |
188 |
$content = "/$content" if -e $content; |
$content = "/$content" if -e $content; |
189 |
if ( $what eq 'js' ) { |
if ( $content =~ $re_html ) { |
190 |
|
$head = qq| |
191 |
|
$content |
192 |
|
<!-- $type via $package at $path line $line --> |
193 |
|
|; |
194 |
|
} elsif ( $what eq 'js' ) { |
195 |
$head = qq| |
$head = qq| |
196 |
<$tag type="$type" src="$content"> |
<$tag type="$type" src="$content"> |
197 |
/* via $package at $path line $line */ |
/* $what via $package at $path line $line */ |
198 |
</$tag> |
</$tag> |
199 |
|; |
|; |
200 |
} else { |
} else { |
201 |
$head = qq| |
$head = qq| |
202 |
<link rel="stylesheet" type="$type" href="$content"> |
<link rel="stylesheet" type="$type" href="$content"> |
203 |
<!-- via $package at $path line $line --> |
<!-- $what via $package at $path line $line --> |
204 |
|; |
|; |
205 |
} |
} |
206 |
} else { |
} else { |