line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::JavaScript::Console; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: use the JavaScript console from Mojolicious applications |
4
|
|
|
|
|
|
|
|
5
|
7
|
|
|
7
|
|
5043
|
use strict; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
210
|
|
6
|
7
|
|
|
7
|
|
47
|
use warnings; |
|
7
|
|
|
|
|
27
|
|
|
7
|
|
|
|
|
200
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
45
|
use Mojo::Base qw(Mojolicious::Plugin); |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
61
|
|
9
|
7
|
|
|
7
|
|
5064
|
use JavaScript::Console; |
|
7
|
|
|
|
|
33829
|
|
|
7
|
|
|
|
|
977
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub register { |
14
|
7
|
|
|
7
|
1
|
359
|
my ($plugin, $mojo, $param) = @_; |
15
|
|
|
|
|
|
|
|
16
|
7
|
100
|
|
|
|
38
|
$param = {} if 'HASH' ne ref $param; |
17
|
|
|
|
|
|
|
|
18
|
7
|
|
|
|
|
16
|
my $console = JavaScript::Console->new( %{ $param } ); |
|
7
|
|
|
|
|
35
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
$mojo->helper( |
21
|
|
|
|
|
|
|
'console' => sub { |
22
|
16
|
|
|
16
|
|
126368
|
$console; |
23
|
|
|
|
|
|
|
} |
24
|
7
|
|
|
|
|
193
|
); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
__END__ |