6 use Digest::MD5 qw(md5_hex);
8 chdir("/home/jquery/www/src/");
11 my $c = $cgi->param('c') || 'compressed';
12 my $v = $cgi->param('v');
13 #$v = "0.10" if ( $v eq 'latest' );
14 my @files = $cgi->param('files') ?
15 split(',', join(',', $cgi->param('files')) ):
16 ("jquery","minifx","fx","event");
18 my $md5 = $cgi->param('custom') || join('-',dupe(@files),$v,$c);
19 my $j = "build/$md5\.js";
24 $f .= `cat $_/$_\-$v\.js`;
27 my $o = $c eq 'compressed' ? &Pack::pack($f, 62, 1, 0) : $f;
33 if ( $cgi->param('files') ) {
34 print $cgi->redirect("/src/$v/$md5/");
36 print $cgi->header('text/javascript');
37 my $t = `cat copyright.txt $j`;
38 $v = $v eq 'latest' ? 'Current' : "Version $v";
39 $t =~ s/\$VERSION/$v/ig;
40 $t =~ s/\$MD5/$md5/ig;
41 my $url = $cgi->param('v') . "/";
42 $url .= $cgi->param('custom') . "/" if ( $cgi->param('custom') );
43 $t =~ s/\$URL/$url/ig;
49 $check{$_} = 1 foreach (@_);
50 return sort keys %check;