disinclined.org
/
git
/
dylansserver.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
409920a
)
Now loads new comment after posting
author
Dylan Lloyd
<dylan@psu.edu>
Thu, 10 Mar 2011 08:25:31 +0000
(
03:25
-0500)
committer
Dylan Lloyd
<dylan@psu.edu>
Thu, 10 Mar 2011 08:25:31 +0000
(
03:25
-0500)
includes/ajax.js
patch
|
blob
|
history
index.php
patch
|
blob
|
history
diff --git
a/includes/ajax.js
b/includes/ajax.js
index
50541dc
..
afc73e8
100644
(file)
--- a/
includes/ajax.js
+++ b/
includes/ajax.js
@@
-25,6
+25,11
@@
$(document).ready(function() {
url: "verify",
data: comment_data,
success: function() {
url: "verify",
data: comment_data,
success: function() {
+ var new_post = "<h3><a href='mailto:" + email
+ + "'>" + name + "</a></h3>"
+ + text + "<br><br>";
+ $('#comments').prepend(new_post);
+ $('#comment').hide();
console.log('posted new comment');
}
});
console.log('posted new comment');
}
});
diff --git
a/index.php
b/index.php
index
8f8baae
..
ef5eddf
100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-456,7
+456,6
@@
END_OF_COMMENT;
$publickey = $this->recaptcha_publickey;
echo <<<END_CAPTCHA_STYLE
<script type="text/javascript">
$publickey = $this->recaptcha_publickey;
echo <<<END_CAPTCHA_STYLE
<script type="text/javascript">
-function showRecaptcha() {
Recaptcha.create("$publickey",
"recaptcha_div",
{
Recaptcha.create("$publickey",
"recaptcha_div",
{
@@
-464,16
+463,14
@@
Recaptcha.create("$publickey",
custom_theme_widget: 'recaptcha_widget',
callback: Recaptcha.focus_response_field
});
custom_theme_widget: 'recaptcha_widget',
callback: Recaptcha.focus_response_field
});
-}
</script>
END_CAPTCHA_STYLE;
require_once('includes/recaptchalib.php');
// Trailing slash is necessary for reloads to work
</script>
END_CAPTCHA_STYLE;
require_once('includes/recaptchalib.php');
// Trailing slash is necessary for reloads to work
- $url = $this->url . "verify";
+ $url = $this->url . "verify
/
";
echo "<form id=\"comment_form\" method=\"post\" action=\"$url\">";
echo "<form id=\"comment_form\" method=\"post\" action=\"$url\">";
- echo
<<<END_OF_FORM
+ echo <<<END_OF_FORM
<div id="comment">
<div id="comment">
-<h3><a onclick="showRecaptcha();">comment?</a></h3>
<div id="recaptcha_div">
<br>
<div id="recaptcha_div">
<br>
@@
-493,6
+490,9
@@
END_CAPTCHA_STYLE;
<div style="float:right;position:relative;width:100px;"><div id="recaptcha_image"></div></div>
<br><br><br><br>
</div>
<div style="float:right;position:relative;width:100px;"><div id="recaptcha_image"></div></div>
<br><br><br><br>
</div>
+END_OF_FORM;
+ echo recaptcha_get_html($this->recaptcha_publickey);
+ echo <<<END_OF_FORM
</div>
<input class="submit" type="submit" value="comment">
</div>
<input class="submit" type="submit" value="comment">