line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JavaScript::DebugConsole; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
29813
|
use 5.005; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
134
|
|
4
|
3
|
|
|
3
|
|
26
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
118
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
16
|
use vars qw($VERSION); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
4237
|
|
7
|
|
|
|
|
|
|
$VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1
|
|
|
1
|
1
|
489
|
my $proto = shift; |
11
|
1
|
|
33
|
|
|
12
|
my $class = ref($proto) || $proto; |
12
|
1
|
50
|
|
|
|
6
|
my $self = ($#_ == 0) ? shift : { @_ }; |
13
|
1
|
50
|
33
|
|
|
12
|
$self->{debug} = 1 if ( ! defined $self->{debug} || $self->{debug} !~ /^(0|1)$/ ); |
14
|
1
|
|
|
|
|
13
|
return bless $self,$class; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub debugConsole { |
18
|
2
|
|
|
2
|
1
|
7
|
my $self = shift; |
19
|
2
|
50
|
|
|
|
14
|
my %args = ref($_[0]) eq 'HASH' ? %{$_[0]} : @_; |
|
0
|
|
|
|
|
0
|
|
20
|
|
|
|
|
|
|
|
21
|
2
|
|
50
|
|
|
8
|
$args{'title'} ||= 'POPUPConsole'; |
22
|
2
|
100
|
|
|
|
9
|
$args{'auto_open'} = 1 if ! defined $args{'auto_open'}; |
23
|
2
|
|
33
|
|
|
32
|
$args{'id'} = defined $args{'id'} || ( $$ . '_' . ++$self->{'popup_count'} ); |
24
|
2
|
|
66
|
|
|
8
|
$args{'content'} ||= $self->{'content'}; |
25
|
2
|
|
50
|
|
|
13
|
$args{'env'} ||= \%ENV; |
26
|
2
|
100
|
66
|
|
|
16
|
$args{debug} = $self->{debug} if ( ! defined $args{debug} || $args{debug} !~ /^(0|1)$/ ); |
27
|
2
|
|
50
|
|
|
22
|
$args{'popup_options'} ||= 'height=250,width=500,scrollbars=1,resizable=1,dependent,screenX=250,screenY=200,top=200,left=250'; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
# create javascript code |
30
|
2
|
|
|
|
|
9
|
my $str = <
|
31
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
EOM |
111
|
2
|
|
|
|
|
63
|
$self->{'console'} = $str; |
112
|
|
|
|
|
|
|
} |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
sub add { |
115
|
1
|
|
|
1
|
1
|
3
|
my ($self) = shift; |
116
|
1
|
|
|
|
|
9
|
$self->{content} .= join "\n", @_; |
117
|
|
|
|
|
|
|
} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
sub link { |
120
|
2
|
|
|
2
|
0
|
6
|
my $self = shift; |
121
|
2
|
|
|
|
|
156
|
return 'javascript:' . $self->{'link'}; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
sub console { |
125
|
0
|
|
|
0
|
0
|
0
|
my $self = shift; |
126
|
0
|
|
|
|
|
0
|
$self->{'console'}; |
127
|
|
|
|
|
|
|
} |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
sub _HashVariables { |
130
|
2
|
|
|
2
|
|
5
|
my($hash,$separator,$equal) = @_; |
131
|
2
|
|
|
|
|
12
|
my $str = ''; |
132
|
2
|
50
|
|
|
|
6
|
$equal = ' = ' unless $equal; |
133
|
2
|
|
|
|
|
3
|
eval { $hash->can('param') }; |
|
2
|
|
|
|
|
18
|
|
134
|
2
|
50
|
|
|
|
6
|
if ( $@ ) { |
135
|
2
|
|
|
|
|
33
|
foreach(sort keys %$hash) { |
136
|
25
|
|
|
|
|
135
|
$str .= $_ . $equal . $hash->{$_} . $separator; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
else { |
140
|
0
|
|
|
|
|
0
|
foreach(sort $hash->param) { |
141
|
0
|
|
|
|
|
0
|
$str .= $_ . $equal . $hash->param($_) . $separator; |
142
|
|
|
|
|
|
|
} |
143
|
|
|
|
|
|
|
} |
144
|
2
|
|
|
|
|
32
|
return $str; |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
__END__ |