From d8cfdf258db6ee7f718eda761576d25c2a91066b Mon Sep 17 00:00:00 2001 From: Timo Stollenwerk Date: Tue, 26 May 2009 19:58:59 +0000 Subject: [PATCH] reply-to-comment view and jquery forms added. svn path=/plone.app.discussion/trunk/; revision=27128 --- plone/app/discussion/browser/images/reply.gif | Bin 0 -> 336 bytes .../javascripts/reply_to_comment_form.js | 34 ++++++++++++++++++ .../profiles/default/jsregistry.xml | 8 +++++ 3 files changed, 42 insertions(+) create mode 100644 plone/app/discussion/browser/images/reply.gif create mode 100644 plone/app/discussion/browser/javascripts/reply_to_comment_form.js create mode 100644 plone/app/discussion/profiles/default/jsregistry.xml diff --git a/plone/app/discussion/browser/images/reply.gif b/plone/app/discussion/browser/images/reply.gif new file mode 100644 index 0000000000000000000000000000000000000000..a4379a70b62b2f5fb3894d4fe37bbec2d48ff822 GIT binary patch literal 336 zcmZ?wbhEHb6krfw_{6}lb?esMyLTTxeE8Ikj=OT$TrAJ$;<|_}jm`@|bqKX+9)+}RS5LZKpX-F_Ih=wyT>@Y@%eGXz^1RB98cD^{x*a&PK zBaagU1M9v2|39lSFtATzVE8-n|Nq~M{{R2G7-$F39S3rfON+|DYJoZ#&oVH8-K+SM zg_D7SgFy!*1M)fpi<^LFx1^})fVNU=6 literal 0 HcmV?d00001 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(" + + +