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