summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorot <ot@localhost>2007-04-10 02:49:44 +0000
committerot <ot@localhost>2007-04-10 02:49:44 +0000
commit9e72819ee25cab62a866344563750aaa117926b7 (patch)
tree32ed5d00c79e1f64db08e5a450d980faf04a0473
parent53dd94aacd637a3fcb0edf3eb0106b8c6741a036 (diff)
downloadmarkup-validator-9e72819ee25cab62a866344563750aaa117926b7.zip
markup-validator-9e72819ee25cab62a866344563750aaa117926b7.tar.gz
markup-validator-9e72819ee25cab62a866344563750aaa117926b7.tar.bz2
adding pre-fill routines for direct inut method
-rwxr-xr-xhtdocs/detailed-form_directinput.html4
-rwxr-xr-xhtdocs/header.html5
-rw-r--r--htdocs/scripts/prefill.js19
3 files changed, 25 insertions, 3 deletions
diff --git a/htdocs/detailed-form_directinput.html b/htdocs/detailed-form_directinput.html
index 5127ddc..5d1d436 100755
--- a/htdocs/detailed-form_directinput.html
+++ b/htdocs/detailed-form_directinput.html
@@ -1,5 +1,7 @@
+<tr><th>Pre-fill with:</th><td> <a href="#validate-by-input" onclick="prefill_document('fragment', 'xhtml1')">XHTML 1.0</a> &middot;
+ <a href="#validate-by-input" onclick="prefill_document('fragment', 'html401')">HTML 4.01</a> document structure.</td></tr>
<tr>
- <td><label for="<!--#echo var="fieldset_id" -->-doctype">Use Doctype:</label></td>
+ <th><label for="<!--#echo var="fieldset_id" -->-doctype">Use Doctype:</label></th>
<td> <!--#include virtual="doctype-select.html" --></td>
<td> <label for="<!--#echo var="fieldset_id" -->-fbd"><input id="<!--#echo var="fieldset_id" -->-fbd" name="fbd" type="checkbox" value="1" />Only if Doctype is missing</label></td>
</tr>
diff --git a/htdocs/header.html b/htdocs/header.html
index 3f54dc3..b77151e 100755
--- a/htdocs/header.html
+++ b/htdocs/header.html
@@ -12,7 +12,8 @@
<script type="text/javascript" src="<!--#echo var="relroot" -->scripts/tabtastic/attachevent.js"></script>
<script type="text/javascript" src="<!--#echo var="relroot" -->scripts/tabtastic/addcss.js"></script>
<script type="text/javascript" src="<!--#echo var="relroot" -->scripts/tabtastic/tabtastic.js"></script>
- <meta name="revision" content="$Id: header.html,v 1.45 2007-03-22 05:05:18 ot Exp $" />
+ <script type="text/javascript" src="<!--#echo var="relroot" -->scripts/prefill.js"></script>
+ <meta name="revision" content="$Id: header.html,v 1.46 2007-04-10 02:49:44 ot Exp $" />
<meta name="keywords" content="HTML, HyperText Markup Language, Validation,
W3C Markup Validation Service" />
<meta name="description" content="W3C's easy-to-use
@@ -21,7 +22,7 @@
<!--#if expr="$feeds = 1" -->
<link rel="alternate" type="application/atom+xml" href="whatsnew.atom" />
<!--#endif -->
- <!-- SSI Template Version: $Id: header.html,v 1.45 2007-03-22 05:05:18 ot Exp $ -->
+ <!-- SSI Template Version: $Id: header.html,v 1.46 2007-04-10 02:49:44 ot Exp $ -->
</head>
diff --git a/htdocs/scripts/prefill.js b/htdocs/scripts/prefill.js
new file mode 100644
index 0000000..7f9636a
--- /dev/null
+++ b/htdocs/scripts/prefill.js
@@ -0,0 +1,19 @@
+// prefill validator "direct input" form with basic document structure
+
+
+var text_xhtml1 = '<?xml version="1.0" encoding="utf-8"?>\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\n "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\n <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\n <head>\n <title>I AM YOUR DOCUMENT TITLE REPLACE ME</title>\n <meta http-equiv="content-type" content="text/html;charset=utf-8" />\n <meta http-equiv="Content-Style-Type" content="text/css" />\n </head>\n <body>\n <p>… Your HTML content here …</p>\n</body>\n </html>';
+
+var text_html401 = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"\n "http://www.w3.org/TR/html4/strict.dtd">\n<html>\n<head>\n <title>I AM YOUR DOCUMENT TITLE REPLACE ME</title>\n <meta http-equiv="content-type" content="text/html;charset=utf-8">\n <meta http-equiv="Content-Style-Type" content="text/css">\n</head>\n<body>\n <p>… Your HTML content here …</p>\n</body>\n</html>';
+
+function prefill_document(textarea_id, doctype) {
+ var txtarea = document.getElementById(textarea_id);
+ // first we remove all children nodes
+ if (doctype == "html401") {
+ txtarea.value = text_html401;
+ }
+ else {
+ txtarea.value = text_xhtml1;
+ }
+// txtarea.select();
+ txtarea.focus();
+}; \ No newline at end of file