line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mojolicious::Plugin::Angular::MaterialDesign; |
2
|
2
|
|
|
2
|
|
10569
|
use 5.008001; |
|
2
|
|
|
|
|
7
|
|
3
|
2
|
|
|
2
|
|
6
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
29
|
|
4
|
2
|
|
|
2
|
|
10
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
53
|
|
5
|
|
|
|
|
|
|
|
6
|
2
|
|
|
2
|
|
393
|
use Mojo::Base 'Mojolicious::Plugin'; |
|
2
|
|
|
|
|
6850
|
|
|
2
|
|
|
|
|
11
|
|
7
|
2
|
|
|
2
|
|
1637
|
use Mojolicious::Plugin::AssetPack; |
|
2
|
|
|
|
|
74256
|
|
|
2
|
|
|
|
|
16
|
|
8
|
2
|
|
|
2
|
|
59
|
use File::Spec::Functions 'catdir'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
76
|
|
9
|
2
|
|
|
2
|
|
6
|
use Cwd (); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
538
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '1.1.0'; |
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
|
8
|
my ( $class ) = @_; |
18
|
1
|
|
|
|
|
82
|
my $path = Cwd::abs_path(__FILE__); |
19
|
1
|
|
|
|
|
5
|
$path =~ s!\.pm$!!; |
20
|
1
|
|
|
|
|
4
|
return $path; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub register { |
24
|
1
|
|
|
1
|
1
|
34
|
my ( $self, $app, $config ) = @_; |
25
|
|
|
|
|
|
|
|
26
|
1
|
50
|
|
|
|
2
|
$app->plugin('AssetPack') unless eval { $app->asset }; |
|
1
|
|
|
|
|
9
|
|
27
|
|
|
|
|
|
|
|
28
|
1
|
|
50
|
|
|
18571
|
$config->{css} ||= [@DEFAULT_CSS_FILES]; |
29
|
1
|
|
50
|
|
|
8
|
$config->{js} ||= [@DEFAULT_JS_FILES]; |
30
|
1
|
|
50
|
|
|
5
|
$config->{jquery} //= 1; |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
1
|
push @{ $app->static->paths }, $self->asset_path; |
|
1
|
|
|
|
|
4
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# TODO: 'bootstrap_resources.scss' |
35
|
1
|
50
|
|
|
|
1
|
if ( @{ $config->{css} } ) { |
|
1
|
|
|
|
|
3
|
|
36
|
1
|
|
|
|
|
8
|
$app->asset( 'materialdesign.css' => map {"/css/$_"} |
37
|
1
|
|
|
|
|
4
|
@{ $config->{css} } ); |
|
1
|
|
|
|
|
3
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
1
|
50
|
|
|
|
4539
|
if ( @{ $config->{js} } ) { |
|
1
|
|
|
|
|
6
|
|
41
|
1
|
|
|
|
|
1
|
$app->asset( 'materialdesign.js' => map {"/js/$_"} @{ $config->{js} }, |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
2
|
|
42
|
|
|
|
|
|
|
); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |
48
|
|
|
|
|
|
|
__END__ |