From 24f331a226911ee274965eeb97d79307966e56dd Mon Sep 17 00:00:00 2001 From: Akinori MUSHA Date: Sun, 3 Sep 2000 18:45:10 +0000 Subject: [PATCH] Merge from knu-cvsweb 1.94.1.17. 2000-09-04 03:25 knu * README.knu, cvsweb.cgi, cvsweb.conf: Introduce manpage hyperlinking. 2000-09-04 02:33 knu * cvsweb.cgi: Get all mail URLs and addresses as hyperlinks, not just the first one. (s/// --> s///g) --- en/cgi/cvsweb.cgi | 34 +++++++++++++++++++++------------- en/cgi/cvsweb.conf | 4 ++-- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/en/cgi/cvsweb.cgi b/en/cgi/cvsweb.cgi index 224b625cde..520dd492ee 100755 --- a/en/cgi/cvsweb.cgi +++ b/en/cgi/cvsweb.cgi @@ -42,8 +42,8 @@ # SUCH DAMAGE. # # $zId: cvsweb.cgi,v 1.94 2000/08/24 06:41:22 hnordstrom Exp $ -# $Id: cvsweb.cgi,v 1.48 2000-08-25 09:21:00 knu Exp $ -# $FreeBSD: www/en/cgi/cvsweb.cgi,v 1.47 2000/08/15 08:47:40 knu Exp $ +# $Id: cvsweb.cgi,v 1.49 2000-09-03 18:45:10 knu Exp $ +# $FreeBSD: www/en/cgi/cvsweb.cgi,v 1.48 2000/08/25 09:21:00 knu Exp $ # ### @@ -54,8 +54,8 @@ use vars qw ( %CVSROOT %CVSROOTdescr %MIRRORS %DEFAULTVALUE %ICONS %MTYPES %alltags @tabcolors %fileinfo %tags @branchnames %nameprinted %symrev %revsym @allrevisions %date %author @revdisplayorder - @revisions %state %difflines %log %branchpoint @revorder $prcgi - @prcategories $prcategories + @revisions %state %difflines %log %branchpoint @revorder + $prcgi @prcategories $prcategories $mancgi $checkoutMagic $doCheckout $scriptname $scriptwhere $where $pathinfo $Browser $nofilelinks $maycompress @stickyvars %funcline_regexp $is_mod_perl @@ -354,6 +354,7 @@ foreach my $k (keys %ICONS) { do "$config-$cvstree" if (-f "$config-$cvstree"); $prcategories = '(?:' . join('|', @prcategories) . ')'; +$prcgi .= '%s' if defined($prcgi) && $prcgi !~ /%s/; $fullname = $cvsroot . '/' . $where; $mimetype = &getMimeTypeFromSuffix ($fullname); @@ -893,7 +894,7 @@ sub findLastModifiedSubdirs(@) { } sub htmlify($;$) { - my($string, $pr) = @_; + my($string, $extra) = @_; # Special Characters; RFC 1866 $string =~ s/&/&/g; @@ -902,14 +903,21 @@ sub htmlify($;$) { $string =~ s/>/>/g; # get URL's as link .. - $string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`$1$2$3`; + $string =~ s`(http|ftp|https)(://[-a-zA-Z0-9%.~:_/]+)([?&]([-a-zA-Z0-9%.~:_]+)=([-a-zA-Z0-9%.~:_])+)*`$1$2$3`g; # get e-mails as link - $string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`$1`; + $string =~ s`([-a-zA-Z0-9_.]+@([-a-zA-Z0-9]+\.)+[A-Za-z]{2,4})`$1`g; - # get #PR as link .. - if ($pr && defined($prcgi)) { - 1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`$1$2`i; - $string =~ s`\b${prcategories}/(\d+)\b`$&`igo; + if ($extra) { + # get PR #'s as link .. + if (defined($prcgi)) { + 1 while $string =~ s`\b(pr[:#]?\s*(?:#?\d+[,\s]\s*)*#?)(\d+)\b`sprintf('%s%s', $1, sprintf($prcgi, $2), $2)`ie; + $string =~ s`\b${prcategories}/(\d+)\b`sprintf('%s', sprintf($prcgi, $1), $&)`igeo; + } + + # get manpage specs as link .. + if (defined($mancgi)) { + $string =~ s`\b([a-zA-Z]\w+)\(([0-9n])\)\B`sprintf('%s', sprintf($mancgi, $2, $1), $&)`ge; + } } return $string; @@ -2389,7 +2397,7 @@ sub navigateHeader($$$$$) { $swhere = urlencode($filename) if ($swhere eq ""); print "<\!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">"; print "\n\n"; - print ''; + print ''; print "\n$path$filename - $title - $rev\n"; print "\n"; print ""; @@ -2741,7 +2749,7 @@ sub http_header(;$) { sub html_header($) { my ($title) = @_; - my $version = '$zRevision: 1.94 $ $Revision: 1.48 $'; #' + my $version = '$zRevision: 1.94 $ $Revision: 1.49 $'; #' http_header(); (my $header = &cgi_style::html_header) =~ s/^.*\n\n//; # remove HTTP response header diff --git a/en/cgi/cvsweb.conf b/en/cgi/cvsweb.conf index 18ac1dcfc2..2845ca7dec 100644 --- a/en/cgi/cvsweb.conf +++ b/en/cgi/cvsweb.conf @@ -7,8 +7,8 @@ # 2000 A. MUSHA # based on work by Bill Fenner # $zId: cvsweb.conf,v 1.27 2000/07/27 10:16:39 kcoar Exp $ -# $Id: cvsweb.conf,v 1.4 2000-08-25 09:21:00 knu Exp $ -# $FreeBSD: www/en/cgi/cvsweb.conf,v 1.3 2000/08/15 20:16:37 knu Exp $ +# $Id: cvsweb.conf,v 1.5 2000-09-03 18:45:10 knu Exp $ +# $FreeBSD: www/en/cgi/cvsweb.conf,v 1.4 2000/08/25 09:21:00 knu Exp $ # ###