line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JQuery::CSS ; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.00'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1221
|
use strict ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
34
|
|
6
|
1
|
|
|
1
|
|
5
|
use warnings ; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
1654
|
use CSS ; |
|
1
|
|
|
|
|
16861
|
|
|
1
|
|
|
|
|
34
|
|
9
|
1
|
|
|
1
|
|
10
|
use Carp ; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
500
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new { |
12
|
0
|
|
|
0
|
1
|
|
my $this = shift; |
13
|
0
|
|
0
|
|
|
|
my $class = ref($this) || $this; |
14
|
0
|
|
|
|
|
|
my $my ; |
15
|
0
|
0
|
|
|
|
|
croak "Invalid number of argument" if @_ % 2 ; |
16
|
0
|
|
|
|
|
|
%{$my->{param}} = @_ ; |
|
0
|
|
|
|
|
|
|
17
|
0
|
0
|
0
|
|
|
|
carp "Must have file, hash or text" unless exists $my->{param}{file} or exists $my->{param}{hash} or exists $my->{param}{text} ; |
|
|
|
0
|
|
|
|
|
18
|
0
|
|
|
|
|
|
my $css = new CSS({'adaptor' => 'CSS::Adaptor::Pretty'}); |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
if (exists $my->{param}{file}) { |
21
|
0
|
|
|
|
|
|
my $file = $my->{param}{file} ; |
22
|
|
|
|
|
|
|
} |
23
|
0
|
0
|
|
|
|
|
if (exists $my->{param}{text}) { |
24
|
0
|
|
|
|
|
|
$css->read_string($my->{param}{text}) ; |
25
|
|
|
|
|
|
|
} |
26
|
0
|
0
|
|
|
|
|
if (exists $my->{param}{hash}) { |
27
|
0
|
|
|
|
|
|
my $text ; |
28
|
0
|
|
|
|
|
|
my $hash = $my->{param}{hash} ; |
29
|
0
|
|
|
|
|
|
for my $key (keys %$hash) { |
30
|
0
|
|
|
|
|
|
$text .= "$key {" ; |
31
|
0
|
|
|
|
|
|
my @subKeys = keys(%{$hash->{$key}}) ; |
|
0
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
for my $subKey (@subKeys) { |
33
|
0
|
|
|
|
|
|
$text .= $subKey . ": " ; |
34
|
0
|
|
|
|
|
|
my $v = $hash->{$key}{$subKey} ; |
35
|
0
|
|
|
|
|
|
$text .= $v . "; " ; |
36
|
|
|
|
|
|
|
} |
37
|
0
|
|
|
|
|
|
$text .= "}\n" ; |
38
|
|
|
|
|
|
|
} |
39
|
0
|
|
|
|
|
|
$css->read_string($text) ; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
0
|
|
|
|
|
|
$my->{css} = $css ; |
43
|
|
|
|
|
|
|
|
44
|
0
|
|
|
|
|
|
bless $my, $class; |
45
|
0
|
|
|
|
|
|
return $my ; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub output_text { |
49
|
0
|
|
|
0
|
1
|
|
my $my = shift ; |
50
|
0
|
|
|
|
|
|
my $id = shift ; |
51
|
|
|
|
|
|
|
# This is a filename |
52
|
|
|
|
|
|
|
|
53
|
0
|
0
|
|
|
|
|
if (exists $my->{param}{file}) { |
54
|
0
|
|
|
|
|
|
my $fileName = $my->{param}{file} ; |
55
|
0
|
|
|
|
|
|
my $css = qq[\n] ; |
56
|
0
|
|
|
|
|
|
return $css ; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
0
|
0
|
0
|
|
|
|
if (exists $my->{param}{text} or exists $my->{param}{hash}) { |
60
|
0
|
|
|
|
|
|
my $css = $my->{css} ; |
61
|
0
|
|
|
|
|
|
my $result = qq[" ; |
62
|
0
|
|
|
|
|
|
return $result ; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
__END__ |