line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: SIZE.pm 284 2006-12-01 07:51:49Z chronos $ |
2
|
|
|
|
|
|
|
package BBCode::Tag::SIZE; |
3
|
2
|
|
|
2
|
|
13
|
use base qw(BBCode::Tag::Inline); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
217
|
|
4
|
2
|
|
|
2
|
|
11
|
use BBCode::Util qw(:parse); |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
462
|
|
5
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
79
|
|
6
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
671
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.34'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub BodyPermitted($):method { |
10
|
4
|
|
|
4
|
1
|
25
|
return 1; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub NamedParams($):method { |
14
|
2
|
|
|
2
|
1
|
15
|
return qw(VAL); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub DefaultParam($):method { |
18
|
2
|
|
|
2
|
1
|
7
|
return 'VAL'; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub validateParam($$$):method { |
22
|
2
|
|
|
2
|
1
|
5
|
my($this,$param,$val) = @_; |
23
|
|
|
|
|
|
|
|
24
|
2
|
50
|
|
|
|
8
|
if($param eq 'VAL') { |
25
|
2
|
|
|
|
|
11
|
my $size = parseFontSize($val); |
26
|
2
|
100
|
|
|
|
16
|
if(defined $size) { |
27
|
1
|
|
|
|
|
7
|
return $size; |
28
|
|
|
|
|
|
|
} else { |
29
|
1
|
|
|
|
|
30
|
die qq(Invalid value "$val" for [SIZE]); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
0
|
|
|
|
|
0
|
return $this->SUPER::validateParam($param,$val); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub replace($):method { |
36
|
1
|
|
|
1
|
0
|
3
|
my $this = shift; |
37
|
1
|
|
|
|
|
10
|
my $that = BBCode::Tag->new($this->parser, 'FONT', [ 'SIZE', $this->param('VAL') ]); |
38
|
1
|
|
|
|
|
4
|
@{$that->body} = @{$this->body}; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
16
|
|
39
|
1
|
|
|
|
|
4
|
return $that; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |