[Orca-checkins] rev 219 - in trunk/orca: orca lib/Orca

blair at orcaware.com blair at orcaware.com
Wed Mar 19 18:47:36 PST 2003


Author: blair
Date: 2003-03-19 18:47:24 -0800 (Wed, 19 Mar 2003)
New Revision: 219

Modified:
   trunk/orca/lib/Orca/HTMLFile.pm
   trunk/orca/orca/orca.pl.in
Log:
Long <hr>'s that go all the way across the page to the right edge of
the browser's window don't look good.  Use Orca::HTMLFile's <hr>
anywhere an <hr> is needed, whose width is designed to match the Orca
banner at the bottom of the HTML page.

* lib/Orca/HTMLFile.pm:
  Make the module a subclass of the Exporter class so it can export
  $html_hr, which is set to the <hr> string the module currently uses.

* orca/orca.pl.in:
  (main):
    Use $html_hr from Orca::HTMLFile.
  (create_html_files):
    Any place a <hr> was used, use $html_hr.
    One HTML plot had a missing <hr> at the bottom of the page so that
      when html_page_footer was appended, this appended HTML markup
      started at the left side of the page.


Modified: trunk/orca/orca/orca.pl.in
==============================================================================
--- trunk/orca/orca/orca.pl.in	(original)
+++ trunk/orca/orca/orca.pl.in	2003-03-19 18:47:32.000000000 -0800
@@ -61,7 +61,7 @@
 use Orca::Utils         qw(name_to_fsname perl_glob unique);
 use Orca::SourceFile;
 use Orca::SourceFileIDs qw(@sfile_fids);
-use Orca::HTMLFile;
+use Orca::HTMLFile      qw($html_hr);
 
 # Note the starting time of the script.
 my $start_time = time;
@@ -711,7 +711,7 @@
       my @images = sort {$a->plot_ref->{index} <=> $b->plot_ref->{index}}
                    grep {$subgroup_name eq $_->subgroup_name} @{$image_files_ref->{list}};
       if (@images > 1) {
-        my $href_html = "<hr>";
+        my $href_html = "$html_hr\n";
         for (my $i=0; $i<@images; ++$i) {
           $href_html .= "<a href=\"#$i\">[" .
                         replace_subgroup_name($images[$i]->plot_ref->{title},
@@ -733,7 +733,7 @@
         my $image_size = $image->image_src_size;
 
         foreach my $html_file (@html_files) {
-          $html_file->{fd}->print("<hr>\n<h2><a ${href} name=\"$i\">$html_file->{Plot_Type} " .
+          $html_file->{fd}->print("$html_hr\n<h2><a ${href} name=\"$i\">$html_file->{Plot_Type} " .
                                   "$title</a></h2>\n");
         }
 
@@ -754,7 +754,7 @@
       }
 
       foreach my $html_file (@html_files) {
-        $html_file->{fd}->print("<hr>\n");
+        $html_file->{fd}->print("$html_hr\n");
       }
     }
 
@@ -769,8 +769,7 @@
     $index_html->print("</table>\n\n");
   }
 
-  $index_html->print("<br>\n<hr>\n" .
-                     "<h2>Available Data Sets</h2>\n\n");
+  $index_html->print("<br>\n$html_hr\n<h2>Available Data Sets</h2>\n\n");
 
   # Here the different available plots are listed and the HTML files
   # created that contain the HREFs to the proper images.  The HTML files
@@ -854,7 +853,7 @@
           my $fd = Orca::HTMLFile->new($filename,
                                        "${Plot_Type}${html_title_name} $legend_no_subgroup",
                                        $config_global{html_page_header},
-                                       "<hr>\n$config_global{html_page_footer}");
+                                       "$html_hr\n$config_global{html_page_footer}");
           unless ($fd) {
             warn "$0: warning: cannot create Orca::HTMLFile object: $@.\n";
             next;
@@ -881,7 +880,7 @@
         # page easier.  Do this if there are two or more subgroups in
         # this HTML page.
         if (@{$same_legends_image_list{$legend_no_subgroup}} > 1) {
-          $href_html .= "<hr>\n";
+          $href_html .= "$html_hr\n";
           foreach my $legend_image (@{$same_legends_image_list{$legend_no_subgroup}}) {
             my $subgroup = $legend_image->subgroup_name;
             $href_html  .= "<a href=\"#$subgroup\">[$subgroup]</a><spacer size=10>\n";
@@ -938,11 +937,12 @@
       my $image_size          = $image->image_src_size;
       foreach my $plot_type (@IMAGE_PLOT_TYPES) {
         my $Plot_Type    = capatialize($plot_type);
-        $summarize_html->print("<hr>\n<h2>$Plot_Type $legend_with_subgroup</h2>\n",
+        $summarize_html->print("$html_hr\n<h2>$Plot_Type $legend_with_subgroup</h2>\n",
                                "<img src=\"$image_filename-$plot_type.$IMAGE_SUFFIX\"",
                                $image_size,
                                "alt=\"$Plot_Type $legend_with_subgroup\">\n");
       }
+      $summarize_html->print("$html_hr\n");
 
       # Now add the images into each HTML file.
       my $name          = $image->name;
@@ -951,7 +951,7 @@
 
       my @legend_html_files = @{$legend_html_files{$legend_no_subgroup}};
       if ($make_html_all_page) {
-        $legend_html_files[-1]{fd}->print("<hr>\n<h2><a ${href} name=\"$subgroup_name\">$subgroup_name $legend_no_subgroup</a></h2>\n");
+        $legend_html_files[-1]{fd}->print("$html_hr\n<h2><a ${href} name=\"$subgroup_name\">$subgroup_name $legend_no_subgroup</a></h2>\n");
       }
       for (my $i=0; $i<@legend_html_files-$make_html_all_page; ++$i) {
         my $Plot_Type      = $legend_html_files[$i]{Plot_Type};
@@ -959,7 +959,7 @@
         $image_filename   .= "$name-$legend_html_files[$i]{plot_type}.$IMAGE_SUFFIX";
         my $html = "<a $href><img src=\"$image_filename\" $image_size " .
                    "alt=\"$Plot_Type $subgroup_name $legend_no_subgroup\"></a><br /><br />\n";
-        $legend_html_files[$i]{fd}->print("<hr>\n<h2><a ${href} name=\"$subgroup_name\">$Plot_Type $subgroup_name $legend_no_subgroup</a></h2>\n");
+        $legend_html_files[$i]{fd}->print("$html_hr\n<h2><a ${href} name=\"$subgroup_name\">$Plot_Type $subgroup_name $legend_no_subgroup</a></h2>\n");
         $legend_html_files[$i]{fd}->print($html);
         if ($make_html_all_page) {
           $legend_html_files[-1]{fd}->print($html);
@@ -971,7 +971,7 @@
   if (@table_columns) {
     $index_html->print("<tr>" . join('', @table_columns) . "</tr>\n");
   }
-  $index_html->print("\n</table>\n<hr>\n");
+  $index_html->print("\n</table>\n$html_hr\n");
 }
 
 # Replace any %g with the subgroup and any %G's with a capitalized

Modified: trunk/orca/lib/Orca/HTMLFile.pm
==============================================================================
--- trunk/orca/lib/Orca/HTMLFile.pm	(original)
+++ trunk/orca/lib/Orca/HTMLFile.pm	2003-03-19 18:47:32.000000000 -0800
@@ -8,10 +8,15 @@
 use strict;
 use Carp;
 use Orca::Constants qw($ORCA_VERSION);
-use vars            qw($VERSION);
-
+use vars            qw(@EXPORT_OK @ISA $VERSION);
+ at ISA     = qw(Exporter);
 $VERSION = substr q$Revision: 0.02 $, 10;
 
+# $html_hr is the HTML <hr/> tag with the correct width attribute.
+use vars         qw($html_hr);
+push(@EXPORT_OK, qw($html_hr));
+$html_hr = '<hr align="left" width="692" />';
+
 # Use a blessed reference to an array as the storage for this class.
 # Define these constant subroutines as indexes into the array.  If
 # the order of these indexes change, make sure to rearrange the
@@ -70,7 +75,7 @@
     $self->[$i_bottom]
 
     <br />
-    <hr align="left" width="692">
+    $html_hr
     <table cellpadding="0" border="0">
       <tr valign="bottom">
         <td width="186">



More information about the Orca-checkins mailing list