From 1747a3655b94bcdd2adf0af246ebda0fba4168ac Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Fri, 28 Aug 2009 12:03:34 +0000 Subject: [PATCH] fix recaptcha reply-to-comment form bug. svn path=/plone.app.discussion/trunk/; revision=29433 --- plone/app/discussion/browser/javascripts/comments.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/plone/app/discussion/browser/javascripts/comments.js b/plone/app/discussion/browser/javascripts/comments.js index a3b68da..46156b2 100644 --- a/plone/app/discussion/browser/javascripts/comments.js +++ b/plone/app/discussion/browser/javascripts/comments.js @@ -43,10 +43,18 @@ jq(document).ready(function() { var reply_button = comment_div.find(".reply-to-comment-button"); /* Clone the reply div at the end of the page template that contains - * the regular comment form and insert it after the reply button of the - * current comment. + * the regular comment form. */ var reply_div = jq("#commenting").clone(true); + + /* Remove the ReCaptcha JS code before appending the form. If not + * removed, this causes problems + */ + reply_div.find("#formfield-form-widgets-captcha").find("script").remove(); + + /* Insert the cloned comment form right after the reply button of the + * current comment. + */ reply_div.appendTo(comment_div).css("display", "none"); /* Remove id="reply" attribute, since we use it to uniquely