Replace tabs with whitespace.

svn path=/plone.app.discussion/trunk/; revision=46974
This commit is contained in:
Timo Stollenwerk 2011-01-20 20:04:38 +00:00
parent 9cc32a76a4
commit fb0ca6c795

View File

@ -4,9 +4,9 @@
* *
******************************************************************************/ ******************************************************************************/
(function ($) { (function ($) {
// This unnamed function allows us to use $ inside of a block of code // This unnamed function allows us to use $ inside of a block of code
// without permanently overwriting $. // without permanently overwriting $.
// http://docs.jquery.com/Using_jQuery_with_Other_Libraries // http://docs.jquery.com/Using_jQuery_with_Other_Libraries
/************************************************************************** /**************************************************************************
* Create a reply-to-comment form right beneath the form that is passed to * Create a reply-to-comment form right beneath the form that is passed to
* the function. We do this by copying the regular comment form and * the function. We do this by copying the regular comment form and
@ -89,54 +89,54 @@
**************************************************************************/ **************************************************************************/
$(window).load(function () { $(window).load(function () {
/********************************************************************** /**********************************************************************
* If the user has hit the reply button of a reply-to-comment form * If the user has hit the reply button of a reply-to-comment form
* (form was submitted with a value for the "in_reply_to" field in the * (form was submitted with a value for the "in_reply_to" field in the
* request), create a reply-to-comment form right under this comment. * request), create a reply-to-comment form right under this comment.
**********************************************************************/ **********************************************************************/
var post_comment_div = $("#commenting"); var post_comment_div = $("#commenting");
var in_reply_to_field = var in_reply_to_field =
post_comment_div.find("input[name='form.widgets.in_reply_to']"); post_comment_div.find("input[name='form.widgets.in_reply_to']");
if (in_reply_to_field.val() !== "") { if (in_reply_to_field.val() !== "") {
var current_reply_id = "#" + in_reply_to_field.val(); var current_reply_id = "#" + in_reply_to_field.val();
var current_reply_to_div = $(".discussion").find(current_reply_id); var current_reply_to_div = $(".discussion").find(current_reply_id);
$.createReplyForm(current_reply_to_div); $.createReplyForm(current_reply_to_div);
$.clearForm(post_comment_div); $.clearForm(post_comment_div);
} }
/********************************************************************** /**********************************************************************
* If the user hits the "reply" button of an existing comment, create a * If the user hits the "reply" button of an existing comment, create a
* reply form right beneath this comment. * reply form right beneath this comment.
**********************************************************************/ **********************************************************************/
$(".reply-to-comment-button").bind("click", function (e) { $(".reply-to-comment-button").bind("click", function (e) {
var comment_div = $(this).parents().filter(".comment"); var comment_div = $(this).parents().filter(".comment");
$.createReplyForm(comment_div); $.createReplyForm(comment_div);
$.clearForm(comment_div); $.clearForm(comment_div);
}); });
/********************************************************************** /**********************************************************************
* If the user hits the "clear" button of an open reply-to-comment form, * If the user hits the "clear" button of an open reply-to-comment form,
* remove the form and show the "reply" button again. * remove the form and show the "reply" button again.
**********************************************************************/ **********************************************************************/
$("#commenting #form-buttons-cancel").bind("click", function (e) { $("#commenting #form-buttons-cancel").bind("click", function (e) {
e.preventDefault(); e.preventDefault();
var reply_to_comment_button = $(this). var reply_to_comment_button = $(this).
parents(). parents().
filter(".comment"). filter(".comment").
find(".reply-to-comment-button"); find(".reply-to-comment-button");
/* Find the reply-to-comment form and hide and remove it again. */ /* Find the reply-to-comment form and hide and remove it again. */
$.reply_to_comment_form = $(this).parents().filter(".reply"); $.reply_to_comment_form = $(this).parents().filter(".reply");
$.reply_to_comment_form.slideUp("slow", function () { $.reply_to_comment_form.slideUp("slow", function () {
$(this).remove(); $(this).remove();
}); });
/* Show the reply-to-comment button again. */ /* Show the reply-to-comment button again. */
reply_to_comment_button.css("display", "inline"); reply_to_comment_button.css("display", "inline");
}); });
/********************************************************************** /**********************************************************************
@ -168,7 +168,7 @@
/********************************************************************** /**********************************************************************
* Delete a comment and its answers. * Delete a comment and its answers.
**********************************************************************/ **********************************************************************/
$("input[name='form.button.DeleteComment']").live('click', function () { $("input[name='form.button.DeleteComment']").live('click', function () {
var trigger = this; var trigger = this;
var form = $(this).parents("form"); var form = $(this).parents("form");
var data = $(form).serialize(); var data = $(form).serialize();
@ -211,24 +211,24 @@
return false; return false;
}); });
/********************************************************************** /**********************************************************************
* By default, hide the reply and the cancel button for the regular add * By default, hide the reply and the cancel button for the regular add
* comment form. * comment form.
**********************************************************************/ **********************************************************************/
$(".reply").find("input[name='form.buttons.reply']") $(".reply").find("input[name='form.buttons.reply']")
.css("display", "none"); .css("display", "none");
$(".reply").find("input[name='form.buttons.cancel']") $(".reply").find("input[name='form.buttons.cancel']")
.css("display", "none"); .css("display", "none");
/********************************************************************** /**********************************************************************
* By default, show the reply button only when Javascript is enabled. * By default, show the reply button only when Javascript is enabled.
* Otherwise hide it, since the reply functions only work with JS * Otherwise hide it, since the reply functions only work with JS
* enabled. * enabled.
**********************************************************************/ **********************************************************************/
$(".reply-to-comment-button").css("display" , "inline"); $(".reply-to-comment-button").css("display" , "inline");
}); });
//#JSCOVERAGE_ENDIF //#JSCOVERAGE_ENDIF