line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FormWidgets::Password; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
696
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
30
|
|
5
|
1
|
|
|
1
|
|
5
|
use parent 'HTML::FormWidgets'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
7
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
__PACKAGE__->mk_accessors( qw( subtype width ) ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $NBSP = ' '; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub init { |
12
|
1
|
|
|
1
|
1
|
1
|
my ($self, $args) = @_; |
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
|
|
3
|
$self->subtype( 'normal' ); |
15
|
1
|
|
|
|
|
7
|
$self->width ( 20 ); |
16
|
1
|
|
|
|
|
5
|
return; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub render_field { |
21
|
1
|
|
|
1
|
1
|
3
|
my ($self, $args) = @_; |
22
|
|
|
|
|
|
|
|
23
|
1
|
|
|
|
|
3
|
my $hacc = $self->hacc; |
24
|
1
|
|
|
|
|
7
|
my $subtype = $self->subtype; |
25
|
1
|
50
|
|
|
|
9
|
my $reveal = $subtype =~ m{ reveal }msx ? 1 : 0; |
26
|
|
|
|
|
|
|
|
27
|
1
|
50
|
|
|
|
4
|
if ($reveal) { |
28
|
0
|
|
|
|
|
0
|
my $id2 = $args->{id}; $id2 =~ s{ 1 }{2}mx; |
|
0
|
|
|
|
|
0
|
|
29
|
0
|
|
|
|
|
0
|
my $options = { event => "[ 'focus', 'blur' ]", |
30
|
|
|
|
|
|
|
method => "[ 'show_password', 'hide_password' ]" }; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
0
|
$self->add_literal_js( 'inputs', $self->id, $options ); |
33
|
0
|
|
|
|
|
0
|
$self->add_literal_js( 'inputs', $id2, $options ); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
1
|
50
|
|
|
|
6
|
$args->{class} .= ' ifield'.($reveal ? ' reveal' : q()); |
37
|
1
|
|
|
|
|
3
|
$args->{size } = $self->width; |
38
|
|
|
|
|
|
|
|
39
|
1
|
|
|
|
|
12
|
my $html = $hacc->password_field( $args ); |
40
|
|
|
|
|
|
|
|
41
|
1
|
50
|
|
|
|
63
|
$subtype =~ m{ verify }msx or return $html; |
42
|
1
|
|
|
|
|
5
|
$html .= $hacc->span( { class => 'prompt' }, |
43
|
|
|
|
|
|
|
$NBSP.$self->loc( 'and again' ).$NBSP ); |
44
|
1
|
|
|
|
|
31
|
$args->{name} =~ s{ 1 }{2}mx; $args->{id} =~ s{ 1 }{2}mx; |
|
1
|
|
|
|
|
3
|
|
45
|
1
|
|
|
|
|
7
|
$html .= $hacc->password_field( $args ); |
46
|
1
|
|
|
|
|
42
|
return $html; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|