diff --git a/plone/app/discussion/browser/images/reply.gif b/plone/app/discussion/browser/images/reply.gif new file mode 100644 index 0000000..a4379a7 Binary files /dev/null and b/plone/app/discussion/browser/images/reply.gif differ diff --git a/plone/app/discussion/browser/javascripts/reply_to_comment_form.js b/plone/app/discussion/browser/javascripts/reply_to_comment_form.js new file mode 100644 index 0000000..76c57af --- /dev/null +++ b/plone/app/discussion/browser/javascripts/reply_to_comment_form.js @@ -0,0 +1,34 @@ +function createReplyToCommentForm(comment_id) { + /* + * This function creates a form to reply to a specific comment with + * the comment_id given as parameter. It does so by cloneing the existing + * commenting form at the end of the page template. + */ + + /* The jQuery id of the reply-to-comment button */ + var button = "#reply-to-comment-" + comment_id + "-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. + */ + reply_div = jq(".reply").clone(); + reply_div.insertAfter(button); + + /* Hide the reply button (only hide, because we may want to show it + * again if the user hits the cancel button). + */ + jq(button).css("display", "none"); + + /* Fetch the reply form inside the reply div */ + reply_form = reply_div.find("form"); + + /* add a hidden field with the id of the comment */ + reply_form.append(" + + +