diff options
author | link <link@localhost> | 2002-12-02 01:53:16 +0000 |
---|---|---|
committer | link <link@localhost> | 2002-12-02 01:53:16 +0000 |
commit | 03606acc310549945ebbbff944af9fc5d4eca40b (patch) | |
tree | 5d657d43df1207345203d260811984f2a7fe8d63 | |
parent | 8ed16293ea7fac85f0936d19e6d845fb2654b7fc (diff) | |
download | markup-validator-03606acc310549945ebbbff944af9fc5d4eca40b.zip markup-validator-03606acc310549945ebbbff944af9fc5d4eca40b.tar.gz markup-validator-03606acc310549945ebbbff944af9fc5d4eca40b.tar.bz2 |
Landing HTML::Template-ized code. Apart from a few gremlins, basic
functionality is there. There is still a *lot* left to do before this is
back to stable though!
-rwxr-xr-x | httpd/cgi-bin/check | 568 | ||||
-rw-r--r-- | share/templates/en_US/footer.tmpl | 9 | ||||
-rw-r--r-- | share/templates/en_US/header.tmpl | 88 | ||||
-rw-r--r-- | share/templates/en_US/invalid.tmpl | 27 | ||||
-rw-r--r-- | share/templates/en_US/jumpbar.tmpl | 13 | ||||
-rw-r--r-- | share/templates/en_US/opt_show_outline.tmpl | 14 | ||||
-rw-r--r-- | share/templates/en_US/opt_show_parsetree.tmpl | 14 | ||||
-rw-r--r-- | share/templates/en_US/opt_show_source.tmpl | 10 | ||||
-rw-r--r-- | share/templates/en_US/popup_charset.tmpl | 38 | ||||
-rw-r--r-- | share/templates/en_US/popup_doctype.tmpl | 13 | ||||
-rw-r--r-- | share/templates/en_US/result.tmpl | 34 | ||||
-rw-r--r-- | share/templates/en_US/table.tmpl | 62 | ||||
-rw-r--r-- | share/templates/en_US/tip.tmpl | 4 | ||||
-rw-r--r-- | share/templates/en_US/valid.tmpl | 63 |
14 files changed, 567 insertions, 390 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 1deee0b..3aa2ada 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -9,7 +9,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.308 2002-12-01 13:40:33 link Exp $ +# $Id: check,v 1.309 2002-12-02 01:53:14 link Exp $ # # Disable buffering on STDOUT! @@ -46,6 +46,7 @@ use CGI::Carp qw(carp croak); use Config::General 2.06 qw(); # Need 2.06 for -SplitPolicy use File::Spec qw(); use HTML::Parser 3.25 qw(); # Need 3.25 for $p->ignore_elements. +use HTML::Template 2.6 qw(); use HTTP::Request qw(); use IO::File qw(); use IPC::Open3 qw(open3); @@ -132,7 +133,7 @@ The error reported was: '$@' # # Strings - $VERSION = q$Revision: 1.308 $; + $VERSION = q$Revision: 1.309 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; } # end of BEGIN block. @@ -141,7 +142,6 @@ The error reported was: '$@' # Get rid of (possibly insecure) $PATH. delete $ENV{PATH}; - ############################################################################### #### Process CGI variables and initialize. #################################### ############################################################################### @@ -154,29 +154,6 @@ my $q = new CGI; # The data structure that will hold all session data. my $File; -# -# Pseudo-SSI include header and footer for output. -$File->{'Header'} = &prepSSI({ - File => $CFG->{Header}, - Title => 'Validation Results', - Revision => $VERSION, - }); -$File->{'Footer'} = &prepSSI({ - File => $CFG->{'Footer'}, - Date => q$Date: 2002-12-01 13:40:33 $, - }); - -# -# SSI Footer for static pages does not include closing tags for body & html. -$File->{'Footer'} .= qq( </body>\n</html>\n); - -# -# Prepare standard HTML preamble for output. -$File->{'Results'} = "Content-Language: en\n"; -$File->{'Results'} .= "Content-Type: text/html; charset=utf-8\n\n"; -$File->{'Results'} .= $File->{'Header'}; - - ############################################## # Populate $File->{Env} -- Session Metadata. # ############################################## @@ -262,6 +239,20 @@ untie *STDIN; ############################################################################### +#### Generate Template for Result. ############################################ +############################################################################### + +my $T = HTML::Template->new( + filename => '/usr/local/validator/share/templates/result.tmpl', + die_on_bad_params => FALSE, + ); + +$T->param(cfg_home_page => $CFG->{Home_Page}); +$T->param(is_upload => $File->{'Is Upload'}); + + + +############################################################################### #### Output validation results. ############################################### ############################################################################### @@ -475,7 +466,7 @@ my @xmlflags = qw( # # Switch to XML semantics if file is XML. -if (&is_xml($File->{Type})) { +if (&is_xml($File)) { $catalog = File::Spec->catfile($CFG->{SGML_Library}, 'xml.soc'); push(@xmlflags, '-wxml'); &add_warning($File, <<".EOF."); @@ -607,7 +598,7 @@ for (@{$File->{ESIS}}) { # # Force "XML" if type is an XML type and an FPI was not found. # Otherwise set the type to be the FPI. -if (&is_xml($File->{Type}) and not $File->{DOCTYPE}) { +if (&is_xml($File) and not $File->{DOCTYPE}) { $File->{Version} = 'XML'; } else { $File->{Version} = $File->{DOCTYPE} unless $File->{Version}; @@ -692,51 +683,34 @@ if ($File->{Opt}->{Output} eq 'xml') { } elsif ($File->{Opt}->{Output} eq 'n3') { &report_n3($File); } else { - print $File->{Results}; - print qq( <div class="meat">\n); + $T->param(is_xml => &is_xml($File)); - print &jump_links($File); + $T->param(opt_show_source => $File->{Opt}->{'Show Source'}); + $T->param(opt_show_outline => $File->{Opt}->{'Outline'}); + $T->param(opt_show_parsetree => $File->{Opt}->{'Show Parsetree'}); + $T->param(opt_show_noatt => $File->{Opt}->{'No Attributes'}); - if ($File->{Opt}->{Verbose} or not $File->{'Is Valid'}) { - print qq(<div class="splash">\n); - &print_table($File); - &print_warnings($File); - print qq(</div>\n); - } else { - if ($File->{'Is Valid'} and not $File->{'Is Upload'}) { - my $thispage = $File->{Env}->{'Self URI'}; - my $escaped_uri = uri_escape($File->{URI}); - $thispage .= qq(?uri=$escaped_uri); - $thispage .= ';ss=1' if $File->{Opt}->{'Show Source'}; - $thispage .= ';sp=1' if $File->{Opt}->{'Show Parsetree'}; - $thispage .= ';noatt=1' if $File->{Opt}->{'No Attributes'}; - $thispage .= ';outline=1' if $File->{Opt}->{'Outline'}; - - &add_warning($File, <<".EOF."); -<em>Note</em>: You can also view <a href="$thispage;verbose=1">verbose -results</a> by setting the corresponding option on the <a - href="detailed.html">Extended Interface</a>. -.EOF. - } - } + my $tip = &get_tip; + $T->param(tip_uri => $tip->[0]); + $T->param(tip_slug => $tip->[1]); - if ($File->{'Is Valid'}) { - &report_valid($File); + if ($File->{'Is Valid'} and not $DEBUG) { + $T->param(VALID => TRUE); + &report_valid($File, $T); } else { + $T->param(VALID => FALSE); $File->{Opt}->{'Show Source'} = TRUE; - &report_errors($File); - } - - if (not $File->{'Is Valid'} or $File->{Opt}->{Verbose}) { - &outline($File) if $File->{Opt}->{'Outline'}; - &show_source($File) if $File->{Opt}->{'Show Source'}; - &parse_tree($File) if $File->{Opt}->{'Show Parsetree'}; - &show_esis($File) if $File->{Opt}->{'Show ESIS'}; - &show_errors($File) if $File->{Opt}->{'Show Errors'}; + # &print_table($File); + # &print_warnings($File); + $T->param(file_errors => &report_errors($File)); + $T->param(file_outline => &outline($File)); + $T->param(file_source => &source($File)); + $T->param(file_parsetree => &parsetree($File)); + # &show_esis($File) if $File->{Opt}->{'Show ESIS'}; + # &show_errors($File) if $File->{Opt}->{'Show Errors'}; } - print qq(</div> <!-- End of "meat". -->\n); # End of "Meat". - print $File->{'Footer'}; + print $T->output; } # @@ -748,6 +722,103 @@ exit; ############################################################################# # Subroutine definitions ############################################################################# +# +# Output "This page is Valid" report. +sub report_valid { + my $File = shift; + my $T = shift; + + $T->param(file_uri => &ent($File->{URI})); + + my $gifborder = ' border="0"'; + my $xhtmlendtag = ''; + my($image_uri, $alttext, $gifhw); + + unless ($File->{Version} eq 'unknown' or defined $File->{Tentative}) { + if ($File->{Version} =~ /^HTML 2\.0$/) { + $image_uri = "$CFG->{Home_Page}images/vh20"; + $alttext = "Valid HTML 2.0!"; + $gifborder = ""; + } elsif ($File->{Version} =~ /HTML 3\.2</) { + $image_uri = "http://www.w3.org/Icons/valid-html32"; + $alttext = "Valid HTML 3.2!"; + $gifhw = ' height="31" width="88"'; + } elsif ($File->{Version} =~ /HTML 4\.0<\/a> Strict$/) { + $image_uri = "http://www.w3.org/Icons/valid-html40"; + $alttext = "Valid HTML 4.0!"; + $gifborder = ""; + $gifhw = ' height="31" width="88"'; + } elsif ($File->{Version} =~ /HTML 4\.0<\/a> /) { + $image_uri = "http://www.w3.org/Icons/valid-html40"; + $alttext = "Valid HTML 4.0!"; + $gifhw = ' height="31" width="88"'; + } elsif ($File->{Version} =~ /HTML 4\.01<\/a> Strict$/) { + $image_uri = "http://www.w3.org/Icons/valid-html401"; + $alttext = "Valid HTML 4.01!"; + $gifborder = ""; + $gifhw = ' height="31" width="88"'; + } elsif ($File->{Version} =~ /HTML 4\.01<\/a> /) { + $image_uri = "http://www.w3.org/Icons/valid-html401"; + $alttext = "Valid HTML 4.01!"; + $gifhw = ' height="31" width="88"'; + } elsif ($File->{Version} =~ /XHTML 1\.0<\/a> /) { + $image_uri = "http://www.w3.org/Icons/valid-xhtml10"; + $alttext = "Valid XHTML 1.0!"; + $gifborder = ""; + $gifhw = ' height="31" width="88"'; + $xhtmlendtag = " /"; + } elsif ($File->{Version} =~ /XHTML Basic 1.0/) { + $image_uri = "$CFG->{Home_Page}/images/vxhtml-basic10"; + $alttext = "Valid XHTML Basic 1.0!"; + $gifborder = ""; + $gifhw = ' height="31" width="88"'; + $xhtmlendtag = " /"; + } elsif ($File->{Version} =~ /XHTML 1.1/) { + $image_uri = "http://www.w3.org/Icons/valid-xhtml11"; + $alttext = "Valid XHTML 1.1!"; + $gifborder = ""; + $gifhw = ' height="31" width="88"'; + $xhtmlendtag = " /"; + } elsif ($File->{Version} =~ /HTML 3\.0/) { + $image_uri = "$CFG->{Home_Page}images/vh30"; + $alttext = "Valid HTML 3.0!"; + } elsif ($File->{Version} =~ /Netscape/) { + $image_uri = "$CFG->{Home_Page}images/vhns"; + $alttext = "Valid Netscape-HTML!"; + } elsif ($File->{Version} =~ /Hotjava/) { + $image_uri = "$CFG->{Home_Page}images/vhhj"; + $alttext = "Valid Hotjava-HTML!"; + } elsif ($File->{Version} =~ /ISO\/IEC 15445:2000/) { + $image_uri = "$CFG->{Home_Page}images/v15445"; + $alttext = "Valid ISO-HTML!"; + } + + $T->param(file_version => $File->{Version}); + + # @@@ + # print &daily_tip($File, $CFG->{Tips_DB}); + # &print_warnings($File); + + if (defined $image_uri) { + $T->param(have_badge => TRUE); + $T->param(badge_uri => $image_uri); + $T->param(badge_alt => $alttext); + $T->param(badge_gifhw => $gifhw); + $T->param(badge_xhtml => $xhtmlendtag); + } + } elsif (defined $File->{Tentative}) { + $T->param(is_tentative => TRUE); + } + + my $thispage = $File->{Env}->{'Self URI'}; + my $escaped_uri = uri_escape($File->{URI}); + $thispage .= qq(?uri=$escaped_uri); + $thispage .= ';ss=1' if $File->{Opt}->{'Show Source'}; + $thispage .= ';sp=1' if $File->{Opt}->{'Show Parsetree'}; + $thispage .= ';noatt=1' if $File->{Opt}->{'No Attributes'}; + $thispage .= ';outline=1' if $File->{Opt}->{'Outline'}; + $T->param(file_thispage => $thispage); +} # # Add a row to the metadata-table datastructure. @@ -975,26 +1046,6 @@ EOF # -# Generate HTML for the "Jump to:" links in results. -sub jump_links { - my $links = ''; - $links .= <<".EOF."; - <p id="skip" class="jumpbar"> - Jump To: [<a title="Result of Validation" href="#result">Results</a>] -.EOF. - - $links .= ' [<a title="Listing of Source Input" href="#source">Source Listing</a>]' - if $File->{Opt}->{'Show Source'}; - $links .= ' [<a title="Document Parse Tree" href="#parse">Parse Tree</a>]' - if $File->{Opt}->{'Show Parsetree'}; - $links .= ' [<a title="Document Outline" href="#outline">Outline</a>]' - if $File->{Opt}->{'Outline'}; - $links .= " </p>\n"; - return $links; -} - - -# # Proxy authentication requests. sub authenticate { my $File = shift; @@ -1089,39 +1140,6 @@ sub http_error { EOF } - -# -# Print blurb advocating using the CSS Validator. -sub output_css_validator_blurb { - my $uri = ent(uri_escape(shift)); - - print <<"EOHD"; - <p> - If you use <a href="http://www.w3.org/Style/CSS/">CSS</a> in your document, - you should also <a - href="http://jigsaw.w3.org/css-validator/validator?uri=$uri">check it for - validity</a> using the W3C <a - href="http://jigsaw.w3.org/css-validator/">CSS Validation Service</a>. - </p> -EOHD -} - - -sub daily_tip { - my @tipAddrs = keys %{$CFG->{Tips_DB}}; - srand(time()); - my $tipAddr = $tipAddrs[rand scalar @tipAddrs]; - my $tipSlug = $CFG->{Tips_DB}->{$tipAddr}; - - return <<"EOHD"; - <dl class="tip"> - <dt><a href="http://www.w3.org/2001/06tips/">Tip Of The Day</a>:</dt> - <dd><a href="$tipAddr">$tipSlug</a></dd> - </dl> -EOHD -} - - # # Fetch an URI and return the content and selected meta-info. sub handle_uri { @@ -1417,7 +1435,6 @@ sub parse_errors ($$) { my $fh = shift; $File->{Errors} = []; # Initialize to an (empty) anonymous array ref. -warn('@@@-> ' . $CFG->{SGML_Parser}); for (<$fh>) { push @{$File->{'DEBUG'}->{Errors}}, $_; my($err, @errors); @@ -1522,31 +1539,9 @@ warn('@@@-> ' . $CFG->{SGML_Parser}); sub report_errors ($) { my $File = shift; - print <<"EOHD"; - <h2 id="result" class="invalid">This page is <strong>not</strong> Valid $File->{Version}!</h2> -EOHD - - if ($File->{Type} eq 'xml' or $File->{Type} eq 'xhtml' or $File->{Type} eq 'mathml' or $File->{Type} eq 'svg' or $File->{Type} eq 'smil') { - my $xmlvalid = ($File->{DOCTYPE} ? ' and validity' : ''); - print <<"EOHD"; - <p> - Below are the results of checking this document for <a - href="http://www.w3.org/TR/REC-xml#sec-conformance">XML - well-formedness</a>$xmlvalid. - </p> -EOHD - } else { - print <<"EOHD"; - <p> - Below are the results of attempting to parse this document with - an SGML parser. - </p> -EOHD - } + my $Errors = []; if (scalar @{$File->{Errors}}) { - print qq( <ol>\n); - foreach my $err (@{$File->{Errors}}) { my($line, $col) = &truncate_line($File->{Content}->[$err->{line}-1], $err->{char}); @@ -1565,193 +1560,18 @@ EOHD $line = &ent($line); # Entity encode. $line =~ s/\t/ /g; # Collapse TABs. - print qq( <li><em>Line <a href="#line-$err->{line}">$err->{line}</a>, column $err->{char}</em>: ); - print qq{<span class="msg">$err->{msg}</span>}; if (defined $CFG->{Error_to_URI}->{$err->{idx}}) { - print qq{ (<a href="$CFG->{Msg_FAQ_URI}#$CFG->{Error_to_URI}->{$err->{idx}}">explain...</a>).}; - } elsif ($DEBUG) { - print qq{ (<code style="background: red">"$err->{idx}"</code>)}; + $err->{uri} = $CFG->{Msg_FAQ_URI} . '#' + . $CFG->{Error_to_URI}->{$err->{idx}}; } - print qq(\n<pre> <code class="input">$line</code>\n); - print ' ' x ($col + 2); # 2 is the number of spaces before <code> above - print qq(<span class="markup">^</span></pre></li>\n); - } - print qq( </ol>\n); - } -} - - -# -# Output "This page is Valid" report. -sub report_valid { - my $File = shift; - my $gifborder = ' border="0"'; - my $xhtmlendtag = ''; - my($image_uri, $alttext, $gifhw); - my $URI = &ent($File->{URI}); - - unless ($File->{Version} eq 'unknown' or defined $File->{Tentative}) { - if ($File->{Version} =~ /^HTML 2\.0$/) { - $image_uri = "$CFG->{Home_Page}images/vh20"; - $alttext = "Valid HTML 2.0!"; - $gifborder = ""; - } elsif ($File->{Version} =~ /HTML 3\.2</) { - $image_uri = "http://www.w3.org/Icons/valid-html32"; - $alttext = "Valid HTML 3.2!"; - $gifhw = ' height="31" width="88"'; - } elsif ($File->{Version} =~ /HTML 4\.0<\/a> Strict$/) { - $image_uri = "http://www.w3.org/Icons/valid-html40"; - $alttext = "Valid HTML 4.0!"; - $gifborder = ""; - $gifhw = ' height="31" width="88"'; - } elsif ($File->{Version} =~ /HTML 4\.0<\/a> /) { - $image_uri = "http://www.w3.org/Icons/valid-html40"; - $alttext = "Valid HTML 4.0!"; - $gifhw = ' height="31" width="88"'; - } elsif ($File->{Version} =~ /HTML 4\.01<\/a> Strict$/) { - $image_uri = "http://www.w3.org/Icons/valid-html401"; - $alttext = "Valid HTML 4.01!"; - $gifborder = ""; - $gifhw = ' height="31" width="88"'; - } elsif ($File->{Version} =~ /HTML 4\.01<\/a> /) { - $image_uri = "http://www.w3.org/Icons/valid-html401"; - $alttext = "Valid HTML 4.01!"; - $gifhw = ' height="31" width="88"'; - } elsif ($File->{Version} =~ /XHTML 1\.0<\/a> /) { - $image_uri = "http://www.w3.org/Icons/valid-xhtml10"; - $alttext = "Valid XHTML 1.0!"; - $gifborder = ""; - $gifhw = ' height="31" width="88"'; - $xhtmlendtag = " /"; - } elsif ($File->{Version} =~ /XHTML Basic 1.0/) { - $image_uri = "$CFG->{Home_Page}/images/vxhtml-basic10"; - $alttext = "Valid XHTML Basic 1.0!"; - $gifborder = ""; - $gifhw = ' height="31" width="88"'; - $xhtmlendtag = " /"; - } elsif ($File->{Version} =~ /XHTML 1.1/) { - $image_uri = "http://www.w3.org/Icons/valid-xhtml11"; - $alttext = "Valid XHTML 1.1!"; - $gifborder = ""; - $gifhw = ' height="31" width="88"'; - $xhtmlendtag = " /"; - } elsif ($File->{Version} =~ /HTML 3\.0/) { - $image_uri = "$CFG->{Home_Page}images/vh30"; - $alttext = "Valid HTML 3.0!"; - } elsif ($File->{Version} =~ /Netscape/) { - $image_uri = "$CFG->{Home_Page}images/vhns"; - $alttext = "Valid Netscape-HTML!"; - } elsif ($File->{Version} =~ /Hotjava/) { - $image_uri = "$CFG->{Home_Page}images/vhhj"; - $alttext = "Valid Hotjava-HTML!"; - } elsif ($File->{Version} =~ /ISO\/IEC 15445:2000/) { - $image_uri = "$CFG->{Home_Page}images/v15445"; - $alttext = "Valid ISO-HTML!"; - } - - if ($File->{Version}) { - print qq(<h2 id="result" class="valid">This Page Is Valid $File->{Version}!</h2>\n); - } else { - print qq(<h2 id="result" class="valid">This Page Is Valid!</h2>\n); - } - - print &daily_tip($File, $CFG->{'Tips DB'}); - &print_warnings($File) unless $File->{Opt}->{Verbose}; + $err->{src} = $line; + $err->{col} = ' ' x $col; - my $source; - if ($File->{'Is Upload'}) { - $source = qq(The uploaded file); - } else { - $source = qq(The document located at <<a href="$URI">$URI</a>>); + push @{$Errors}, $err; } - - print <<".EOF."; - <p> - $source - was checked and found to be valid $File->{Version}. This means that - the resource in question identified itself as - “$File->{Version}” and that we successfully performed a - formal validation using an SGML or XML Parser (depending on the - markup language used). - </p> -.EOF. - if (defined $image_uri) { - print <<".EOF."; - <p> - <img class="inline-badge" src="$image_uri" alt="$alttext"$gifhw /> - To show your readers that you have taken the care to create an - interoperable Web page, you may display this icon on any page - that validates. Here is the HTML you could use to add this icon - to your Web page: - </p> - <pre> - <p> - <a href="$CFG->{Home_Page}check/referer"><img$gifborder - src="$image_uri" - alt="$alttext"$gifhw$xhtmlendtag></a> - </p> - </pre> - <p> - If you like, you can download a copy of this image (in <a - href="${image_uri}.png">PNG</a> or <a href="${image_uri}.gif">GIF</a> - format) to keep in your local web directory, and change the HTML fragment - above to reference your local image rather than the one on this server. - </p> -.EOF. - } - } elsif (&is_xml($File->{Type}) and not $File->{DOCTYPE}) { - print qq( <h2 class="valid">This document is well-formed XML.</h2>\n); - } elsif (defined $File->{Tentative}) { - print qq(<h2 class="valid">This Page <em>Tentatively</em> Validates As $File->{Version} (Tentatively Valid)!</h2>); - print &daily_tip($File, $CFG->{Tips_DB}); - &print_warnings($File); - print <<".EOF."; - <p> - The document located at - <<a href="$URI">$URI</a>> - was tentatively found to be Valid. That means it would validate - as $File->{Version} if you updated the source document to match - the options used (typically this message indicates that you used - either the Document Type override or the Character Encoding - override). - </p> -.EOF. - } else { - print qq( <h2 class="valid">This document validates as the document type specified!</h2>\n); - print <<".EOF."; - <p> - The document located at - <<a href="$URI">$URI</a>> was checked and found - to be valid $File->{Version}. This means that the resource in question - identified itself as “$File->{Version}” and that we - successfully performed a formal validation using an SGML or XML Parser - (depending on the markup language used). - </p> -.EOF. - } - - unless ($File->{'Is Upload'}) { - my $thispage = $File->{Env}->{'Self URI'}; - my $escaped_uri = uri_escape($File->{URI}); - $thispage .= qq(?uri=$escaped_uri); - $thispage .= ';ss=1' if $File->{Opt}->{'Show Source'}; - $thispage .= ';sp=1' if $File->{Opt}->{'Show Parsetree'}; - $thispage .= ';noatt=1' if $File->{Opt}->{'No Attributes'}; - $thispage .= ';outline=1' if $File->{Opt}->{'Outline'}; - $thispage .= ';verbose=1' if $File->{Opt}->{'Verbose'}; - - &output_css_validator_blurb($File->{URI}); - - print <<"EOHD"; - <p> - If you would like to create a link to <em>this</em> page (i.e., this - validation result) to make it easier to re-validate this page in the - future or to allow others to validate your page, the URI is - <<a href="$thispage">$thispage</a>> (or you can just add the - current page to your bookmarks or hotlist).</p> -EOHD } + return $Errors; } @@ -1760,14 +1580,7 @@ EOHD sub outline { my $File = shift; - print <<'EOF'; - <div id="outline" class="mtb"> - <h2>Outline</h2> - <p> - Below is an outline for this document, automatically generated from the - heading tags (<code><h1></code> through <code><h6></code>.) - </p> -EOF + my $outline = ''; my $prevlevel = 0; my $indent = 0; @@ -1779,12 +1592,12 @@ EOF $prevlevel = $level; $level = $1; - print " </ul>\n" x ($prevlevel - $level); # perl is so cool. - if ($level - $prevlevel == 1) {print " <ul>\n"}; + $outline .= " </ul>\n" x ($prevlevel - $level); # perl is so cool. + if ($level - $prevlevel == 1) {$outline .= " <ul>\n"}; foreach my $i (($prevlevel + 1) .. ($level - 1)) { - print qq( <ul>\n <li class="warning">A level $i heading is missing!</li>\n); + $outline .= qq( <ul>\n <li class="warning">A level $i heading is missing!</li>\n); } - if ($level - $prevlevel > 1) {print " <ul>\n"}; + if ($level - $prevlevel > 1) {$outline .= " <ul>\n"}; $line = ''; my $heading = ''; @@ -1806,78 +1619,43 @@ EOF $heading = substr($heading, 1); # chop the leading '-' or ' '. $heading = &ent($heading); - print " <li>$heading</li>\n"; + $outline .= " <li>$heading</li>\n"; } - print " </ul>\n" x $level; - print <<'EOF'; - <p> - If this does not look like a real outline, it is likely that the - heading tags are not being used properly. (Headings should reflect - the logical structure of the document; they should not be used simply - to add emphasis, or to change the font size.) - </p> - </div> -EOF + $outline .= " </ul>\n" x $level; + + return $outline; } # # Create a HTML representation of the document. -sub show_source { +sub source { my $File = shift; my $line = 1; - - my $comment = ''; - - if ($File->{'Error Flagged'}) { - $comment = "<p>I have marked lines that I haven't been able to decode.</p>\n"; - } - - print <<"EOF"; - <div id="source" class="mtb"> - <h2>Source Listing</h2> - - <p>Below is the source input I used for this validation:</p> - $comment - <pre> -EOF + my @source = (); for (@{$File->{Content}}) { - printf "<a name=\"line-%s\">%4d</a>: %s\n", $line, $line, ent $_; + push @source, { + file_source_i => $line, + file_source_line => ent $_, + }; $line++; } - print " </pre>\n </div>"; + return \@source; } # # Create a HTML Parse Tree of the document for validation report. -sub parse_tree { +sub parsetree { my $File = shift; + my $tree = ''; - print <<'EOF'; - <div id="parse" class="mtb"> - <h2>Parse Tree</h2> -EOF - if ($File->{Opt}->{'No Attributes'}) { - print <<'EOF'; - <p class="note"> - I am excluding the attributes, as you requested. - </p> -EOF - } else { - print <<'EOF'; - <p class="note"> - You can also view this parse tree without attributes by selecting the - appropriate option on <a href="./#form">the form</a>. - </p> -EOF - } + $T->param(file_parsetree_noatt => TRUE) if $File->{Opt}->{'No Attributes'}; my $indent = 0; my $prevdata = ''; - print "<pre>\n"; foreach my $line (@{$File->{ESIS}}) { if ($File->{Opt}->{'No Attributes'}) { # don't show attributes next if $line =~ /^A/; @@ -1898,7 +1676,7 @@ EOF } elsif ($prevdata) { $prevdata = &ent($prevdata); $prevdata =~ s/\s+/ /go; - print wrap(' ' x $indent, ' ' x $indent, $prevdata), "\n"; + $tree .= wrap(' ' x $indent, ' ' x $indent, $prevdata) . "\n"; undef $prevdata; } @@ -1917,13 +1695,12 @@ EOF "\">$2<\/a>>" }egx; $printme =~ s,^A, A,; # indent attributes a bit - print ' ' x $indent, $printme, "\n"; + $tree .= ' ' x $indent . $printme . "\n"; if ($line =~ /^\(/) { $indent += 2; } } - print "</pre>\n"; - print "</div>\n"; + return $tree; } @@ -2142,7 +1919,7 @@ sub uri_rejected { # # Utility subs to tell if type "is" something. -sub is_xml {shift =~ m(^[^+]+\+xml$)}; +sub is_xml {shift->{Type} =~ m(^[^+]+\+xml$)}; sub is_svg {shift =~ m(svg\+xml$)}; sub is_smil {shift =~ m(smil\+xml$)}; sub is_html {shift =~ m(html\+sgml$)}; @@ -2832,3 +2609,14 @@ sub self_url { } return $thispage; } + + +# +# Return random Tip with it's URL. +sub get_tip { + my @tipAddrs = keys %{$CFG->{Tips_DB}}; + my $tipAddr = $tipAddrs[rand scalar @tipAddrs]; + my $tipSlug = $CFG->{Tips_DB}->{$tipAddr}; + + return [$tipAddr, $tipSlug]; +} diff --git a/share/templates/en_US/footer.tmpl b/share/templates/en_US/footer.tmpl new file mode 100644 index 0000000..72e6b95 --- /dev/null +++ b/share/templates/en_US/footer.tmpl @@ -0,0 +1,9 @@ + <address> + <a href="http://validator.w3.org/check/referer"><img + src="http://www.w3.org/Icons/valid-xhtml10" height="31" width="88" + alt="Valid XHTML 1.0!" /></a> + <a title="Send Feedback for the W3C MarkUp Validation Service" + href="./feedback.html">The W3C Validator Team</a><br /> + Date: 2002/11/26 22:22:16 + <!-- SSI Template Version: $Id: footer.tmpl,v 1.1 2002-12-02 01:53:16 link Exp $ --> + </address> diff --git a/share/templates/en_US/header.tmpl b/share/templates/en_US/header.tmpl new file mode 100644 index 0000000..f535e10 --- /dev/null +++ b/share/templates/en_US/header.tmpl @@ -0,0 +1,88 @@ +Content-Language: en +Content-Type: text/html; charset=utf-8 + +<?xml version="1.0"?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> + <head> + <title>Validation Results</title> + <link rev="made" href="mailto:www-validator@w3.org" /> + <link rev="start" href="./" title="Home Page" /> + <style type="text/css" media="all">@import "./base.css";</style> + <meta name="keywords" content="HTML, Hypertext Markup Language, Validation, + W3C MarkUp Validation Service" /> + + <meta name="description" content="W3C's easy-to-use + HTML validation service, based on an SGML parser." /> + <meta name="revision" content="1.307" /> + <!-- SSI Template Version: $Id: header.tmpl,v 1.1 2002-12-02 01:53:16 link Exp $ --> + </head> + + <body> + <h1 id="title"><a href="http://www.w3.org/"><img height="48" alt="W3C" + id="logo" src="http://www.w3.org/Icons/WWW/w3c_home" /></a> + MarkUp Validation Service</h1> + <dl class="navbar"> + + <dt>Site Navigation</dt> + <dd class="main"> + <ul> + <li class="hideme"><a href="#skip" accesskey="s" title="Skip past navigation to main part of page">Skip Navigation</a></li> + <li><a href="./" accesskey="h" title="Go to the Home Page for The W3C MarkUp Validation Service">Home Page</a></li> + <li><a href="./docs/" title="Documentation for this Service">Documentation</a></li> + + <li><a href="./source/" title="Information on Source Availability">Source Code</a></li> + <li><a href="./whatsnew.html" title="The changes made to this service recently">What's New</a></li> + <li><a href="./accesskeys.html" accesskey="k" title="Accesskey Legend for the Validator Service">Accesskeys</a></li> + <li><a href="./feedback.html" title="How to provide feedback on this service">Feedback</a></li> + <li><a href="./about.html" title="Information About this Service">About...</a></li> + + <li><a href="./favlets.html" title="Favlets for the Validator">Favlets</a></li> + </ul> + </dd> + <dt>Other Tools</dt> + <dd> + <ul> + <li><a href="http://valet.webthing.com/" class="offsite" title="The Site Valet QA Tools">Site Valet</a></li> + + <li><a href="http://www.htmlhelp.com/tools/validator/" class="offsite" title="The WDG HTML Validator"><acronym title="Web Design Group">WDG</acronym> Validator</a></li> + <li><a href="http://jigsaw.w3.org/css-validator/" class="offsite" title="The W3C CSS Validator"><acronym title="Cascading Style Sheets">CSS</acronym> Validator</a></li> + <li><a href="./checklink" class="offsite" title="The W3C Link Checker">Link Checker</a></li> + <li><a href="http://www.w3.org/People/Raggett/tidy/" class="offsite" title="The HTML Tidy Home Page"><acronym title="HyperText Markup Language">HTML</acronym> Tidy</a></li> + + </ul> + </dd> + <dt>MarkUp Standards</dt> + <dd> + <ul> + <li><a href="http://www.w3.org/TR/xhtml11/" class="offsite" title="The XHTML 1.1 Recommendation"><acronym title="eXtensible HyperText Markup Language">XHTML</acronym> 1.1</a></li> + <li><a href="http://www.w3.org/TR/xhtml1/" class="offsite" title="The XHTML 1.0 Recommendation"><acronym title="eXtensible HyperText Markup Language">XHTML</acronym> 1.0</a></li> + + <li><a href="http://www.w3.org/TR/html401/" class="offsite" title="The HTML 4.01 Recommendation"><acronym title="HyperText Markup Language">HTML</acronym> 4.01</a></li> + </ul> + </dd> + <dt>Style Standards</dt> + <dd> + <ul class="none"> + <li><a href="http://www.w3.org/TR/xsl/" class="offsite" title="The XSL 1.0 Proposed Recommendation"><acronym title="eXtensible Style Language">XSL</acronym> 1.0</a></li> + + <li><a href="http://www.w3.org/TR/REC-CSS2" class="offsite" title="The CSS Level 2 Recommendation"><acronym title="Cascading Style Sheets">CSS</acronym> Level 2</a></li> + <li><a href="http://www.w3.org/TR/REC-CSS1" class="offsite" title="The CSS Level 1 Recommendation"><acronym title="Cascading Style Sheets">CSS</acronym> Level 1</a></li> + </ul> + </dd> + <dt>Accessibility</dt> + + <dd> + <ul> + <li><a href="http://www.w3.org/WAI/" class="offsite" title="The Web Accessibility Initiative Home Page"><acronym title="Web Accessibility Initiative">WAI</acronym> Home</a></li> + <li><a href="http://www.w3.org/Talks/WAI-Intro/slide1-0.html" class="offsite" title="Overview of the Web Accessibility Initiative"><acronym title="Web Accessibility Initiative">WAI</acronym> Overview</a></li> + <li><a href="http://www.w3.org/WAI/bcase/benefits.html" class="offsite" title="Benefits of Accessible Web Design"><acronym title="Web Accessibility Initiative">WAI</acronym> Benefits</a></li> + <li><a href="http://www.w3.org/1999/05/WCAG-REC-fact" class="offsite" title="Frequently Asked Questions About The Web Content Accessibility Guidelines"><acronym title="Web Content Accessibility Guidelines">WCAG</acronym> <acronym title="Frequently Asked Questions">FAQ</acronym></a></li> + + <li><a href="http://www.w3.org/TR/WCAG10/" class="offsite" title="Web Content Accessibility Guidelines 1.0"><acronym title="Web Content Accessibility Guidelines">WCAG</acronym> 1.0</a></li> + <li><a href="http://www.w3.org/WAI/gettingstarted/" class="offsite" title="WAI Getting Started Guide"><acronym title="Web Accessibility Initiative">WAI</acronym> Intro</a></li> + <li><a href="http://www.w3.org/WAI/References/QuickTips/" class="offsite" title="WAI Quick Tips"><acronym title="Web Accessibility Initiative">WAI</acronym> Tips</a></li> + </ul> + </dd> + </dl> diff --git a/share/templates/en_US/invalid.tmpl b/share/templates/en_US/invalid.tmpl new file mode 100644 index 0000000..b053e1e --- /dev/null +++ b/share/templates/en_US/invalid.tmpl @@ -0,0 +1,27 @@ + <div id="result"> + <h2 id="results" class="invalid">This page is <strong>not</strong> Valid <TMPL_VAR NAME="file_version">!</h2> +<TMPL_IF NAME="is_xml"> + <p> + Below are the results of checking this document for <a + href="http://www.w3.org/TR/REC-xml#sec-conformance">XML + well-formedness</a> and validity. + </p> +<TMPL_ELSE> + <p> + Below are the results of attempting to parse this document with + an SGML parser. + </p> +</TMPL_IF> + <ol> +<TMPL_LOOP NAME="file_errors"> + <li> + <em>Line <a href="#line-<TMPL_VAR NAME="line">"><TMPL_VAR NAME="line"></a>, + column <TMPL_VAR NAME="char"></em>: + <span class="msg"><TMPL_VAR NAME="msg"></span> +<TMPL_IF NAME="uri">(<a href="<TMPL_VAR NAME="uri">">explain...</a>)</TMPL_IF>. +<pre><code class="input"><TMPL_VAR NAME="src"></code> +<TMPL_VAR NAME="col"><span class="markup">^</span></pre> + </li> +</TMPL_LOOP> + </ol> + </div> diff --git a/share/templates/en_US/jumpbar.tmpl b/share/templates/en_US/jumpbar.tmpl new file mode 100644 index 0000000..aca6938 --- /dev/null +++ b/share/templates/en_US/jumpbar.tmpl @@ -0,0 +1,13 @@ + <p id="skip" class="jumpbar"> + Jump To: + [<a title="Result of Validation" href="#result">Results</a>] +<TMPL_IF NAME="opt_show_source"> + [<a title="Listing of Source Input" href="#source">Source Listing</a>] +</TMPL_IF> +<TMPL_IF NAME="opt_show_parsetree"> + [<a title="Document Parse Tree" href="#parse">Parse Tree</a>] +</TMPL_IF> +<TMPL_IF NAME="opt_show_outline"> + [<a title="Document Outline" href="#outline">Outline</a>] +</TMPL_IF> + </p> diff --git a/share/templates/en_US/opt_show_outline.tmpl b/share/templates/en_US/opt_show_outline.tmpl new file mode 100644 index 0000000..a93283b --- /dev/null +++ b/share/templates/en_US/opt_show_outline.tmpl @@ -0,0 +1,14 @@ + <div id="outline"> + <h2>Outline</h2> + <p> + Below is an outline for this document, automatically generated from the + heading tags (<code><h1></code> through <code><h6></code>.) + </p> +<TMPL_VAR NAME="file_outline"> + <p> + If this does not look like a real outline, it is likely that the + heading tags are not being used properly. (Headings should reflect + the logical structure of the document; they should not be used simply + to add emphasis, or to change the font size.) + </p> + </div> diff --git a/share/templates/en_US/opt_show_parsetree.tmpl b/share/templates/en_US/opt_show_parsetree.tmpl new file mode 100644 index 0000000..72e5251 --- /dev/null +++ b/share/templates/en_US/opt_show_parsetree.tmpl @@ -0,0 +1,14 @@ + <div id="parse"> + <h2>Parse Tree</h2> + <p class="note"> +<TMPL_IF NAME="file_parsetree_noatt"> + I am excluding the attributes, as you requested. +<TMPL_ELSE> + You can also view this parse tree without attributes by selecting the + appropriate option on <a href="./#form">the form</a>. +</TMPL_IF> + </p> + <pre> +<TMPL_VAR NAME="file_parsetree"> + </pre> + </div> diff --git a/share/templates/en_US/opt_show_source.tmpl b/share/templates/en_US/opt_show_source.tmpl new file mode 100644 index 0000000..b0f510f --- /dev/null +++ b/share/templates/en_US/opt_show_source.tmpl @@ -0,0 +1,10 @@ + <div id="source"> + <h2>Source Listing</h2> + + <p>Below is the source input I used for this validation:</p> + <ol class="source"> +<TMPL_LOOP NAME="file_source"> + <li id="<TMPL_VAR NAME="file_source_index">"><TMPL_VAR NAME="file_source_line"></li> +</TMPL_LOOP> + </ol> + </div> diff --git a/share/templates/en_US/popup_charset.tmpl b/share/templates/en_US/popup_charset.tmpl new file mode 100644 index 0000000..93dd41f --- /dev/null +++ b/share/templates/en_US/popup_charset.tmpl @@ -0,0 +1,38 @@ +<select name="charset" id="charset"> + <option value="(detect automatically)">(detect automatically)</option> + <option value="utf-8 (Unicode, worldwide)">utf-8 (Unicode, worldwide)</option> + <option value="utf-16 (Unicode, worldwide)">utf-16 (Unicode, worldwide)</option> + <option value="iso-8859-1 (Western Europe)">iso-8859-1 (Western Europe)</option> + <option value="iso-8859-2 (Central Europe)">iso-8859-2 (Central Europe)</option> + <option value="iso-8859-3 (Southern Europe)">iso-8859-3 (Southern Europe)</option> + <option value="iso-8859-4 (Baltic Rim)">iso-8859-4 (Baltic Rim)</option> + <option value="iso-8859-5 (Cyrillic)">iso-8859-5 (Cyrillic)</option> + <option value="iso-8859-6-i (Arabic)">iso-8859-6-i (Arabic)</option> + <option value="iso-8859-7 (Greek)">iso-8859-7 (Greek)</option> + <option value="iso-8859-8-i (Hebrew)">iso-8859-8-i (Hebrew)</option> + <option value="iso-8859-9 (Turkish)">iso-8859-9 (Turkish)</option> + <option value="iso-8859-10 (Latin 6)">iso-8859-10 (Latin 6)</option> + <option value="iso-8859-13 (Latin 7)">iso-8859-13 (Latin 7)</option> + <option value="iso-8859-14 (Celtic)">iso-8859-14 (Celtic)</option> + <option value="iso-8859-15 (Latin 9)">iso-8859-15 (Latin 9)</option> + <option value="us-ascii (basic English)">us-ascii (basic English)</option> + <option value="euc-jp (Japanese, Unix)">euc-jp (Japanese, Unix)</option> + <option value="shift_jis (Japanese, Win/Mac)">shift_jis (Japanese, Win/Mac)</option> + <option value="iso-2022-jp (Japanese, email)">iso-2022-jp (Japanese, email)</option> + <option value="euc-kr (Korean)">euc-kr (Korean)</option> + <option value="gb2312 (Chinese, simplified)">gb2312 (Chinese, simplified)</option> + <option value="gb18030 (Chinese, simplified)">gb18030 (Chinese, simplified)</option> + <option value="big5 (Chinese, traditional)">big5 (Chinese, traditional)</option> + <option value="tis-620 (Thai)">tis-620 (Thai)</option> + <option value="koi8-r (Russian)">koi8-r (Russian)</option> + <option value="koi8-u (Ukrainian)">koi8-u (Ukrainian)</option> + <option value="macintosh (MacRoman)">macintosh (MacRoman)</option> + <option value="windows-1250 (Central Europe)">windows-1250 (Central Europe)</option> + <option value="windows-1251 (Cyrillic)">windows-1251 (Cyrillic)</option> + <option value="windows-1252 (Western Europe)">windows-1252 (Western Europe)</option> + <option value="windows-1253 (Greek)">windows-1253 (Greek)</option> + <option value="windows-1254 (Turkish)">windows-1254 (Turkish)</option> + <option value="windows-1255 (Hebrew)">windows-1255 (Hebrew)</option> + <option value="windows-1256 (Arabic)">windows-1256 (Arabic)</option> + <option value="windows-1257 (Baltic Rim)">windows-1257 (Baltic Rim)</option> +</select> diff --git a/share/templates/en_US/popup_doctype.tmpl b/share/templates/en_US/popup_doctype.tmpl new file mode 100644 index 0000000..c282610 --- /dev/null +++ b/share/templates/en_US/popup_doctype.tmpl @@ -0,0 +1,13 @@ +<select name="doctype" id="doctype"> + <option value="(detect automatically)">(detect automatically)</option> + <option value="XHTML 1.1">XHTML 1.1</option> + <option value="XHTML Basic 1.0">XHTML Basic 1.0</option> + <option value="XHTML 1.0 Strict">XHTML 1.0 Strict</option> + <option value="XHTML 1.0 Transitional">XHTML 1.0 Transitional</option> + <option value="XHTML 1.0 Frameset">XHTML 1.0 Frameset</option> + <option value="HTML 4.01 Strict">HTML 4.01 Strict</option> + <option value="HTML 4.01 Transitional">HTML 4.01 Transitional</option> + <option value="HTML 4.01 Frameset">HTML 4.01 Frameset</option> + <option value="HTML 3.2">HTML 3.2</option> + <option value="HTML 2.0">HTML 2.0</option> +</select> diff --git a/share/templates/en_US/result.tmpl b/share/templates/en_US/result.tmpl new file mode 100644 index 0000000..c941c00 --- /dev/null +++ b/share/templates/en_US/result.tmpl @@ -0,0 +1,34 @@ +<TMPL_INCLUDE NAME="header.tmpl"> + + <div id="main"> + <div id="head"> + <TMPL_INCLUDE name="jumpbar.tmpl"> + <TMPL_IF NAME="file_opt_verbose"> + <TMPL_INCLUDE NAME="table.tmpl"> + </TMPL_IF> + <TMPL_IF NAME="file_opt_warnings"> + <ul id="Warnings"> + </ul> + </TMPL_IF> + </div><!-- end of "head" --> + + <TMPL_IF NAME="VALID"> + <TMPL_INCLUDE NAME="valid.tmpl"> + <TMPL_ELSE> + <TMPL_INCLUDE NAME="invalid.tmpl"> + </TMPL_IF> + + <TMPL_IF NAME="OPT_SHOW_SOURCE"> + <TMPL_INCLUDE NAME="opt_show_source.tmpl"> + </TMPL_IF> + + <TMPL_IF NAME="OPT_SHOW_OUTLINE"> + <TMPL_INCLUDE NAME="opt_show_outline.tmpl"> + </TMPL_IF> + + <TMPL_IF NAME="OPT_SHOW_parsetree"> + <TMPL_INCLUDE NAME="opt_show_parsetree.tmpl"> + </TMPL_IF> + </div><!-- end of "main" --> + +<TMPL_INCLUDE NAME="footer.tmpl"> diff --git a/share/templates/en_US/table.tmpl b/share/templates/en_US/table.tmpl new file mode 100644 index 0000000..517032b --- /dev/null +++ b/share/templates/en_US/table.tmpl @@ -0,0 +1,62 @@ +<form id="form" method="get" action="check"> + <table class="header"> + <tr> + <th><label title="Address of Page to Validate (accesskey: 1)" for="uri">Address</label>: </th> + <td colspan="2"><input accesskey="1" type="text" id="uri" name="uri" size="20" value="http://www.w3.org/" /></td> + </tr> + <tr> + <th>Modified: </th> + <td colspan="2">Wed Nov 27 05:01:35 2002</td> + </tr> + <tr> + <th>Server: </th> + <td colspan="2">Apache/1.3.26 (Unix) PHP/3.0.18</td> + </tr> + <tr> + <th>Size: </th> + <td colspan="2">20946</td> + </tr> + <tr> + <th>Content-Type: </th> + <td colspan="2">text/html</td> + </tr> + <tr> + <th><label accesskey="2" title="Character Encoding (accesskey: 2)" for="charset">Encoding</label>: </th> + <td>us-ascii</td> + <td><TMPL_INCLUDE NAME="popup_charset.tmpl"></td> + </tr> + <tr> + <th><label accesskey="3" for="doctype" title="Document Type (accesskey: 3)">Doctype</label>: </th> + <td><a href="http://www.w3.org/TR/2000/REC-xhtml1-20000126/">XHTML 1.0</a> Transitional</td> + <td><TMPL_INCLUDE NAME="popup_doctype.tmpl"></td> + </tr> + <tr> + <th>Root Namespace: </th> + <td><a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a></td> + </tr> + </table> + <fieldset> + <legend accesskey="4">Revalidate With Options</legend> + <table class="header"> + <tr> + <th><input type="submit" value="Revalidate" accesskey="9" title="Revalidate file (accesskey: 9)" />: </th> + <td colspan="2"> + <table class="options"> + <tr> + <td><label title="Show Page Source (accesskey: 5)"><input type="checkbox" value="1" name="ss" accesskey="5" />Show Source</label></td> + <td><label title="Show an Outline of the document (accesskey: 6)"><input type="checkbox" value="1" name="outline" accesskey="6" />Outline</label></td> + </tr> + <tr> + <td><label title="Show Parse Tree (accesskey: 7)"><input type="checkbox" value="1" name="sp" accesskey="7" />Parse Tree</label></td> + <td><label title="Exclude Attributes from Parse Tree (accesskey: 8)"><input type="checkbox" value="1" name="noatt" accesskey="8" />...no attributes</label></td> + </tr> + <tr> + <td><label title="Validate also pages for which the HTTP status code indicates an error"><input type="checkbox" value="1" name="No200" />Validate error pages</label></td> + <td><label title="Show Verbose Output"><input type="checkbox" value="1" name="verbose" checked="checked" />Verbose Output</label></td> + </tr> + </table> + </td> + </tr> + </table> + </fieldset> +</form> diff --git a/share/templates/en_US/tip.tmpl b/share/templates/en_US/tip.tmpl new file mode 100644 index 0000000..321855b --- /dev/null +++ b/share/templates/en_US/tip.tmpl @@ -0,0 +1,4 @@ + <dl class="tip"> + <dt><a href="http://www.w3.org/2001/06tips/">Tip Of The Day</a>:</dt> + <dd><a href="<TMPL_VAR NAME="tip_uri">"><TMPL_VAR NAME="tip_slug"></a></dd> + </dl> diff --git a/share/templates/en_US/valid.tmpl b/share/templates/en_US/valid.tmpl new file mode 100644 index 0000000..a1edca0 --- /dev/null +++ b/share/templates/en_US/valid.tmpl @@ -0,0 +1,63 @@ +<div id="result"> +<TMPL_IF NAME="is_tentative"> + <h2 class="valid">This Page Is <em>Tentatively</em> Valid <TMPL_VAR NAME="file_version"> (Tentatively Valid)!</h2> +<TMPL_ELSE> + <h2 class="valid">This Page Is Valid <TMPL_VAR NAME="file_version">!</h2> +</TMPL_IF> + <dl class="tip"> + <dt><a href="http://www.w3.org/2001/06tips/">Tip Of The Day</a>:</dt> + <dd><a href="<TMPL_VAR NAME="tip_uri">"><TMPL_VAR NAME="tip_slug"></a></dd> + </dl> + <p> + The document located at + <<a href="<TMPL_VAR NAME="file_uri">"><TMPL_VAR NAME="file_uri"></a>> + was checked and found to be valid <TMPL_VAR NAME="file_version">. + This means that the resource in question identified itself as + "<TMPL_VAR NAME="file_version">" and that we successfully performed a + formal validation using an SGML or XML Parser (depending on the + markup language used). + </p> +<TMPL_IF NAME="have_badge"> + <p> + <img + class="inline-badge" + src="<TMPL_VAR NAME="badge_uri">" + alt="<TMPL_VAR NAME="badge_alt">" + <TMPL_VAR NAME="badge_gifhw"> /> + To show your readers that you have taken the care to create an + interoperable Web page, you may display this icon on any page + that validates. Here is the HTML you could use to add this icon + to your Web page: + </p> + <pre> + <p> + <a href="<TMPL_VAR NAME="cfg_home_page">/check/referer"><img + src="<TMPL_VAR NAME="badge_uri">" + alt="<TMPL_VAR NAME="badge_alt">"<TMPL_VAR NAME="badge_gifhw"><TMPL_VAR NAME="badge_xhtml">></a> + </p> + </pre> + <p> + If you like, you can download a copy of this image (in + <a href="<TMPL_VAR NAME="badge_uri">.png">PNG</a> or + <a href="<TMPL_VAR NAME="badge_uri">.gif">GIF</a> + format) to keep in your local web directory, and change the HTML fragment + above to reference your local image rather than the one on this server. + </p> +</TMPL_IF> + <p> + If you use <a href="http://www.w3.org/Style/CSS/">CSS</a> in your document, + you should also <a title="Validate CSS at the W3C CSS Validator" + href="http://jigsaw.w3.org/css-validator/validator?uri=<TMPL_VAR NAME="file_uri">">check + it for validity</a> using the W3C <a + href="http://jigsaw.w3.org/css-validator/">CSS Validation Service</a>. + </p> +<TMPL_UNLESS NAME="is_upload"> + <p> + If you would like to create a link to <em>this</em> page (i.e., this + validation result) to make it easier to re-validate this page in the + future or to allow others to validate your page, the URI is + <<a href="<TMPL_VAR NAME="file_thispage">"><TMPL_VAR NAME="file_thispage"></a>> + (or you can just add the current page to your bookmarks or hotlist). + </p> +</TMPL_UNLESS> +</div><!-- end of "result" --> |