line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Angular::MaterialDesign; |
2
|
2
|
|
|
2
|
|
16905
|
use 5.008001; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
65
|
|
3
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
57
|
|
4
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
94
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
484
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
2
|
|
|
|
|
7895
|
|
|
2
|
|
|
|
|
13
|
|
7
|
2
|
|
|
2
|
|
2211
|
use Mojolicious::Plugin::AssetPack; |
|
2
|
|
|
|
|
123210
|
|
|
2
|
|
|
|
|
33
|
|
8
|
2
|
|
|
2
|
|
910
|
use File::Spec::Functions 'catdir'; |
|
2
|
|
|
|
|
932
|
|
|
2
|
|
|
|
|
163
|
|
9
|
2
|
|
|
2
|
|
14
|
use Cwd (); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
784
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.603'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my @DEFAULT_CSS_FILES = qw( angular-material.min.css ); |
14
|
|
|
|
|
|
|
my @DEFAULT_JS_FILES = qw( angular-material.min.js); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub asset_path { |
17
|
1
|
|
|
1
|
1
|
20
|
my ( $class ) = @_; |
18
|
1
|
|
|
|
|
79
|
my $path = Cwd::abs_path(__FILE__); |
19
|
1
|
|
|
|
|
5
|
$path =~ s!\.pm$!!; |
20
|
1
|
|
|
|
|
2
|
return $path; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub register { |
24
|
1
|
|
|
1
|
1
|
47
|
my ( $self, $app, $config ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
1
|
50
|
|
|
|
2
|
$app->plugin('AssetPack') unless eval { $app->asset }; |
|
1
|
|
|
|
|
12
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
50
|
|
|
1018
|
$config->{css} ||= [@DEFAULT_CSS_FILES]; |
29
|
1
|
|
50
|
|
|
6
|
$config->{js} ||= [@DEFAULT_JS_FILES]; |
30
|
1
|
|
50
|
|
|
4
|
$config->{jquery} //= 1; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
1
|
push @{ $app->static->paths }, $self->asset_path; |
|
1
|
|
|
|
|
18
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# TODO: 'bootstrap_resources.scss' |
35
|
1
|
50
|
|
|
|
1
|
if ( @{ $config->{css} } ) { |
|
1
|
|
|
|
|
5
|
|
36
|
1
|
|
|
|
|
6
|
$app->asset( 'materialdesign.css' => map {"/css/$_"} |
|
1
|
|
|
|
|
2
|
|
37
|
1
|
|
|
|
|
1
|
@{ $config->{css} } ); |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
|
|
|
3659
|
if ( @{ $config->{js} } ) { |
|
1
|
|
|
|
|
6
|
|
41
|
1
|
|
|
|
|
1
|
$app->asset( 'materialdesign.js' => map {"/js/$_"} @{ $config->{js} }, |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
3
|
|
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |