line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::LinkEmbedder::Link::Text; |
2
|
1
|
|
|
1
|
|
435
|
use Mojo::Base 'Mojolicious::Plugin::LinkEmbedder::Link'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
3
|
1
|
|
|
1
|
|
101
|
use Mojo::Util (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
169
|
|
4
|
|
|
|
|
|
|
|
5
|
0
|
|
|
0
|
1
|
|
sub raw_url { shift->url->clone } |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub to_embed { |
8
|
0
|
0
|
|
0
|
1
|
|
return $_[0]->SUPER::to_embed unless $_[0]->{text}; |
9
|
|
|
|
|
|
|
|
10
|
0
|
|
|
|
|
|
my $self = shift; |
11
|
0
|
|
|
|
|
|
my $media_id = $self->media_id; |
12
|
0
|
|
|
|
|
|
my $text = $self->{text}; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
return <<" HTML"; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Hosted by |
18
|
0
|
|
|
|
|
|
@{[$self->provider_name]} |
|
0
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
- |
20
|
0
|
|
|
|
|
|
View raw |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
$text |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
HTML |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding utf8 |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Mojolicious::Plugin::LinkEmbedder::Link::Text - Text URL |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 DESCRIPTION |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
This class inherit from L. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head2 Example styling |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
.link-embedder .text-paste{background: #eee;border: 1px solid #ccc;} |
42
|
|
|
|
|
|
|
.link-embedder .text-paste .paste-meta{border-bottom: 1px solid #ccc;padding: 4px;} |
43
|
|
|
|
|
|
|
.link-embedder .text-paste pre{padding: 4px;margin:0;max-height: 240px;overflow:auto;} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 METHODS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 raw_url |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
=head2 to_embed |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
Returns the HTML code for a script tag that writes the gist. |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Jan Henning Thorsen - C |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |