/[Frey]/trunk/lib/Frey/Editor.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

Diff of /trunk/lib/Frey/Editor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 417 by dpavlin, Tue Nov 18 16:39:13 2008 UTC revision 617 by dpavlin, Sat Nov 29 15:05:55 2008 UTC
# Line 7  extends 'Frey::ClassLoader'; Line 7  extends 'Frey::ClassLoader';
7    
8  Support for local editor invocation from web  Support for local editor invocation from web
9    
10   <a href="/editor+$path+$line" target="editor">$class</a>   <a target="editor" href="/editor+$path+$line">$class</a>
11    
12  =head2 url  =head2 url
13    
# Line 23  sub url_regex { qr{/editor\+?(.+?)\+(\d+ Line 23  sub url_regex { qr{/editor\+?(.+?)\+(\d+
23    
24  =cut  =cut
25    
26    sub switch_screen {
27            my $cmd = 'xdotool key super+Tab';
28            warn "# switch_screen $cmd";
29            system $cmd;
30    }
31    
32  sub command {  sub command {
33          my ( $self, $url ) = @_;          my ( $self, $url ) = @_;
34          $url =~ url_regex;          $url =~ url_regex;
# Line 32  sub command { Line 38  sub command {
38          $path = $self->class_path( $path ) || $path if ! -e $path;          $path = $self->class_path( $path ) || $path if ! -e $path;
39          my $cmd = "$editor $path +$line";          my $cmd = "$editor $path +$line";
40          warn "# $url -> system $cmd";          warn "# $url -> system $cmd";
41          return $cmd;          $self->switch_screen;
42            system $cmd;
43            $self->switch_screen;
44  }  }
45    
46  1;  1;

Legend:
Removed from v.417  
changed lines
  Added in v.617

  ViewVC Help
Powered by ViewVC 1.1.26