| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# ABSTRACT: Mojolicious plugin for integrating Disqus forum |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Mojolicious::Plugin::Disqus::Tiny; |
|
4
|
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1360
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.003'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'template' => 'disqus_template'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub register { |
|
12
|
1
|
|
|
1
|
1
|
61
|
my ($plugin, $app) = (shift, shift); |
|
13
|
1
|
|
|
|
|
2
|
push @{$app->renderer->classes}, __PACKAGE__; |
|
|
1
|
|
|
|
|
29
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
1
|
|
|
0
|
|
56
|
$app->helper(disqus => sub {$plugin}); |
|
|
0
|
|
|
|
|
0
|
|
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
$app->helper( |
|
18
|
|
|
|
|
|
|
disqus_inc => sub { |
|
19
|
0
|
|
|
0
|
|
|
my $self = shift; |
|
20
|
0
|
|
|
|
|
|
my $forum_id = shift; |
|
21
|
|
|
|
|
|
|
|
|
22
|
0
|
0
|
|
|
|
|
die "No disqus ID defined" unless defined $forum_id; |
|
23
|
0
|
|
|
|
|
|
$self->render( |
|
24
|
|
|
|
|
|
|
template => $self->disqus->template, |
|
25
|
|
|
|
|
|
|
partial => 1, |
|
26
|
|
|
|
|
|
|
forum_id => $forum_id |
|
27
|
|
|
|
|
|
|
); |
|
28
|
|
|
|
|
|
|
} |
|
29
|
1
|
|
|
|
|
110
|
); |
|
30
|
|
|
|
|
|
|
} |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
1; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__DATA__ |