summary refs log tree commit diff stats
path: root/theme/comments.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'theme/comments.tpl')
-rwxr-xr-xtheme/comments.tpl130
1 files changed, 79 insertions, 51 deletions
diff --git a/theme/comments.tpl b/theme/comments.tpl index 1ca7ab2..5e1c564 100755 --- a/theme/comments.tpl +++ b/theme/comments.tpl
@@ -1,51 +1,48 @@
1<A NAME="comments"></A> 1<a name="comments" />
2 2
3<!--BEGIN COMMENTS--> 3<!--BEGIN COMMENTS-->
4<A NAME="comment-<!--COMMENTS.ID-->"></A> 4<a name="comment-<!--COMMENTS.ID-->" />
5 5
6<!--BEGIN COMMENTS.EDITOR--> 6<!--BEGIN COMMENTS.EDITOR-->
7<FORM ACTION="/edit-comment.php?id=<!--COMMENTS.ID-->" METHOD="POST"> 7<form action="/edit-comment.php?id=<!--COMMENTS.ID-->" method="post">
8<!--END COMMENTS.EDITOR--> 8<!--END COMMENTS.EDITOR-->
9 9
10<DIV CLASS="bubble" ID="comment-<!--COMMENTS.ID-->"> 10<div class="module unrounded" id="comment-<!--COMMENTS.ID-->">
11 <BLOCKQUOTE> 11 <div id="textBubble-<!--COMMENTS.ID-->" class="comment">
12 <DIV ID="textBubble-<!--COMMENTS.ID-->"> 12 <img src="http://www.gravatar.com/avatar/<!--COMMENTS.CODEDEMAIL-->?s=32&amp;d=identicon&amp;r=G" alt="" />
13 <IMG SRC="http://www.gravatar.com/avatar/<!--COMMENTS.CODEDEMAIL-->?s=32&amp;d=identicon&amp;r=G"> 13 <!--COMMENTS.TEXT-->
14 <!--COMMENTS.TEXT--> 14 </div>
15 </DIV>
16
17 <!--BEGIN COMMENTS.EDITOR-->
18
19 <DIV ID="postBubble-<!--COMMENTS.ID-->" CLASS="invisible">
20 <TEXTAREA ROWS="4" CLASS="comments_field" NAME="comment" COLS="73"><!--COMMENTS.EDITOR.BEFORE--></TEXTAREA>
21 </DIV>
22
23 <!--END COMMENTS.EDITOR-->
24 </BLOCKQUOTE>
25 <CITE><STRONG><!--COMMENTS.USERNAME--></STRONG> on <!--COMMENTS.DATE--></CITE>
26 15
27 <!--BEGIN COMMENTS.EDITOR--> 16 <!--BEGIN COMMENTS.EDITOR-->
28 17
29 <SPAN CLASS="post-vote"> 18 <div id="postBubble-<!--COMMENTS.ID-->" class="invisible">
30 <A HREF="#comment-<!--COMMENTS.ID-->" ONCLICK="openEditor('<!--COMMENTS.ID-->');"><IMG SRC="/theme/images/icons/note_edit.png" ALT="Edit"></A> 19 <textarea rows="4" class="comments_field" name="comment" cols="100"><!--COMMENTS.EDITOR.BEFORE--></textarea>
31 <A HREF="/delete-comment.php?id=<!--COMMENTS.ID-->"><IMG SRC="/theme/images/icons/note_delete.png" ALT="Delete"></A> 20 </div>
32 </SPAN>
33 21
34 <!--END COMMENTS.EDITOR--> 22 <!--END COMMENTS.EDITOR-->
35</DIV> 23</div>
24
25<cite class="light-at-night"><strong><!--COMMENTS.USERNAME--></strong> on <!--COMMENTS.DATE--></cite>
36 26
37<!--BEGIN COMMENTS.EDITOR--> 27<!--BEGIN COMMENTS.EDITOR-->
38 <DIV ID="editComment-<!--COMMENTS.ID-->" CLASS="invisible" STYLE="text-align: center">
39 <INPUT TYPE="submit" VALUE="Edit">
40 <BUTTON TYPE="button" ONCLICK="closeEditor(<!--COMMENTS.ID-->);">Cancel</BUTTON>
41 </DIV>
42 28
43</FORM> 29 <span class="post-vote">
30 <a href="#comment-<!--COMMENTS.ID-->" onclick="openEditor('<!--COMMENTS.ID-->');"><img src="/theme/images/icons/note_edit.png" alt="Edit" /></a>
31 <a href="#comment-<!--COMMENTS.ID-->" onclick="if (confirm('Are you sure you would like to delete this comment?')) {window.location='/delete-comment.php?id=<!--COMMENTS.ID-->';}"><img src="/theme/images/icons/note_delete.png" alt="Delete" /></a>
32 </span>
33
34 <div id="editComment-<!--COMMENTS.ID-->" class="invisible" style="text-align: center">
35 <input type="submit" value="Edit" />
36 <button type="button" onclick="closeEditor(<!--COMMENTS.ID-->);">Cancel</button>
37 </div>
38</form>
44<!--END COMMENTS.EDITOR--> 39<!--END COMMENTS.EDITOR-->
45 40
46<!--END COMMENTS--> 41<!--END COMMENTS-->
47 42
48<SCRIPT TYPE="text/javascript"> 43<div class="cleardiv"></div>
44
45<script type="text/javascript">
49 46
50function openEditor(id) 47function openEditor(id)
51{ 48{
@@ -65,29 +62,60 @@ function closeEditor(id)
65 jQuery("#editComment-" + id).addClass("invisible"); 62 jQuery("#editComment-" + id).addClass("invisible");
66} 63}
67 64
68</SCRIPT> 65function postComment()
66{
67 jQuery("#newComment textarea, #newComment input, #newComment button").attr("disabled", "disabled");
68 jQuery("#flash").text("Processing....").slideDown();
69 jQuery.ajax({
70 type: "POST",
71 url: "/post.php",
72 data: ({
73 id: "<!--PAGEID-->",
74 comment: jQuery("#newComment textarea").val(),
75 username: jQuery("#newComment input:text[name=username]").val(),
76 email: jQuery("#newComment input:text[name=email]").val(),
77 website: jQuery("#newComment input:text[name=website]").val(),
78 recaptcha_challenge_field: jQuery("#newComment input[name=recaptcha_challenge_field]").val(),
79 recaptcha_response_field: jQuery("#newComment input[name=recaptcha_response_field]").val()
80 }),
81 dataType: "text",
82 success: function(msg) {
83 if (msg.indexOf("textBubble") != -1)
84 {
85 jQuery("#flash").text("Your comment has been posted.");
86 jQuery("#newComment").html(msg);
87 } else {
88 jQuery("#newComment textarea, #newComment input, #newComment button").removeAttr("disabled");
89 jQuery("#flash").text(msg);
90 }
91 },
92 error: function() {
93 jQuery("#newComment textarea, #newComment input, #newComment button").removeAttr("disabled");
94 jQuery("#flash").text("There was an error posting your comment.");
95 }
96 });
97}
98
99</script>
69 100
70<DIV ID="newComment"> 101<div id="newComment">
71 <FORM ACTION="/post.php?id=<!--PAGEID-->" METHOD="POST"> 102 <form action="/post.php?id=<!--PAGEID-->" method="post">
72 <DIV CLASS="bubble"> 103 <div class="module unrounded" id="postBubble">
73 <BLOCKQUOTE> 104 <textarea rows="4" class="comments_field" name="comment" cols="100"></textarea>
74 <DIV ID="postBubble"> 105 </div>
75 <TEXTAREA ROWS="4" CLASS="comments_field" NAME="comment" COLS="73"></TEXTAREA> 106
76 </DIV> 107 <cite class="light-at-night"><strong><!--USERNAME--></strong>, feel free to post a comment</cite>
77 </BLOCKQUOTE>
78 <CITE><STRONG><!--USERNAME--></STRONG>, feel free to post a comment</CITE>
79 </DIV>
80 108
81 <CENTER> 109 <center class="light-at-night">
82 <!--BEGIN NOLOG--> 110 <!--BEGIN NOLOG-->
83 <!--RECAPTCHA--> 111 <!--RECAPTCHA-->
84 <P> 112 <p>
85 Name: <INPUT TYPE="text" NAME="username"><BR> 113 Name: <input type="text" name="username" /><br />
86 Email: <INPUT TYPE="text" NAME="email"><BR> 114 Email: <input type="text" name="email" /><br />
87 Website (Optional): <INPUT TYPE="text" NAME="website"> 115 Website (Optional): <input type="text" name="website" />
88 <P> 116 </p>
89 <!--END NOLOG--> 117 <!--END NOLOG-->
90 <INPUT TYPE="submit" VALUE="Post"> 118 <button type="button" onclick="postComment();">Post</button>
91 </CENTER> 119 </center>
92 </FORM> 120 </form>
93</DIV> 121</div>