Add a param to control where to look for the "registry" stuff.

This commit is contained in:
terry%mozilla.org 2000-01-30 19:46:41 +00:00
parent bd4ad592f0
commit 04276b4a04
4 changed files with 36 additions and 13 deletions

View File

@ -49,8 +49,8 @@ work.
First of all you have to get all the tools in mozilla's
mozilla/webtools CVS repository. This includes lxr,bonsai,registry
and tinderbox. You're likely will not need neither tinderbox nor
registry but get them just in case.
and tinderbox. You're likely will not need neither tinderbox but get
it just in case.
To get the sources you have to follow instructions on
http://www.mozilla.org/bonsai.html.

View File

@ -61,6 +61,8 @@ LoadTreeConfig();
require 'cvsquery.pl';
my $userdomain = Param('userdomain');
my $registryurl = Param('registryurl');
$registryurl =~ s@/$@@;
$| = 1;
my $sm_font_tag = "<font face='Arial,Helvetica' size=-2>";
@ -367,8 +369,8 @@ sub print_ci {
print "<tr>\n";
print "<TD width=2%>${sm_font_tag}$t</font>";
print "<TD width=2%><a href='../registry/who.cgi?email=$ci->[$::CI_WHO]' "
. "onClick=\"return js_who_menu('$ci->[$::CI_WHO]','',event);\" >"
print "<TD width=2%><a href='$registryurl/who.cgi?email=$ci->[$::CI_WHO]'"
. " onClick=\"return js_who_menu('$ci->[$::CI_WHO]','',event);\" >"
. "$ci->[$::CI_WHO]</a>\n";
print "<TD width=45%><a href='cvsview2.cgi?subdir=$ci->[$::CI_DIR]&files=$ci->[$::CI_FILE]\&command=DIRECTORY&branch=$::query_branch&root=$::CVS_ROOT'\n"
. " onclick=\"return js_file_menu('$::CVS_ROOT', '$ci->[$::CI_DIR]','$ci->[$::CI_FILE]','$ci->[$::CI_REV]','$::query_branch',event)\">\n";
@ -509,7 +511,7 @@ sub parse_date {
sub setup_script {
my $script_str =<<'ENDJS';
my $script_str = qq{
<script>
var event = 0; // Nav3.0 compatibility
@ -519,7 +521,7 @@ function js_who_menu(n,extra,d) {
return true;
}
l = document.layers['popup'];
l.src="../registry/who.cgi?email="+n+extra;
l.src="$registryurl/who.cgi?email="+n+extra;
if(d.target.y > window.innerHeight + window.pageYOffset - l.clip.height) {
l.top = (window.innerHeight + window.pageYOffset - l.clip.height);
@ -545,7 +547,7 @@ function js_file_menu(repos,dir,file,rev,branch,d) {
}
}
l = document.layers['popup'];
l.src="../registry/file.cgi?cvsroot="+repos+"&file="+file+"&dir="+dir+"&rev="+rev+"&branch="+branch+"&linked_text="+fileName;
l.src="$registryurl/file.cgi?cvsroot="+repos+"&file="+file+"&dir="+dir+"&rev="+rev+"&branch="+branch+"&linked_text="+fileName;
l.top = d.target.y - 6;
l.left = d.target.x - 6;
@ -562,7 +564,7 @@ function js_file_menu(repos,dir,file,rev,branch,d) {
<layer name="popup" onMouseOut="this.visibility='hide';" left=0 top=0 bgcolor="#ffffff" visibility="hide">
</layer>
ENDJS
};
return $script_str;
}

View File

@ -82,6 +82,16 @@ sub check_urlbase {
}
sub check_registryurl {
my ($url) = (@_);
if ($url !~ m:/$:) {
return "must be a legal URL ending with a slash.";
}
return "";
}
@::param_list = ();
@ -309,6 +319,14 @@ DefParam("phonebookurl",
'<a href="mailto:%email_name%">%user_name%</a>'
);
DefParam("registryurl",
"A URL relative to urlbase (or an absolute URL) which leads to the
installed 'registry' package (available from the mozilla.org repository as
a sibling directory to the 'bonsai' directory.). This contains pages that
generate lists of links about a person or a file.",
"t",
qq{../registry/},
\&check_registryurl);

View File

@ -69,6 +69,9 @@ if(!defined($rev)) {
print "Content-type: text/html\n\n";
my $registryurl = Param('registryurl');
$registryurl =~ s@/$@@;
my $script_str;
&setup_script;
@ -198,7 +201,7 @@ $split = int(@files/4)+1;
for $_ (@files){
$_ =~ s/\,v//;
print "<a href=../registry/file.cgi?cvsroot=$CVS_ROOT&file=$_&dir=$dir"
print qq{<a href="$registryurl/file.cgi?cvsroot=$CVS_ROOT&file=$_&dir=$dir"}
. " onclick=\"return js_file_menu('$dir','$_','$rev','$CVS_ROOT',event)\">\n";
print "<dt>$_</a>\n";
if( $j % $split == 0 ){
@ -213,7 +216,7 @@ PutsTrailer();
sub setup_script {
$script_str =<<'ENDJS';
$script_str = qq{
<script>
var event = new Object;
@ -224,7 +227,7 @@ function js_who_menu(n,extra,d) {
return true;
}
l = document.layers['popup'];
l.src="../registry/who.cgi?email="+n+extra;
l.src="$registryurl/who.cgi?email="+n+extra;
if(d.target.y > window.innerHeight + window.pageYOffset - l.clip.height) {
l.top = (window.innerHeight + window.pageYOffset - l.clip.height);
@ -247,7 +250,7 @@ function js_file_menu(dir,file,rev,root,d) {
return true;
}
l = document.layers['popup'];
l.src="../registry/file.cgi?file="+file+"&dir="+dir+"&rev="+rev+"&cvsroot="+root+"&linked_text="+d.target.text;
l.src="$registryurl/file.cgi?file="+file+"&dir="+dir+"&rev="+rev+"&cvsroot="+root+"&linked_text="+d.target.text;
if(d.target.y > window.innerHeight + window.pageYOffset - l.clip.height) {
l.top = (window.innerHeight + window.pageYOffset - l.clip.height);
@ -271,7 +274,7 @@ function js_file_menu(dir,file,rev,root,d) {
<layer name="popup" onMouseOut="this.visibility='hide';" left=0 top=0 bgcolor="#ffffff" visibility="hide">
</layer>
ENDJS
};
}