- From: Ville Skytta <ville@hutz.w3.org>
- Date: Mon, 10 May 2004 18:17:32 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/perl/modules/W3C/LinkChecker/bin In directory hutz:/tmp/cvs-serv17017 Modified Files: checklink Log Message: Don't send Content-Script-Type as a real HTTP header, use <meta http-equiv> instead. Also make uriOk() focus the URI field if it was not 'ok'. Index: checklink =================================================================== RCS file: /sources/public/perl/modules/W3C/LinkChecker/bin/checklink,v retrieving revision 3.40 retrieving revision 3.41 diff -u -d -r3.40 -r3.41 --- checklink 7 May 2004 21:37:28 -0000 3.40 +++ checklink 10 May 2004 18:17:29 -0000 3.41 @@ -86,7 +86,7 @@ package W3C::LinkChecker; use vars qw($AGENT $PACKAGE $PROGRAM $VERSION $REVISION - $DocType $Accept $ContentTypes %Cfg); + $DocType $Meta $Accept $ContentTypes %Cfg); use HTML::Entities qw(); use HTML::Parser 3.00 qw(); @@ -126,6 +126,9 @@ $DocType = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'; + $Meta = '<meta http-equiv="Content-Script-Type" ' . + 'content="application/x-javascript">'; + my @content_types = qw(application/xhtml+xml text/html); $Accept = join(', ', @content_types) . ', */*;q=0.5'; my $re = join('|', map { s/\+/\\+/g; $_ } @content_types); @@ -1391,12 +1394,13 @@ <html lang=\"en\"> <head> <title>401 Authorization Required</title> +%s </head> <body> <h1>Authorization Required</h1> <p> You need %s access to %s to perform Link Checking.<br> -", $DocType, &encode($realm), $r->request->url); +", $DocType, $Meta, &encode($realm), $r->request->url); if ($Opts{Trusted}) { printf <<EOF, &encode($Opts{Trusted}); @@ -1947,7 +1951,6 @@ if (! $Opts{Command_Line}) { $headers .= "Cache-Control: no-cache\nPragma: no-cache\n" if $doform; $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; - $headers .= "Content-Script-Type: application/x-javascript\n"; $headers .= "Set-Cookie: $cookie\n" if $cookie; $headers .= "Content-Language: en\n\n"; } @@ -1958,12 +1961,15 @@ <script type=\"application/x-javascript\"> function uriOk() { - var v = document.forms[0].uri.value; - if (v.length > 0) { - if (v.search) return (v.search(/\\S/) != -1); - return true; + var u = document.forms[0].uri; + var ok = false; + if (u.value.length > 0) { + if (u.value.search) { + ok = (u.value.search(/\\S/) != -1); + } } - return false; + if (! ok) u.focus(); + return ok; } </script>"; $onload = ' onload="document.forms[0].uri.focus()"'; @@ -1973,6 +1979,7 @@ <html lang=\"en\"> <head> <title>W3C", $title, "</title> +", $Meta, " <style type=\"text/css\"> body, address { font-family: sans-serif;
Received on Monday, 10 May 2004 14:18:41 UTC