Show the reply-to-comment button only when Javascript is enabled. Otherwise hide it, since the reply functions rely on jQuery.

svn path=/plone.app.discussion/trunk/; revision=27142
This commit is contained in:
Timo Stollenwerk 2009-05-27 07:26:21 +00:00
parent 6a7b4fa778
commit c1aedbefb0
2 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,12 @@
jq(document).ready(function() {
/*
* Show the reply-to-comment button only when Javascript is enabled.
* Otherwise hide it, since the reply functions rely on jQuery.
*/
jq(".reply-to-comment-button").css("display" , "block")
});
function createReplyToCommentForm(comment_id) { function createReplyToCommentForm(comment_id) {
/* /*
* This function creates a form to reply to a specific comment with * This function creates a form to reply to a specific comment with
@ -23,10 +32,10 @@ function createReplyToCommentForm(comment_id) {
/* Fetch the reply form inside the reply div */ /* Fetch the reply form inside the reply div */
reply_form = reply_div.find("form"); reply_form = reply_div.find("form");
/* add a hidden field with the id of the comment */ /* Add a hidden field with the id of the comment */
reply_form.append("<input type=\"hidden\" value=\"" + comment_id + "\" name=\"form.reply_to_comment_id\""); reply_form.append("<input type=\"hidden\" value=\"" + comment_id + "\" name=\"form.reply_to_comment_id\"");
/* Change the form action @@reply-to-comment */ /* Change the form action to @@reply-to-comment */
old_action = reply_form.attr("action"); old_action = reply_form.attr("action");
new_action = old_action.replace("@@add-comment", "@@reply-to-comment"); new_action = old_action.replace("@@add-comment", "@@reply-to-comment");
reply_form.attr("action", new_action); reply_form.attr("action", new_action);

View File

@ -1,4 +1,13 @@
/* plone.app.discussion stylesheet */
.reply-to-comment-button { .reply-to-comment-button {
float: right; float: right;
margin-top: -2.5em; margin-top: -2.5em;
} }
.reply-to-comment-button {
/* Hide the reply-to-comment button and show it only if Javascript is enabled.
* Since the reply functions rely on jQuery.
*/
display: none;
}