/[Frey]/trunk/lib/Frey/Bookmarklet.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /trunk/lib/Frey/Bookmarklet.pm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 206 - (hide annotations)
Thu Oct 30 22:35:11 2008 UTC (15 years, 6 months ago) by dpavlin
File size: 1725 byte(s)
restructure bookmarklets and put them in status bar with CSS popup
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     <ul>
28 dpavlin 206 <li>Inspectors</li>
29     <ul>
30     <li><a href="javascript:void($js);">xpath</a> (click again to inspect any element)</li>
31     <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</a></li>
32     </ul>
33     <li>Frames management</li>
34     <ul>
35     <li><a href="javascript:f='';for(x=0;x<window.frames.length;x++){f+=x+':'+window.frames[x].name+'\n';};d=prompt('Frame?\n'+f,'');if (!d) { d=0 };window.location=window.frames[d].location;">x</a> close frame (with alert selector)</li>
36     <li><a href="javascript:document.write('<HTML><HEAD></HEAD><FRAMESET ROWS=\'50%,*\'><FRAME SRC=' + location.href + '><FRAME SRC=' + location.href + '></FRAMESET></HTML>');">h</a> horizontal split</li>
37     <li><a href="javascript:document.write('<HTML><HEAD></HEAD><FRAMESET COLS=\'50%,*\'><FRAME SRC=' + location.href + '><FRAME SRC=' + location.href + '></FRAMESET></HTML>');">v</a> vertical split</li>
38     <!--
39     <li><a href=""></a></li>
40     -->
41     </ul>
42     </ul>
43 dpavlin 201 |;
44    
45 dpavlin 206 return $self->page(
46     title => 'Bookmarklets for developers',
47     body => $html,
48     ) if $self->can('page');
49    
50     return $html;
51 dpavlin 201 }
52    
53     1;

  ViewVC Help
Powered by ViewVC 1.1.26