line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Padre::Plugin::ViewInBrowser;
|
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
22916
|
use warnings;
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
4
|
1
|
|
|
1
|
|
4
|
use strict;
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
41
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.07';
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
4
|
use base 'Padre::Plugin';
|
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
670
|
|
9
|
1
|
|
|
1
|
|
394
|
use Padre::Wx ();
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub padre_interfaces {
|
12
|
|
|
|
|
|
|
'Padre::Plugin' => '0.26',
|
13
|
|
|
|
|
|
|
}
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub menu_plugins_simple {
|
16
|
|
|
|
|
|
|
my $self = shift;
|
17
|
|
|
|
|
|
|
return ('ViewInBrowser' => [
|
18
|
|
|
|
|
|
|
'View in Browser', sub { $self->view_in_browser },
|
19
|
|
|
|
|
|
|
]);
|
20
|
|
|
|
|
|
|
}
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub view_in_browser {
|
23
|
|
|
|
|
|
|
my ( $self ) = @_;
|
24
|
|
|
|
|
|
|
my $main = $self->main;
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $filename = $main->current->filename;
|
27
|
|
|
|
|
|
|
unless ( $filename ) {
|
28
|
|
|
|
|
|
|
Wx::MessageBox( 'What to open? God KNOWS!',
|
29
|
|
|
|
|
|
|
'Error', Wx::wxOK | Wx::wxCENTRE, $main );
|
30
|
|
|
|
|
|
|
return;
|
31
|
|
|
|
|
|
|
}
|
32
|
|
|
|
|
|
|
Wx::LaunchDefaultBrowser($filename);
|
33
|
|
|
|
|
|
|
}
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1;
|
36
|
|
|
|
|
|
|
__END__
|