From a2b98618afb3a9986863aaa8a81c19db9aafe755 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" Date: Fri, 17 Sep 1999 15:47:03 +0000 Subject: [PATCH] Patch by Ian Wells -- disable JavaScript magic on IE (where it wasn't working), other minor cleanups. --- webtools/bonsai/cvsblame.cgi | 6 ++-- webtools/bonsai/cvsquery.cgi | 6 ++-- webtools/bonsai/cvsquery.pl | 28 +--------------- webtools/bonsai/get_line.pl | 60 +++++++++++++++++++++++++++++++++++ webtools/bonsai/globals.pl | 4 +-- webtools/bonsai/maketables.sh | 2 +- webtools/bonsai/modules.pl | 31 ++---------------- webtools/bonsai/rview.cgi | 10 ++++-- 8 files changed, 82 insertions(+), 65 deletions(-) create mode 100644 webtools/bonsai/get_line.pl diff --git a/webtools/bonsai/cvsblame.cgi b/webtools/bonsai/cvsblame.cgi index a8153009f9c..3803ce5ebd0 100755 --- a/webtools/bonsai/cvsblame.cgi +++ b/webtools/bonsai/cvsblame.cgi @@ -415,7 +415,8 @@ var event = 0; // Nav3.0 compatibility document.loaded = false; function finishedLoad() { - if (parseInt(navigator.appVersion) < 4) { + if (parseInt(navigator.appVersion) < 4 || + navigator.userAgent.toLowerCase().indexOf("msie") != -1) { return true; } document.loaded = true; @@ -431,7 +432,8 @@ function revToName (rev) { } function log(event, prev_rev, rev) { - if (parseInt(navigator.appVersion) < 4) { + if (parseInt(navigator.appVersion) < 4 || + navigator.userAgent.toLowerCase().indexOf("msie") != -1) { return true; } diff --git a/webtools/bonsai/cvsquery.cgi b/webtools/bonsai/cvsquery.cgi index 72a722a2037..414f9c65661 100755 --- a/webtools/bonsai/cvsquery.cgi +++ b/webtools/bonsai/cvsquery.cgi @@ -478,7 +478,8 @@ $script_str =<<'ENDJS'; var event = 0; // Nav3.0 compatibility function js_who_menu(n,extra,d) { - if( parseInt(navigator.appVersion) < 4 ){ + if( parseInt(navigator.appVersion) < 4 || + navigator.userAgent.toLowerCase().indexOf("msie") != -1 ){ return true; } l = document.layers['popup']; @@ -497,7 +498,8 @@ function js_who_menu(n,extra,d) { function js_file_menu(repos,dir,file,rev,branch,d) { var fileName=""; - if( parseInt(navigator.appVersion) < 4 ){ + if( parseInt(navigator.appVersion) < 4 || + navigator.userAgent.toLowerCase().indexOf("msie") != -1 ){ return true; } for (var i=0;i) ){ - chop($l); - if( $l =~ /^[ \t]*\#/ - || $l =~ /^[ \t]*$/ ){ - $l=''; - } - elsif( $l =~ /\\[ \t]*$/ ){ - chop ($l); - $save .= $l . ' '; - } - elsif( $l eq '' && $save eq ''){ - # ignore blank lines - } - else { - $bContinue = 0; - } - } - return $save . $l; -} - diff --git a/webtools/bonsai/get_line.pl b/webtools/bonsai/get_line.pl new file mode 100644 index 00000000000..c77f1abfd23 --- /dev/null +++ b/webtools/bonsai/get_line.pl @@ -0,0 +1,60 @@ +# -*- Mode: perl; indent-tabs-mode: nil -*- +# +# The contents of this file are subject to the Netscape Public License +# Version 1.0 (the "License"); you may not use this file except in +# compliance with the License. You may obtain a copy of the License at +# http://www.mozilla.org/NPL/ +# +# Software distributed under the License is distributed on an "AS IS" +# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +# License for the specific language governing rights and limitations +# under the License. +# +# The Original Code is the Bonsai CVS tool. +# +# The Initial Developer of the Original Code is Netscape Communications +# Corporation. Portions created by Netscape are Copyright (C) 1998 +# Netscape Communications Corporation. All Rights Reserved. + +# Get a line, dealing with '\'. Returns 'undef' when no more lines to return; +# removes blank lines as it goes. +# Allows spaces after a '\'. This is naughty but will probably not matter +# *too* much, and I'm not changing it now. +sub get_line { + my($l, $save); + $l=''; + $save=''; + + my $bContinue = 1; + + while( $bContinue && ($l = ) ){ + chop($l); + if( $l =~ /^[ \t]*\#/ + || $l =~ /^[ \t]*$/ ){ + $l=''; # Starts with a "#", or is only whitespace. + } + if( $l =~ /\\[ \t]*$/ ){ + # Ends with a slash, so append it to the last line. + chop ($l); + $save .= $l . ' '; + $l=''; + } + elsif( $l eq '' && $save eq ''){ + # ignore blank lines + } + else { + $bContinue = 0; + } + } + if(!defined($l)) { + if($save ne '') { + return $save; + } else { + return $l; + } + } else { + return $save . $l; + } +} + +1; diff --git a/webtools/bonsai/globals.pl b/webtools/bonsai/globals.pl index 8a66c306a89..57e46e4bdb5 100644 --- a/webtools/bonsai/globals.pl +++ b/webtools/bonsai/globals.pl @@ -124,9 +124,9 @@ sub SendSQL { my ($rows); $::currentquery = $::db->prepare($str) - || die "'$str': $::db->errstr"; + || die "'$str': ". $::db->errstr; $rows = $::currentquery->execute - || die "'$str': Can't execute the query: $::currentquery->errstr"; + || die "'$str': Can't execute the query: " . $::currentquery->errstr; } sub MoreSQLData { diff --git a/webtools/bonsai/maketables.sh b/webtools/bonsai/maketables.sh index cee01923d00..054bccd397c 100755 --- a/webtools/bonsai/maketables.sh +++ b/webtools/bonsai/maketables.sh @@ -34,7 +34,7 @@ read dummy echo Dropping old tables -$MYSQL > /dev/null 2>/dev/null << OK_ALL_DONE +$MYSQL << OK_ALL_DONE use bonsai; diff --git a/webtools/bonsai/modules.pl b/webtools/bonsai/modules.pl index aef3a339652..3106a6d520c 100755 --- a/webtools/bonsai/modules.pl +++ b/webtools/bonsai/modules.pl @@ -16,6 +16,7 @@ # Corporation. Portions created by Netscape are Copyright (C) 1998 # Netscape Communications Corporation. All Rights Reserved. +require 'get_line.pl'; $NOT_LOCAL = 1; $IS_LOCAL = 2; @@ -26,7 +27,7 @@ if( $CVS_ROOT eq "" ){ $CVS_ROOT = pickDefaultRepository(); } -if( $ENV{"OS"} eq "Windows_NT" ){ +if( defined($ENV{"OS"}) && $ENV{"OS"} eq "Windows_NT" ){ $CVS_MODULES='modules'; } else { @@ -140,31 +141,3 @@ sub build_map { } return $bFound; } - - - -sub get_line { - local($l, $save); - - $bContinue = 1; - - while( $bContinue && ($l = ) ){ - chop($l); - if( $l =~ /^[ \t]*\#/ - || $l =~ /^[ \t]*$/ ){ - $l=''; # Starts with a "#", or is only whitespace. - } - if( $l =~ /\\[ \t]*$/ ){ - # Ends with a slash, so append it to the last line. - chop ($l); - $save .= $l . ' '; - } - elsif( $l eq '' && $save eq ''){ - # ignore blank lines - } - else { - $bContinue = 0; - } - } - return $save . $l; -} diff --git a/webtools/bonsai/rview.cgi b/webtools/bonsai/rview.cgi index 9f13657a3de..3c03221fccf 100755 --- a/webtools/bonsai/rview.cgi +++ b/webtools/bonsai/rview.cgi @@ -46,6 +46,10 @@ $dir =~ s/([^:]*)\/$/$1/; $rev = $::FORM{"rev"}; +if(!defined($rev)) { + $rev=''; +} + print "Content-type: text/html\n\n"; @@ -187,7 +191,8 @@ $script_str =<<'ENDJS'; var event = new Object; function js_who_menu(n,extra,d) { - if( parseInt(navigator.appVersion) < 4 ){ + if( parseInt(navigator.appVersion) < 4 || + navigator.userAgent.toLowerCase().indexOf("msie") != -1 ){ return true; } l = document.layers['popup']; @@ -209,7 +214,8 @@ function js_who_menu(n,extra,d) { } function js_file_menu(dir,file,rev,root,d) { - if( parseInt(navigator.appVersion) < 4 ){ + if( parseInt(navigator.appVersion) < 4 || + navigator.userAgent.toLowerCase().indexOf("msie") != -1 ){ return true; } l = document.layers['popup'];