From 2cef9aaaf5f11580cc136731902d5947a4d48d48 Mon Sep 17 00:00:00 2001
From: short <>
Date: Mon, 12 Dec 2005 17:30:00 +0000
Subject: [PATCH] +&leftimg: Like: &rightimg Trailing package listing is now
only single line - for the primary package. &a_href: Support:
a_href('mailto:email@address'); - Automatic content generator. $W->{"head"}
-> $W->{"head_push"} - IIRC currently not used. &form_method: Fixed to
always supply also: method="$method" &img: Support also: dia, fig, sxd, sxi
&img: Incompatible change: Source must be supplied with the source extension.
&leftimg, &rightimg: @args_img can be supplied as 1==@args_img $text field.
- IIRC currently not used. +$W->{"js_push"} - Now supports "text/javascript"
backward compatibility.
---
Web.pm | 141 +++++++++++++++++++++++++++++++++++++++++++++++------------------
1 file changed, 103 insertions(+), 38 deletions(-)
diff --git a/Web.pm b/Web.pm
index 2b08495..3ef46cf 100644
--- a/Web.pm
+++ b/Web.pm
@@ -33,7 +33,7 @@ our @EXPORT=qw(
&uri_escaped
&a_href &a_href_cc
&vskip
- &img ¢erimg &rightimg
+ &img ¢erimg &rightimg &leftimg
$W
&input_hidden_persistents
&escapeHTML
@@ -180,7 +180,6 @@ my($class,%args)=@_;
do { $W->{$_}=1 if !defined $W->{$_}; } for "footer_delimit";
do { $W->{$_}=1 if !defined $W->{$_}; } for "footer_ids";
do { $W->{$_}=1 if !defined $W->{$_}; } for "indexme";
- do { $W->{$_}="" if !defined $W->{$_}; } for "head";
do { $W->{$_}="" if !defined $W->{$_}; } for "body_attr";
do { $W->{$_}="en-US" if !defined $W->{$_}; } for "language";
@@ -247,7 +246,7 @@ my($class,%args)=@_;
else
{ delete $W->{"have_ent"}; }
if (!defined $W->{"have_ent"} && $W->{"r"}->method() eq "GET") {
- $W->{"head"}.='{"web_hostname"}."/".($W->{"r"}->uri()=~m#^/*(.*)$#)[0]
."?".($_ || "detect_ent_glue=1").'&have_ent=detect')
.'" />'."\n";
@@ -283,7 +282,7 @@ my($class,%args)=@_;
# as it does not look as registered, at least according to: MIME::Types $VERSION 1.15
# "application/javascript" so far standardized till 2005-12-08 by:
# http://www.ietf.org/internet-drafts/draft-hoehrmann-script-types-03.txt
- $W->{"head"}.=''."\n";
+ $W->{"head_push"}=''."\n";
}
# Required by &_args_check below.
@@ -298,10 +297,11 @@ sub form_method($)
{
my($method)=@_;
- return q{enctype="application/x-www-form-urlencoded" accept-charset="us-ascii utf-8"} if $method eq "post";
- return q{accept-charset="us-ascii utf-8"} if $method eq "get";
+ my $r=q{method="}.$method.q{"};
+ return $r." ".q{enctype="application/x-www-form-urlencoded" accept-charset="us-ascii utf-8"} if $method eq "post";
+ return $r." ". q{accept-charset="us-ascii utf-8"} if $method eq "get";
cluck "Undefined method: $method";
- return ""
+ return $r;
}
sub merge_post_args($)
@@ -696,7 +696,10 @@ sub footer()
# Never update the package list while we examine it!
$packages_used_hash{$W->{"__PACKAGE__"}}{"_done"}=1;
- my $packages_used=$packages_used_array{$W->{"__PACKAGE__"}};
+ # Dump the whole packages stack or just the primary one?
+ #my $packages_used=$packages_used_array{$W->{"__PACKAGE__"}};
+ my $packages_used=[$W->{"__PACKAGE__"}];
+
if ($W->{"footer_ids"}) {
Wprint '
@@ -1361,19 +1419,26 @@ my($class)=@_;
HERE
}
if ($W->{"css_inherit"}) {
- # Do not:
- # as at least Lynx inhibits any further HTML output.
- # Do not: text/javascript
- # as it does not look as registered, at least according to: MIME::Types $VERSION 1.15
- # "application/javascript" so far standardized till 2005-12-08 by:
- # http://www.ietf.org/internet-drafts/draft-hoehrmann-script-types-03.txt
- Wprint <<"HERE";
-
-HERE
+ $W->{"js_push"}="/My/css_inherit.js";
}
}
+ for my $js (@{$W->{"js_push"}}) {
+ # Do not:
+ # as at least Lynx inhibits any further HTML output.
+ # Do not: text/javascript
+ # as it does not look as registered, at least according to: MIME::Types $VERSION 1.15
+ # "application/javascript" so far standardized till 2005-12-08 by:
+ # http://www.ietf.org/internet-drafts/draft-hoehrmann-script-types-03.txt
+ Wprint <<"HERE";
+
+
+HERE
+ }
Wprint ''."\n";
- Wprint $W->{"head"};
+ for my $head (@{$W->{"head_push"}}) {
+ $head=&{$head}() if "CODE" eq ref $head;
+ Wprint $head;
+ }
for my $type (qw(prev next index contents start up)) {
do { Wprint ''."\n" if $_; }
for ($W->{"rel_$type"});
--
1.8.3.1