line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package RapidApp::View::Viewport; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
2562
|
use strict; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
121
|
|
4
|
4
|
|
|
4
|
|
25
|
use warnings; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
109
|
|
5
|
|
|
|
|
|
|
|
6
|
4
|
|
|
4
|
|
25
|
use base 'Catalyst::View::TT'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
429
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
31
|
use RapidApp::Util qw(:all); |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
3896
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
__PACKAGE__->config(TEMPLATE_EXTENSION => '.tt'); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub process { |
13
|
1
|
|
|
1
|
1
|
2078
|
my ($self, $c)= @_; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
23
|
$c->response->header('Cache-Control' => 'no-cache'); |
16
|
1
|
|
|
|
|
241
|
$c->stash->{template} = 'templates/rapidapp/ext_viewport.tt'; |
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
|
|
71
|
my @img = (); |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
12
|
push @img, $self->_get_asset_controller_urls( |
21
|
|
|
|
|
|
|
$c->controller('Assets::ExtJS'), (qw( |
22
|
|
|
|
|
|
|
resources/images/gray/qtip/tip-sprite.gif |
23
|
|
|
|
|
|
|
resources/images/gray/qtip/tip-anchor-sprite.gif |
24
|
|
|
|
|
|
|
resources/images/gray/tabs/tab-strip-bg.gif |
25
|
|
|
|
|
|
|
resources/images/gray/tabs/tab-close.gif |
26
|
|
|
|
|
|
|
resources/images/gray/tabs/tabs-sprite.gif |
27
|
|
|
|
|
|
|
resources/images/gray/panel/white-top-bottom.gif |
28
|
|
|
|
|
|
|
resources/images/gray/panel/tool-sprites.gif |
29
|
|
|
|
|
|
|
resources/images/default/grid/loading.gif |
30
|
|
|
|
|
|
|
resources/images/gray/tree/arrows.gif |
31
|
|
|
|
|
|
|
resources/images/gray/window/left-corners.png |
32
|
|
|
|
|
|
|
resources/images/gray/window/right-corners.png |
33
|
|
|
|
|
|
|
resources/images/gray/window/top-bottom.png |
34
|
|
|
|
|
|
|
resources/images/gray/window/left-right.png |
35
|
|
|
|
|
|
|
resources/images/gray/button/btn.gif |
36
|
|
|
|
|
|
|
resources/images/gray/qtip/bg.gif |
37
|
|
|
|
|
|
|
resources/images/gray/progress/progress-bg.gif |
38
|
|
|
|
|
|
|
resources/images/gray/window/icon-warning.gif |
39
|
|
|
|
|
|
|
resources/images/default/shadow.png |
40
|
|
|
|
|
|
|
resources/images/default/shadow-lr.png |
41
|
|
|
|
|
|
|
resources/images/default/shadow-c.png |
42
|
|
|
|
|
|
|
resources/images/gray/panel/corners-sprite.gif |
43
|
|
|
|
|
|
|
resources/images/gray/panel/top-bottom.gif |
44
|
|
|
|
|
|
|
resources/images/gray/panel/left-right.gif |
45
|
|
|
|
|
|
|
)) |
46
|
|
|
|
|
|
|
); |
47
|
|
|
|
|
|
|
|
48
|
1
|
|
|
|
|
848
|
push @img, $self->_get_asset_controller_urls( |
49
|
|
|
|
|
|
|
$c->controller('Assets::RapidApp::Icons'), (qw( |
50
|
|
|
|
|
|
|
warning.png |
51
|
|
|
|
|
|
|
loading.gif |
52
|
|
|
|
|
|
|
refresh.gif |
53
|
|
|
|
|
|
|
refresh_24x24.png |
54
|
|
|
|
|
|
|
)) |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
1
|
|
|
|
|
597
|
push @img, $self->_get_asset_controller_urls( |
58
|
|
|
|
|
|
|
$c->controller('Assets::RapidApp::Misc'), (qw( |
59
|
|
|
|
|
|
|
images/rapidapp_powered_logo_tiny.png |
60
|
|
|
|
|
|
|
)) |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# Misc static images: |
64
|
1
|
|
50
|
|
|
865
|
my $pfx = $c->mount_url || ''; |
65
|
1
|
|
|
|
|
4
|
push @{$c->stash->{precache_imgs}}, map { "$pfx$_" } (qw( |
|
1
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
77
|
|
66
|
|
|
|
|
|
|
/assets/rapidapp/misc/static/icon-error.gif |
67
|
|
|
|
|
|
|
/assets/rapidapp/misc/static/s.gif |
68
|
|
|
|
|
|
|
)); |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
71
|
1
|
|
50
|
|
|
5
|
$c->stash->{precache_imgs} ||= []; |
72
|
1
|
|
|
|
|
69
|
@{$c->stash->{precache_imgs}} = uniq(@{$c->stash->{precache_imgs}},@img); |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
4
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
die "ERROR: stash params 'config_url' and 'panel_cfg' cannot be used together" |
75
|
1
|
50
|
33
|
|
|
74
|
if($c->stash->{config_url} && $c->stash->{panel_cfg}); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# make sure config_params is a string of JSON |
78
|
1
|
50
|
|
|
|
131
|
if (ref $c->stash->{config_params}) { |
79
|
0
|
|
|
|
|
0
|
$c->stash->{config_params}= RapidApp::JSON::MixedEncoder::encode_json($c->stash->{config_params}); |
80
|
|
|
|
|
|
|
} |
81
|
|
|
|
|
|
|
|
82
|
1
|
50
|
|
|
|
68
|
if (ref $c->stash->{panel_cfg}) { |
83
|
0
|
|
|
|
|
0
|
$c->stash->{panel_cfg}= RapidApp::JSON::MixedEncoder::encode_json($c->stash->{panel_cfg}); |
84
|
|
|
|
|
|
|
} |
85
|
|
|
|
|
|
|
|
86
|
1
|
|
|
|
|
66
|
return $self->next::method($c); |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
sub _get_asset_controller_urls { |
91
|
3
|
|
|
3
|
|
250
|
my ($self, $controller, @paths)= @_; |
92
|
3
|
50
|
|
|
|
11
|
return () unless ($controller); |
93
|
3
|
|
|
|
|
6
|
return map { $controller->asset_path($_) } @paths; |
|
28
|
|
|
|
|
20931
|
|
94
|
|
|
|
|
|
|
} |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
1; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
__END__ |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=head1 NAME |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
RapidApp::View::Viewport - Render a Module within an ExtJS Viewport |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=head1 DESCRIPTION |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
This is the main View for rendering a top-level RapidApp Module within the browser. This |
109
|
|
|
|
|
|
|
component class is used internally by plugins like L<TabGui|Catalyst::Plugin::RapidApp::TabGui>. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
The JavaScript function C<Ext.ux.RapidApp.AutoPanel> is used to fetch and decode the |
112
|
|
|
|
|
|
|
configured Module URL via Ajax. |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
More documentation TDB... |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head1 SEE ALSO |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=over |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item * |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
L<RapidApp::Manual::Modules> |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=back |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=head1 AUTHOR |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
Henry Van Styn <vanstyn@cpan.org> |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This software is copyright (c) 2013 by IntelliTree Solutions llc. |
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
135
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=cut |