[Bio] / FigKernelPackages / HTML.pm Repository:
ViewVC logotype

Diff of /FigKernelPackages/HTML.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.33, Fri Feb 25 22:51:37 2005 UTC revision 1.34, Sat Mar 12 20:30:38 2005 UTC
# Line 65  Line 65 
65  sub show_page {  sub show_page {
66      #warn "SHOWPAGE: cgi=", Dumper(@_);      #warn "SHOWPAGE: cgi=", Dumper(@_);
67      shift if UNIVERSAL::isa($_[0],__PACKAGE__);      shift if UNIVERSAL::isa($_[0],__PACKAGE__);
68      my($cgi,$html,$no_home) = @_;      my($cgi,$html,$no_home, $css) = @_;
69      my $i;      my $i;
70    
71    
72        # ARGUMENTS:
73        #     $cgi is the CGI method
74        #     $html is an array with all the html in it. It is just joined by "\n" (and not <br> or <p>
75        #     $no_home
76        #     $css is a reference to a hash. The key is the name of the CSS sheet and the value is the URL of that sheet. Note the usual rules about relative css urls
77        #               the sheet named "Default" is considered to be the default style sheet, and if this is not set it points at $FIG_Config::HTML/css/default.css
78        #               the sheet named "Sans Serif" is considered to the the first alternate, and if this is not set it points at $FIG_Config::HTML/css/sanserif.css
79    
80      #      #
81      # Find the HTML header      # Find the HTML header
82      #      #
# Line 199  Line 208 
208      #      #
209      #  <BODY> goes after last head line      #  <BODY> goes after last head line
210      #      #
211      #  RAE: Added the javascript for the buttons immediately after body.      #  RAE:
212        #  Added the javascript for the buttons immediately after body.
213      #  Note if no buttons are added we still (at the moment) add the script,      #  Note if no buttons are added we still (at the moment) add the script,
214      #  but it only adds a little text (495 characters) to the html and noone will notice!      #  but it only adds a little text (495 characters) to the html and noone will notice!
215    
# Line 229  Line 239 
239          splice( @$html, $body_line, 0, "</HEAD>\n" );          splice( @$html, $body_line, 0, "</HEAD>\n" );
240      }      }
241    
242        # RAE:
243        # Add css here
244        # Note that at the moment I define these two sheets here. I think this should be moved out, but I want to try it and see what happens
245        # css has the format
246        # <link rel='stylesheet' title='default' href='/css/default.css' type='text/css'>
247        if (!$css || !$css->{'Default'})
248        {
249           $css->{'Default'}="/FIG/Html/css/default.css";
250        }
251        if (!$css->{"Sans Serif"})
252        {
253           $css->{'Sans Serif'}="/FIG/Html/css/sanserif.css";
254        }
255        my $csstext = "<link rel='stylesheet' title='default' href='".$css->{'Default'}."' type='text/css'>\n";
256        $csstext   .= "<link rel='alternate stylesheet' title='Sans Serif' href='".$css->{'Sans Serif'}."' type='text/css'>\n";
257    
258        foreach my $k (keys %$css)
259        {
260           next if (lc($k) eq "default" || lc($k) eq "sans serif");
261           $csstext .= "<link rel='stylesheet' title='$k' href='".$css->{$k}."' type='text/css'>\n";
262        }
263        splice( @$html, $head_end_line, 1, "$csstext</HEAD>\n" );  # note here I am replacing the </head> line. Could be bad...? But it doesn't increment everything else.
264    
265      #      #
266      #  <BASE ...> goes before </HEAD>      #  <BASE ...> goes before </HEAD>
267      #      #
# Line 328  Line 361 
361          splice( @$html, $i, 0, @tags );          splice( @$html, $i, 0, @tags );
362      }      }
363    
364      print @$html;      print join "\n", @$html;
365  }  }
366    
367  sub make_table {  sub make_table {

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3