Skip to content

Commit

Permalink
refs #1705 : Let it work even when multple entries are shown.
Browse files Browse the repository at this point in the history
  • Loading branch information
achimnol committed Dec 16, 2014
1 parent 0b40e19 commit 8d2c18e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/reCAPTCHA/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ function Recaptcha_Footer($target) {
<script type="text/javascript">
(function($) {
if (!doesHaveOwnership) {
$('a[id^=commentCount]').click(function() {
recaptchaWaitForElement('form[id$=WriteComment]', function(f) {
var entryId = $(f).attr('id').search(/(\d+)/)[1];
$('a[id^=commentCount]').click(function(e) {
var entryId = $(e.target).attr('id').match(/(\d+)/)[1];
recaptchaWaitForElement('form[id=entry' + entryId + 'WriteComment]', function(f) {
var blockId = 'comment_recaptcha_' + entryId;
if ($(blockId).length > 0) return;
$(f).find('textarea').after('<div style="margin: 5pt 0 5pt 0" id="' + blockId + '"></div>');
grecaptcha.render(blockId, {
'sitekey': '{$config['siteKey']}'
Expand Down

0 comments on commit 8d2c18e

Please sign in to comment.