line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Anchor; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
883
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
5
|
1
|
|
|
1
|
|
7
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( config fhelp href imgclass target ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub init { |
10
|
1
|
|
|
1
|
1
|
2
|
my ($self, $args) = @_; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
|
|
7
|
$self->class ( 'anchor_button fade' ); |
13
|
1
|
|
|
|
|
7
|
$self->config ( undef ); |
14
|
1
|
|
|
|
|
6
|
$self->fhelp ( q() ); |
15
|
1
|
|
|
|
|
6
|
$self->href ( undef ); |
16
|
1
|
|
|
|
|
6
|
$self->imgclass( undef ); |
17
|
1
|
|
|
|
|
6
|
$self->target ( undef ); |
18
|
1
|
|
|
|
|
12
|
$self->tiptype ( 'normal' ); |
19
|
1
|
|
|
|
|
6
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub render_field { |
23
|
1
|
|
|
1
|
1
|
2
|
my ($self, $args) = @_; my $hacc = $self->hacc; |
|
1
|
|
|
|
|
3
|
|
24
|
|
|
|
|
|
|
|
25
|
1
|
50
|
33
|
|
|
5
|
$self->id and $self->config |
26
|
|
|
|
|
|
|
and $self->add_literal_js( 'anchors', $self->id, $self->config ); |
27
|
|
|
|
|
|
|
|
28
|
1
|
50
|
50
|
|
|
11
|
my $src = 'http:' eq (substr $self->text, 0, 5) |
29
|
|
|
|
|
|
|
? $self->text : ($self->options->{assets} // q()).$self->text; |
30
|
1
|
0
|
33
|
|
|
22
|
my $html = $self->imgclass |
|
|
50
|
|
|
|
|
|
31
|
|
|
|
|
|
|
? $self->text |
32
|
|
|
|
|
|
|
? $hacc->img ( { alt => $self->fhelp, |
33
|
|
|
|
|
|
|
class => $self->imgclass, |
34
|
|
|
|
|
|
|
src => $src } ) |
35
|
|
|
|
|
|
|
: $hacc->span( { class => $self->imgclass } ) |
36
|
|
|
|
|
|
|
: $self->text || $self->loc( 'link' ); |
37
|
|
|
|
|
|
|
|
38
|
1
|
50
|
|
|
|
3
|
$self->href or return $html; delete $args->{name}; |
|
1
|
|
|
|
|
7
|
|
39
|
|
|
|
|
|
|
|
40
|
1
|
|
|
|
|
3
|
$args->{class} = $self->class; $args->{href} = $self->uri_for( $self->href ); |
|
1
|
|
|
|
|
5
|
|
41
|
|
|
|
|
|
|
|
42
|
1
|
50
|
|
|
|
3
|
defined $self->target and $args->{target} = $self->target; |
43
|
|
|
|
|
|
|
|
44
|
1
|
|
|
|
|
27
|
return $hacc->a( $args, $html ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|