line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Livedoor::Wiki::Plugin::Function::Jimakuin; |
2
|
11
|
|
|
11
|
|
147
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
369
|
|
3
|
11
|
|
|
11
|
|
61
|
use strict; |
|
11
|
|
|
|
|
92
|
|
|
11
|
|
|
|
|
394
|
|
4
|
11
|
|
|
11
|
|
139
|
use base qw/Text::Livedoor::Wiki::Plugin::Function/; |
|
11
|
|
|
|
|
24
|
|
|
11
|
|
|
|
|
486
|
|
5
|
11
|
|
|
11
|
|
714
|
use Text::Livedoor::Wiki::Utils; |
|
11
|
|
|
|
|
33
|
|
|
11
|
|
|
|
|
80
|
|
6
|
|
|
|
|
|
|
__PACKAGE__->function_name('jimakuin'); |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub prepare_args { |
9
|
11
|
|
|
11
|
1
|
19
|
my $class= shift; |
10
|
11
|
|
|
|
|
14
|
my $args = shift; |
11
|
11
|
100
|
|
|
|
60
|
die 'no arg' unless scalar @$args ; |
12
|
10
|
|
|
|
|
70
|
my $url = $args->[0]; |
13
|
10
|
100
|
|
|
|
90
|
die 'url is not invalid' unless $url =~ m{^http://(?:[a-zA-Z0-9\-]+\.)?jimaku\.in/w/([a-zA-Z0-9\_][^/]+)/([a-zA-Z0-9\_][^/]+)}i; |
14
|
9
|
|
|
|
|
61
|
my ( $code1 , $code2 ) = $url =~ m{^http://(?:[a-zA-Z0-9\-]+\.)?jimaku\.in/w/([a-zA-Z0-9\_][^/]+)/([a-zA-Z0-9\_][^/]+)}; |
15
|
9
|
|
|
|
|
242
|
return { url => $url , code1 => $code1 , code2 => $code2 }; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
sub prepare_value { |
18
|
9
|
|
|
9
|
1
|
16
|
my $class = shift; |
19
|
9
|
|
100
|
|
|
38
|
my $value = shift || ''; |
20
|
9
|
|
|
|
|
17
|
my $width = 425; |
21
|
9
|
|
|
|
|
9
|
my $height= 380; |
22
|
|
|
|
|
|
|
|
23
|
9
|
|
|
|
|
53
|
($width , $height ) |
24
|
|
|
|
|
|
|
= Text::Livedoor::Wiki::Utils::get_width_height( $value , { width => $width , height => $height }) ; |
25
|
9
|
|
|
|
|
54
|
return { width => $width , height => $height }; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub process { |
29
|
8
|
|
|
8
|
1
|
16
|
my ( $class, $inline, $data ) = @_; |
30
|
8
|
|
|
|
|
15
|
my $url = $data->{args}{url}; |
31
|
8
|
|
|
|
|
16
|
my $code1= $data->{args}{code1}; |
32
|
8
|
|
|
|
|
14
|
my $code2= $data->{args}{code2}; |
33
|
8
|
|
|
|
|
15
|
my $width = $data->{value}{width}; |
34
|
8
|
|
|
|
|
16
|
my $height= $data->{value}{height}; |
35
|
|
|
|
|
|
|
|
36
|
8
|
|
|
|
|
42
|
my $html = <<"END_JIMAKUIN_TMPL"; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
type="application/x-shockwave-flash" wmode="transparent" |
44
|
|
|
|
|
|
|
width="$width" height="$height"> |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
END_JIMAKUIN_TMPL |
47
|
|
|
|
|
|
|
|
48
|
8
|
|
|
|
|
36
|
$html =~ s/\n$//; |
49
|
|
|
|
|
|
|
|
50
|
8
|
|
|
|
|
58
|
return $html ; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
1
|
|
|
1
|
1
|
6
|
sub process_mobile { '' } |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 NAME |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Text::Livedoor::Wiki::Plugin::Function::Jimakuin - jimaku.in Function Plugin |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 DESCRIPTION |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
lets watch and read! |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head1 SYNOPSIS |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
&jimakuin(http://jimaku.in/w/kdtdRNTdNb8/oTkZXUNFw_B) |
69
|
|
|
|
|
|
|
&jimakuin(http://jimaku.in/w/kdtdRNTdNb8/oTkZXUNFw_B){100,200} |
70
|
|
|
|
|
|
|
&jimakuin(http://jimaku.in/w/kdtdRNTdNb8/oTkZXUNFw_B){100} |
71
|
|
|
|
|
|
|
&jimakuin(http://jimaku.in/w/kdtdRNTdNb8/oTkZXUNFw_B){,200} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 FUNCTION |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head2 prepare_args |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 prepare_value |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head2 process |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 process_mobile |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 AUTHOR |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
polocky |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |