line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package LINE::Bot::API::Builder::ImagemapMessage; |
2
|
1
|
|
|
1
|
|
516
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
423
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub new { |
6
|
2
|
|
|
2
|
0
|
712
|
my($class, %args) = @_; |
7
|
|
|
|
|
|
|
my %o = ( |
8
|
|
|
|
|
|
|
type => 'imagemap', |
9
|
|
|
|
|
|
|
baseUrl => $args{base_url}, |
10
|
|
|
|
|
|
|
altText => $args{alt_text}, |
11
|
|
|
|
|
|
|
baseSize => +{ |
12
|
|
|
|
|
|
|
width => $args{base_width}, |
13
|
|
|
|
|
|
|
height => $args{base_height}, |
14
|
|
|
|
|
|
|
}, |
15
|
2
|
|
50
|
|
|
19
|
actions => $args{actions} // [], |
16
|
|
|
|
|
|
|
); |
17
|
|
|
|
|
|
|
|
18
|
2
|
100
|
|
|
|
8
|
if ($args{video}) { |
19
|
1
|
|
|
|
|
4
|
$o{video} = {}; |
20
|
1
|
|
|
|
|
4
|
for my $attr (qw(originalContentUrl previewImageUrl)) { |
21
|
2
|
|
|
|
|
6
|
$o{video}{$attr} = $args{video}{$attr}; |
22
|
|
|
|
|
|
|
} |
23
|
1
|
|
|
|
|
4
|
for my $attr (qw(x y width height)) { |
24
|
4
|
|
|
|
|
10
|
$o{video}{area}{$attr} = $args{video}{area}{$attr}; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
1
|
50
|
|
|
|
4
|
if ($args{video}{externalLink}) { |
28
|
0
|
|
|
|
|
0
|
for my $attr (qw(label linkUri)) { |
29
|
0
|
|
|
|
|
0
|
$o{video}{externalLink}{$attr} = $args{video}{externalLink}{$attr}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
2
|
|
|
|
|
11
|
return bless \%o, $class; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub build { |
38
|
2
|
|
|
2
|
0
|
5
|
my($self, ) = @_; |
39
|
2
|
|
|
|
|
4
|
+{ %{ $self } }; |
|
2
|
|
|
|
|
14
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub add_action { |
43
|
2
|
|
|
2
|
0
|
5
|
my($self, $action) = @_; |
44
|
2
|
|
|
|
|
3
|
push @{ $self->{actions} }, $action; |
|
2
|
|
|
|
|
9
|
|
45
|
2
|
|
|
|
|
8
|
$self; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub add_uri_action { |
49
|
1
|
|
|
1
|
0
|
6
|
my($self, %args) = @_; |
50
|
|
|
|
|
|
|
$self->add_action(+{ |
51
|
|
|
|
|
|
|
type => 'uri', |
52
|
|
|
|
|
|
|
linkUri => $args{uri}, |
53
|
|
|
|
|
|
|
area => +{ |
54
|
|
|
|
|
|
|
x => $args{area_x}, |
55
|
|
|
|
|
|
|
y => $args{area_y}, |
56
|
|
|
|
|
|
|
width => $args{area_width}, |
57
|
|
|
|
|
|
|
height => $args{area_height}, |
58
|
|
|
|
|
|
|
}, |
59
|
1
|
|
|
|
|
7
|
}); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub add_message_action { |
63
|
1
|
|
|
1
|
0
|
4
|
my($self, %args) = @_; |
64
|
|
|
|
|
|
|
$self->add_action(+{ |
65
|
|
|
|
|
|
|
type => 'message', |
66
|
|
|
|
|
|
|
text => $args{text}, |
67
|
|
|
|
|
|
|
area => +{ |
68
|
|
|
|
|
|
|
x => $args{area_x}, |
69
|
|
|
|
|
|
|
y => $args{area_y}, |
70
|
|
|
|
|
|
|
width => $args{area_width}, |
71
|
|
|
|
|
|
|
height => $args{area_height}, |
72
|
|
|
|
|
|
|
}, |
73
|
1
|
|
|
|
|
7
|
}); |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
1; |