/[simile]/svn/index.cgi
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 /svn/index.cgi

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

revision 30 by dpavlin, Mon Oct 20 19:41:49 2008 UTC revision 44 by dpavlin, Mon Oct 27 19:38:41 2008 UTC
# Line 9  use XML::Simple; Line 9  use XML::Simple;
9  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
10  use JSON;  use JSON;
11  use CGI;  use CGI;
12    use File::Slurp;
13    
14  my $debug = $ENV{'DEBUG'} || 0;  my $debug = $ENV{'DEBUG'} || 0;
15    
16  my $limit = 1000;  my $config_path = $0;
17    $config_path =~ s/.cgi/.js/;
18  my $repository_dir = '/srv/svn';  my $config = from_json( read_file( $config_path ) );
19  my $svnweb = 'https://svn-strix.carnet.hr/private/svnweb/index.cgi/%s/revision?rev=%d';  my $repository_dir = $config->{repository_dir} || die "no repository_dir in $config_path";
20    my $svnweb = $config->{svnweb} || die "no svnweb in $config_path";
21    die "no js URLs to Exhibit API and/or plugins" unless $config->{js};
22    
23  # my local config for development  my $limit = 1000;
 $repository_dir = '/home/dpavlin/private/svn';  
 $svnweb = 'http://localhost/svnweb/index.cgi/%s/revision?rev=%d';  
 # my local svk mirrors  
 $repository_dir = '/home/dpavlin/.svk';  
 $svnweb = 'http://localhost/svnweb/svk/index.cgi/%s/revision?rev=%d';  
24    
25  # for older JSON  # for older JSON
26  #sub encode_json { objToJson( @_ ) }  #sub encode_json { objToJson( @_ ) }
# Line 46  warn "# limit: ", $q->param('limit'); Line 44  warn "# limit: ", $q->param('limit');
44    
45  sub select_repository {  sub select_repository {
46          my $onChange = qq{document.getElementById('current_repository').submit();};          my $onChange = qq{document.getElementById('current_repository').submit();};
47            # we want to activete javascript magic refresh after we hit submit for the first time, and not always
48            $onChange = '' unless $q->param('did_submit');
49          return (          return (
50                  $q->start_form( -name => 'current_repository', -id => 'current_repository', -method => 'post' ),                  $q->start_form( -name => 'current_repository', -id => 'current_repository', -method => 'post' ),
51                  "From repository ",                  "From repository ",
52                  $q->popup_menu( -name => 'repository', -values => [ @repositories ], -onChange => $onChange ),                  $q->popup_menu( -name => 'repository', -values => [ @repositories ], -onChange => $onChange ),
53                  " show ",                  " show ",
54                  $q->popup_menu( -name => 'limit', -values => [ qw/100 500 1000 5000 10000/ ], -onChange => $onChange ),                  $q->popup_menu( -name => 'limit', -values => [ qw/100 500 1000 5000 10000/ ], -onChange => $onChange ),
55                  " revisions with ",                  " revisions and ",
56                  $q->checkbox(-name=>'path', -checked=>1, -value=>'ON', -label=>'path modifications', -onChange => $onChange ),                  $q->checkbox(-name=>'path', -checked=>1, -value=>'ON', -label=>'path modifications', -onChange => $onChange ),
57                  $q->submit,                  " ",
58                    $q->submit(-name=>'did_submit', -value=>'in Exhibit'),
59                  $q->end_form                  $q->end_form
60          );          );
61  }  }
# Line 73  if ( ! $repository ) { Line 74  if ( ! $repository ) {
74      type="application/json"      type="application/json"
75      href="|, $q->url( -query => 1 ), qq|&json=1" />      href="|, $q->url( -query => 1 ), qq|&json=1" />
76    
77  <!--  |, join("\n", map { qq|<script src="$_" type="text/javascript"></script>| } @{ $config->{js} } ), qq|
 <script  
         src="http://static.simile.mit.edu/exhibit/api-2.0/exhibit-api.js"  
         type="text/javascript"></script>  
   
 <script  
         src="http://static.simile.mit.edu/exhibit/extensions-2.0/time/time-extension.js"></script>  
 -->  
   
 <script  
         src="../exhibit/api/exhibit-api.js"  
         type="text/javascript"></script>  
 <script  
         src="..//exhibit/extensions/time/time-extension.js"></script>  
   
78    
79  </head>  </head>
80  <body>  <body>

Legend:
Removed from v.30  
changed lines
  Added in v.44

  ViewVC Help
Powered by ViewVC 1.1.26