15 |
|
|
16 |
my $config_path = $0; |
my $config_path = $0; |
17 |
$config_path =~ s/.cgi/.js/; |
$config_path =~ s/.cgi/.js/; |
18 |
|
|
19 |
|
my $hostname = `hostname -s`; |
20 |
|
chomp($hostname); |
21 |
|
$hostname .= '.js'; |
22 |
|
$config_path = $hostname if -e $hostname; |
23 |
|
|
24 |
my $config = from_json( read_file( $config_path ) ); |
my $config = from_json( read_file( $config_path ) ); |
25 |
my $repository_dir = $config->{repository_dir} || die "no repository_dir in $config_path"; |
my $repository_dir = $config->{repository_dir} || die "no repository_dir in $config_path"; |
26 |
my $svnweb = $config->{svnweb} || die "no svnweb in $config_path"; |
my $svnweb = $config->{svnweb} || die "no svnweb in $config_path"; |
27 |
|
die "no js URLs to Exhibit API and/or plugins" unless $config->{js}; |
28 |
|
|
29 |
my $limit = 1000; |
my $limit = 1000; |
30 |
|
|
52 |
my $onChange = qq{document.getElementById('current_repository').submit();}; |
my $onChange = qq{document.getElementById('current_repository').submit();}; |
53 |
# we want to activete javascript magic refresh after we hit submit for the first time, and not always |
# we want to activete javascript magic refresh after we hit submit for the first time, and not always |
54 |
$onChange = '' unless $q->param('did_submit'); |
$onChange = '' unless $q->param('did_submit'); |
55 |
|
my $first_letter = substr($repositories[0],0,1); |
56 |
return ( |
return ( |
57 |
$q->start_form( -name => 'current_repository', -id => 'current_repository', -method => 'post' ), |
$q->start_form( -name => 'current_repository', -id => 'current_repository', -method => 'post' ), |
58 |
"From repository ", |
"From repository ", |
59 |
$q->popup_menu( -name => 'repository', -values => [ @repositories ], -onChange => $onChange ), |
$q->param('did_submit') ? |
60 |
|
$q->popup_menu( -name => 'repository', -values => [ @repositories ], -onChange => $onChange ) : |
61 |
|
"<table><tr><th>$first_letter</th><td>" . join( '', map { |
62 |
|
my $delimiter = ''; |
63 |
|
if ( substr($_,0,1) ne $first_letter ) { |
64 |
|
$first_letter = substr($_,0,1); |
65 |
|
$delimiter = "</td></tr>\n<tr><th>$first_letter</th><td>"; |
66 |
|
} |
67 |
|
$delimiter . $q->radio_group( -name => 'repository', -values => [ $_ ] ) |
68 |
|
} @repositories ) . "<td></tr></table>", |
69 |
|
#$q->radio_group( -name => 'repository', -values => [ map { "$_, " } @repositories ], -onChange => $onChange ), # , -linebreak => 'true' ), |
70 |
" show ", |
" show ", |
71 |
$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 ), |
72 |
" revisions and ", |
" revisions and ", |
73 |
$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 ), |
74 |
" ", |
" ", |
75 |
$q->submit(-name=>'did_submit', -value=>'in Exhibit'), |
$q->submit(-value=>'in Exhibit'), |
76 |
|
$q->hidden(-name=>'did_submit', -value=>1), |
77 |
$q->end_form |
$q->end_form |
78 |
); |
); |
79 |
} |
} |
92 |
type="application/json" |
type="application/json" |
93 |
href="|, $q->url( -query => 1 ), qq|&json=1" /> |
href="|, $q->url( -query => 1 ), qq|&json=1" /> |
94 |
|
|
95 |
<!-- |
|, 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> |
|
|
|
|
96 |
|
|
97 |
</head> |
</head> |
98 |
<body> |
<body> |