line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widget::Element::Span; |
2
|
|
|
|
|
|
|
|
3
|
88
|
|
|
88
|
|
78636
|
use warnings; |
|
88
|
|
|
|
|
190
|
|
|
88
|
|
|
|
|
3405
|
|
4
|
88
|
|
|
88
|
|
528
|
use strict; |
|
88
|
|
|
|
|
176
|
|
|
88
|
|
|
|
|
2740
|
|
5
|
88
|
|
|
88
|
|
486
|
use base 'HTML::Widget::Element'; |
|
88
|
|
|
|
|
171
|
|
|
88
|
|
|
|
|
35786
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors(qw/content/); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
HTML::Widget::Element::Span - Span Element |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my $e = $widget->element( 'Span', 'foo' ); |
16
|
|
|
|
|
|
|
$e->content('bar'); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Span Element. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head2 content |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
C can contain a string, an |
27
|
|
|
|
|
|
|
L object, or an array-ref of |
28
|
|
|
|
|
|
|
L objects. |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head2 containerize |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=cut |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub containerize { |
35
|
3
|
|
|
3
|
1
|
5
|
my ( $self, $w ) = @_; |
36
|
|
|
|
|
|
|
|
37
|
3
|
|
|
|
|
7
|
my $content = $self->content; |
38
|
3
|
|
50
|
|
|
66
|
$self->attributes->{class} ||= 'span'; |
39
|
3
|
|
|
|
|
14
|
my $e = HTML::Element->new( 'span', id => $self->id($w) ); |
40
|
|
|
|
|
|
|
my @content |
41
|
3
|
50
|
33
|
|
|
102
|
= ( $content && ref($content) eq 'ARRAY' ) ? @$content : ($content) |
|
|
100
|
|
|
|
|
|
42
|
|
|
|
|
|
|
if defined $content; |
43
|
3
|
100
|
|
|
|
11
|
$e->push_content(@content) if @content; |
44
|
3
|
|
|
|
|
9
|
$e->attr( $_ => ${ $self->attributes }{$_} ) |
|
3
|
|
|
|
|
9
|
|
45
|
3
|
|
|
|
|
30
|
for ( keys %{ $self->attributes } ); |
46
|
|
|
|
|
|
|
|
47
|
3
|
|
|
|
|
45
|
return $self->container( { element => $e } ); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head2 new |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Sets L to false, so that filters added |
53
|
|
|
|
|
|
|
by C<< $widget->filter_all >> won't be applied to Span elements. |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Sets L to false, so that constraints |
56
|
|
|
|
|
|
|
added by C<< $widget->constraint_all >> won't be applied to Span elements. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub new { |
61
|
3
|
|
|
3
|
1
|
29
|
my $self = shift->NEXT::new(@_); |
62
|
|
|
|
|
|
|
|
63
|
3
|
|
|
|
|
247
|
$self->allow_filter(0)->allow_constraint(0); |
64
|
|
|
|
|
|
|
|
65
|
3
|
|
|
|
|
35
|
return $self; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=head1 SEE ALSO |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
L |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Sebastian Riedel, C |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 LICENSE |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
79
|
|
|
|
|
|
|
the same terms as Perl itself. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=cut |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
1; |