# HG changeset patch # User Steve Kemp # Date 1217876655 -3600 # Node ID 53c79b52862a0c472bfc953925f458447446bd55 # Parent dbee53530497fad028c592d3bd3207dfe7ec6530 Added diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/ajax.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/themes/blog.mail-scanning.com/ajax.js Mon Aug 04 20:04:15 2008 +0100 @@ -0,0 +1,122 @@ +// -*-mode: C++; style: K&R; c-basic-offset: 4 ; -*- */ +// +// Simple collection of Javascript for Ajax form submission. +// + + + + +// +// Get an XMLHTTPRequest object. +// +function getXMLHTTPRequest() +{ + req = false; + if(window.XMLHttpRequest) + { + try + { + req = new XMLHttpRequest(); + } + catch(e) + { + req = false; + } + } + else if(window.ActiveXObject) + { + try + { + req = new ActiveXObject("Msxml2.XMLHTTP"); + } + catch(e) + { + try + { + req = new ActiveXObject("Microsoft.XMLHTTP"); + } + catch(e) + { + req = false; + } + } + } + + return( req ); +} + + +// +// Submit the comment. +// +function submitComment() +{ + showProgress(); + + var xhr = getXMLHTTPRequest(); + if(! xhr ) + { + hideProgress(); + return; + } + + xhr.onreadystatechange = function() + { + if(xhr.readyState == 4) + { + if(xhr.status == 200) + { + var o = document.getElementById( "output" ); + o.innerHTML = xhr.responseText; + } + else + { + var o = document.getElementById( "output" ); + o.innerHTML = "Failed HTTP code " + xhr.status + " " + xhr.responseText; + } + + hideProgress(); + } + }; + + data = 'ajax=1'; + data = data + '&id=' + escape(document.forms[0].id.value ); + data = data + '&captcha=' + escape( document.forms[0].captcha.value ); + data = data + '&id=' + escape(document.forms[0].id.value ); + data = data + '&captcha=' + escape( document.forms[0].captcha.value ); + data = data + '&name=' + escape( document.forms[0].name.value ); + data = data + '&mail=' + escape( document.forms[0].mail.value ); + data = data + '&body=' + escape( document.forms[0].body.value ); + + // + // Make the request + // + xhr.open("POST", "/cgi-bin/comments.cgi", true); + xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); + xhr.send(data); +} + + +// +// Show our progress marker. +// +function showProgress() +{ + var i = document.getElementById( "progress" ); + if ( i ) + { + i.style.display = 'block'; + } +} + +// +// Hide our progress marker. +// +function hideProgress() +{ + var i = document.getElementById( "progress" ); + if ( i ) + { + i.style.display = 'none'; + } +} diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/comment-form.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/themes/blog.mail-scanning.com/comment-form.inc Mon Aug 04 20:04:15 2008 +0100 @@ -0,0 +1,22 @@ + +
+

Add A Comment

+
+
+ + + + + + + + + +
Your Name
Your Email
Your Comment
+
+
+

Your submission will be ignored if any field is left blank. But your email address will not be displayed.

+
+
+ diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/comment-loop.inc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/themes/blog.mail-scanning.com/comment-loop.inc Mon Aug 04 20:04:15 2008 +0100 @@ -0,0 +1,12 @@ + +

Comments On This Entry

+ + +
+
+ +
+ +
+ + diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/entry.template --- a/themes/blog.mail-scanning.com/entry.template Mon Aug 04 18:36:16 2008 +0100 +++ b/themes/blog.mail-scanning.com/entry.template Mon Aug 04 20:04:15 2008 +0100 @@ -5,6 +5,10 @@ <!-- tmpl_var name='blog_title' -->: <!-- tmpl_var name='title' --> + + + + @@ -23,6 +27,8 @@ + +
diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/index.template --- a/themes/blog.mail-scanning.com/index.template Mon Aug 04 18:36:16 2008 +0100 +++ b/themes/blog.mail-scanning.com/index.template Mon Aug 04 20:04:15 2008 +0100 @@ -10,7 +10,6 @@ -
@@ -27,6 +26,13 @@ No tags + + + + comments + + +

 

diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/month.template --- a/themes/blog.mail-scanning.com/month.template Mon Aug 04 18:36:16 2008 +0100 +++ b/themes/blog.mail-scanning.com/month.template Mon Aug 04 20:04:15 2008 +0100 @@ -38,6 +38,13 @@ No tags + + + + comments + + +

 

diff -r dbee53530497 -r 53c79b52862a themes/blog.mail-scanning.com/tags.template --- a/themes/blog.mail-scanning.com/tags.template Mon Aug 04 18:36:16 2008 +0100 +++ b/themes/blog.mail-scanning.com/tags.template Mon Aug 04 20:04:15 2008 +0100 @@ -35,6 +35,13 @@ Tags: ., + + + + comments + + +