+Support for: $W->{"css_push"}
authorshort <>
Sun, 28 Aug 2005 05:09:22 +0000 (05:09 +0000)
committershort <>
Sun, 28 Aug 2005 05:09:22 +0000 (05:09 +0000)
$WebConfig{"web_hostname"} is now optional.
+&a_href_inhibit for using &a_href before $W initialization (without URIs).

13 files changed:
Contact.pm
Index.pm
WebConfig.pm
project/Lib.pm
project/Rel.pm
project/captive/CVS.pm
project/captive/Index.pm
project/captive/Press.pm
project/captive/Preview.pm
project/captive/TestimonialBrunoSantos.pm
project/captive/Thanks.pm
project/captive/doc/Macros.pm
resume/ResumeJanKratochvil.pm

index 0a5c947..73e982f 100644 (file)
@@ -35,9 +35,7 @@ sub handler
 my $W=My::Web->init(
                "title"=>"Contact",
                "section"=>"Contact",
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "/Contact.css") ]}" />
-HERE
+               "css_push"=>"./Contact.css",
                );
 My::Web->heading();
 
index 576b2de..e620822 100644 (file)
--- a/Index.pm
+++ b/Index.pm
@@ -37,7 +37,7 @@ my $W=My::Web->init(
 
 
 $W->{"r"}->status(HTTP_MOVED_TEMPORARILY);
-$W->{"r"}->headers_out()->{"Location"}="http://".$W->{"web_hostname"}."/project/";
+$W->{"r"}->headers_out()->{"Location"}=path_web "./project/","abs"=>1;
 
 
 exit 0;
index 81d3fa2..9e4b4ea 100644 (file)
@@ -53,7 +53,6 @@ our %WebConfig=(
                "pserver"=>':pserver:pserver:@cvs.jankratochvil.net',
                "pserver_path"=>"/cvs",
                "resume_url"=>$resume_url,
-               "web_hostname"=>sub { return "www.jankratochvil.net"; },        # $My::Web::W->{"r"}->hostname()
                "mailman_url"  =>sub { return "http://".$My::Web::W->{"web_hostname"}."/mailman/"; },
                "pipermail_url"=>sub { return "http://".$My::Web::W->{"web_hostname"}."/pipermail/"; },
                "heading"=>sub () {
index 67bc50a..86c900f 100644 (file)
@@ -42,14 +42,14 @@ sub LIST_FILENAME()
 
 sub print_project
 {
-my($class,$ListItem,%args)=@_;
+my($class,$ListItem)=@_;
 
-       print "<h1>".$W->{"title"}."</h1>\n";
-       do { print $_ if $_; } for ($args{"project_text_after_title"});
+       print "<h1>".$class->title($ListItem)."</h1>\n";
+       do { print $_ if $_; } for ($W->{"project_text_after_title"});
        print $ListItem->{"description"};
        print "<hr />\n";
-       print($args{"before_project_data"}||"");
-       return if $args{"no_project_data"};
+       print($W->{"before_project_data"}||"");
+       return if $W->{"no_project_data"};
        my @table=(
                {"key"=>"summary","text"=>"Summary"},
                {"key"=>"license","text"=>"License","format"=>sub ($) {
@@ -263,14 +263,12 @@ my($class,%args)=@_;
                        or cluck "Error finding project name of the package: ".$args{"__PACKAGE__"};
        my $ListItem=$class->name_to_hashref($args{"project_name"});
        my $W=$class->SUPER::init(
-                       "title"=>$class->title($ListItem),
+                       "title"=>My::Web->a_href_inhibit(sub { return $class->title($ListItem); }),
                        map(("rel_$_"=>'/project/Rel.pm?rel='.$_.'&project='.$args{"project_name"}),qw(prev next)),
                        "rel_up"=>'/project/',
 #                      "rel_start"=>"/",       # TODO:homepage
+                       "css_push"=>"/project/Lib.css",
                        %args,
-                       "head"=>($args{"head"}||"").<<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "/project/Lib.css") ]}" />
-HERE
                        "heading_novskip"=>1,
                        );
        $class->heading();
index 196326a..ae0d5f3 100755 (executable)
@@ -67,9 +67,7 @@ for (0..$#projects) {
        }
 
 $W->{"r"}->status(HTTP_MOVED_TEMPORARILY);
-$W->{"r"}->headers_out()->{"Location"}="http://".$W->{"web_hostname"}
-#              .":7680"        # DEBUG
-               ."/project/".(!$target ? "" : "$target/");
+$W->{"r"}->headers_out()->{"Location"}=path_web "./".($target && "$target/"),"abs"=>1;
 
 
 exit 0;
index 1b6f952..e3c40af 100755 (executable)
@@ -32,8 +32,7 @@ sub handler
 {
 my $W=project::Lib->init(
                "project_name"=>"captive",
-               "before_project_data"=>
-                               '<h2>'.a_href('./','Captive Main Page').'</h2>'."\n",
+               "before_project_data"=>sub { return '<h2>'.a_href('./','Captive Main Page').'</h2>'."\n"; },
                );
 
 
index 68e3114..b261d60 100755 (executable)
@@ -64,10 +64,8 @@ sub handler
 {
 my $W=project::Lib->init(
                "no_project_data"=>1,
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "./Index.css") ]}" />
-HERE
-               "project_text_after_title"=>""
+               "css_push"=>"./Index.css",
+               "project_text_after_title"=>sub { return ""
                                .'<table border="0" width="100%"><tr><td align="center">'
                                        .'<table border="0" class="navigate"><tr>'
                                                .'<td>&bull;&nbsp;'.a_href('#download','Download').'</td>'
@@ -78,7 +76,8 @@ HERE
                                                .'<td>&bull;&nbsp;'.a_href('#lists','Mailing Lists').'</td>'
                                                .'<td>&bull;&nbsp;'.a_href('#seealso','See Also').'</td>'
                                        .'</tr></table>'
-                               .'</td></tr></table>',
+                               .'</td></tr></table>';
+                               },
                );
 
 
index 134d65e..245c0ed 100755 (executable)
@@ -31,9 +31,7 @@ sub handler
 {
 My::Web->init(
                "title"=>'Captive NTFS Internet Press',
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "./Lib.css") ]}" />
-HERE
+               "css_push"=>"./Lib.css",
                "heading_novskip"=>1,
                "no_job"=>1,
                "force_charset"=>"utf-8",
index ad82a68..5b485a2 100755 (executable)
@@ -31,9 +31,7 @@ sub handler
 {
 My::Web->init(
                "title"=>'Captive NTFS Technology Preview',
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "./Preview.css") ]}" />
-HERE
+               "css_push"=>"./Preview.css",
                "heading_novskip"=>1,
                );
 My::Web->heading();
index 69f4dcc..c541be7 100755 (executable)
@@ -31,9 +31,7 @@ sub handler
 {
 My::Web->init(
                "title"=>'Captive NTFS - Hospital of Castelo Branco',
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "./Lib.css") ]}" />
-HERE
+               "css_push"=>"./Lib.css",
                "heading_novskip"=>1,
                "no_job"=>1,
                );
index 198d271..f5d14bc 100755 (executable)
@@ -31,9 +31,7 @@ sub handler
 {
 My::Web->init(
                "title"=>'Captive NTFS Thanks',
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "./Lib.css") ]}" />
-HERE
+               "css_push"=>"./Lib.css",
                "heading_novskip"=>1,
                "no_job"=>1,
                );
index 3538249..c247d6f 100755 (executable)
@@ -105,16 +105,12 @@ sub init ($%)
 {
 my($class,%args)=@_;
 
-       $args{"__PACKAGE__"}||=caller();
-       %args=(
-                       "rel_start"=>"..",
-                       "rel_up"=>".",
-                       %args);
        My::Web->init(
-                       "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "./Macros.css") ]}" />
-HERE
+                       "css_push"=>"./Macros.css",
                        "heading_novskip"=>1,
+                       "rel_start"=>"..",      # possibly overridable
+                       "rel_up"=>".",  # possibly overridable
+                       "__PACKAGE__"=>caller(),        # possibly overridable
                        %args,
                        );
 
index b2336d7..a59986d 100644 (file)
@@ -59,9 +59,7 @@ my $W=My::Web->init(
                "section"=>"Resume",
                "heading"=>undef(),
                "footer"=>undef(),
-               "head"=><<"HERE",
-<link rel="stylesheet" type="text/css" href="@{[ uri_escaped(path_web "/resume/ResumeJanKratochvil.css") ]}" />
-HERE
+               "css_push"=>"/resume/ResumeJanKratochvil.css",
                "args_check"=>{
                                "referees"=>'', # Do not bother with '^(?:(?i)referees)?$'
                                "print"=>'^(?:print)?$',