line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Label; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1522
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
25
|
|
5
|
1
|
|
|
1
|
|
4
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( dropcap ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
5
|
|
|
5
|
1
|
6
|
my ($self, $args) = @_; |
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
|
|
16
|
$self->class ( 'label_text' ); |
13
|
5
|
|
|
|
|
26
|
$self->container( 0 ); |
14
|
5
|
|
|
|
|
26
|
$self->dropcap ( 0 ); |
15
|
5
|
|
|
|
|
28
|
$self->text ( undef ); |
16
|
5
|
|
|
|
|
21
|
return; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub render_field { |
20
|
5
|
|
|
5
|
1
|
8
|
my ($self, $args) = @_; my $text = $self->text; |
|
5
|
|
|
|
|
12
|
|
21
|
|
|
|
|
|
|
|
22
|
5
|
50
|
|
|
|
22
|
defined $text or return; $text =~ s{ \A \n }{}msx; |
|
5
|
|
|
|
|
9
|
|
23
|
|
|
|
|
|
|
|
24
|
5
|
50
|
|
|
|
12
|
if ($self->dropcap) { |
25
|
0
|
|
|
|
|
0
|
my $markup; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
|
|
|
0
|
if ($text =~ m{ \A (\<[A-Za-z0-9]+\>) }mx) { |
28
|
0
|
|
|
|
|
0
|
$markup = $1; |
29
|
0
|
|
|
|
|
0
|
$markup .= $self->hacc->span( { class => q(dropcap) }, |
30
|
|
|
|
|
|
|
substr $text, length $1, 1 ); |
31
|
0
|
|
|
|
|
0
|
$markup .= substr $text, (length $1) + 1; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
else { |
34
|
0
|
|
|
|
|
0
|
$markup = $self->hacc->span( { class => q(dropcap) }, |
35
|
|
|
|
|
|
|
substr $text, 0, 1 ); |
36
|
0
|
|
|
|
|
0
|
$markup .= substr $text, 1; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
0
|
$text = $markup; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
5
|
100
|
|
|
|
26
|
$args = { class => $self->class }; $self->id and $args->{id} = $self->id; |
|
5
|
|
|
|
|
28
|
|
43
|
|
|
|
|
|
|
|
44
|
5
|
|
|
|
|
29
|
return $self->hacc->span( $args, $text ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|