| 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
|
|
1277
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
9
|
|
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.004'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
has 'template' => 'disqus_template'; |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub register { |
|
12
|
1
|
|
|
1
|
1
|
56
|
my ( $plugin, $app ) = ( shift, shift ); |
|
13
|
1
|
|
|
|
|
3
|
push @{ $app->renderer->classes }, __PACKAGE__; |
|
|
1
|
|
|
|
|
30
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
1
|
|
|
0
|
|
49
|
$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_to_string( $self->disqus->template, |
|
24
|
|
|
|
|
|
|
forum_id => $forum_id ); |
|
25
|
|
|
|
|
|
|
} |
|
26
|
1
|
|
|
|
|
124
|
); |
|
27
|
|
|
|
|
|
|
} |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__DATA__ |