1 |
dpavlin |
201 |
package Frey::Bookmarklet; |
2 |
|
|
use Moose; |
3 |
|
|
|
4 |
|
|
=head1 NAME |
5 |
|
|
|
6 |
|
|
Frey::Bookmarklet - provide bookmarklets for developers |
7 |
|
|
|
8 |
|
|
=head2 SEE ALSO |
9 |
|
|
|
10 |
|
|
L<http://slayeroffice.com/tools/modi/v2.0/modi_help.html> |
11 |
|
|
|
12 |
|
|
=cut |
13 |
|
|
|
14 |
|
|
extends 'Frey'; |
15 |
|
|
with 'Frey::Web'; |
16 |
|
|
|
17 |
|
|
use File::Slurp; |
18 |
|
|
|
19 |
|
|
sub markup { |
20 |
|
|
my $self = shift; |
21 |
|
|
|
22 |
|
|
my $js = read_file( 'static/xpath.js' ); |
23 |
|
|
$js =~ s{//.*}{}gm; # remove comments so that compaction below doesn't screw code |
24 |
|
|
$js =~ s/\s\s+/ /gs; |
25 |
|
|
|
26 |
|
|
my $html = qq| |
27 |
|
|
<h1>Bookmarklets for developers</h1> |
28 |
|
|
<ul> |
29 |
|
|
<li><a href="javascript:void($js);">xpath</a> inspector</li> |
30 |
|
|
<li><a href="javascript:prefFile='';void(z=document.body.appendChild(document.createElement('script')));void(z.language='javascript');void(z.type='text/javascript');void(z.src='http://slayeroffice.com/tools/modi/v2.0/modi_v2.0.js');void(z.id='modi');">MODIv2</li> |
31 |
|
|
|; |
32 |
|
|
|
33 |
|
|
return $self->page( body => $html ); |
34 |
|
|
} |
35 |
|
|
|
36 |
|
|
1; |