X-Git-Url: https://git.jankratochvil.net/?p=MyWeb.git;a=blobdiff_plain;f=Web.pm;h=5c7348e75c5d6cbbf03038b7f017327fa3bdbc8d;hp=e41a314f3d09e47f2d524abca9ba690d5df97d32;hb=ac37b1cf8ea542dfbc3ace13db3010111b920090;hpb=633dc05b0519d86762bd084d872d34f9183237e0 diff --git a/Web.pm b/Web.pm index e41a314..5c7348e 100644 --- a/Web.pm +++ b/Web.pm @@ -95,6 +95,8 @@ sub init ($%) { my($class,%args)=@_; + print STDERR "$class->init ".$ENV{"REQUEST_URI"}."\n"; + my $packages_used_save=$W->{"packages_used"}; $W={ %WebConfig,%args }; # override %WebConfig settings $W->{"packages_used"}=$packages_used_save; @@ -156,7 +158,7 @@ my($class,%args)=@_; $W->{"browser"}=HTTP::BrowserDetect->new($W->{"user_agent"}); if (!defined $W->{"have_style"}) { - $W->{"have_style"}=(!$W->{"browser"}->netscape() || $W->{"browser"}->major>4 ? 1 : 0); + $W->{"have_style"}=(!$W->{"browser"}->netscape() || ($W->{"browser"}->major() && $W->{"browser"}->major()>4) ? 1 : 0); } $W->{"have_js"}=($W->{"args"}{"have_js"} ? 1 : 0); @@ -180,6 +182,17 @@ sub top_dir (;$) my($in)=@_; if (my $uri=$ENV{"REQUEST_URI"}) { + if ($W->{"args"}{"Wabs"}) { + if ($in=~m#^/#) { + $in=~s#^/*##; + } + else { + $in=$ENV{"REQUEST_URI"}."/".$in; + $in=~tr#/#/#s; + 1 while $in=~s#/(?:[^/]+)/\Q..\E/#/#g + } + return "http://".&{$W->{"web_hostname_sub"}}()."/".(defined $in ? $in : ""); + } $uri.="Index" if $uri=~m#/$#; if (defined $in) { my($inpath,$inquery)=split /[?]/,$in,2; @@ -371,7 +384,11 @@ sub a_href ($;$%) my($url,$contents,%args)=@_; do { $$_=1 if !defined $$_; } for (\$args{"size"}); - $contents=CGI::escapeHTML($url) if !defined $contents; + if (!defined $contents) { + $contents=$url; + $contents=File::Basename::basename($contents) if $args{"basename"}; + $contents=CGI::escapeHTML($contents); + } $contents=~s#]*>##gi; $contents=~s###gi; @@ -613,6 +630,8 @@ my($class)=@_; .nowrap { white-space: nowrap; } .centered { text-align: center; } .tab-bold { font-weight: bold; } +.tab-head { font-weight: bold; } +/* .tab-head { font-weight: bold; color: yellow; background-color: transparent; } body { background-color: black; @@ -621,6 +640,7 @@ body { :link { color: aqua; background-color: transparent; } :visited { color: teal; background-color: transparent; } h1,h2 { color: yellow; background-color: transparent; } +*/ td { padding: 2px; } caption { caption-side: bottom; } .footer img { vertical-align: middle; } @@ -635,8 +655,8 @@ HERE do { print ''."\n" if $_; } for ($W->{"rel_$type"}); } print "{"browser"}->netscape() && $W->{"browser"}->major<=4; +# print ' bgcolor="black" text="white" link="aqua" vlink="teal"' +# if $W->{"browser"}->netscape() && (!$W->{"browser"}->major() || $W->{"browser"}->major()<=4); print ">\n"; if ($W->{"heading"}) {