De-tabbify
svn path=/plone.app.discussion/trunk/; revision=33491
This commit is contained in:
@@ -5,7 +5,7 @@ jq(document).ready(function() {
|
||||
* comment form.
|
||||
*****************************************************************/
|
||||
jq(".reply").find("input[name='form.buttons.reply']").css("display", "none");
|
||||
jq(".reply").find("input[name='form.buttons.cancel']").css("display", "none");
|
||||
jq(".reply").find("input[name='form.buttons.cancel']").css("display", "none");
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
@@ -14,13 +14,13 @@ jq(document).ready(function() {
|
||||
* the comment.
|
||||
*****************************************************************/
|
||||
var post_comment_div = jq("#commenting");
|
||||
var in_reply_to_field = post_comment_div.find("input[name='form.widgets.in_reply_to']");
|
||||
if (in_reply_to_field.val() != "") {
|
||||
var current_reply_id = "#" + in_reply_to_field.val();
|
||||
var current_reply_to_div = jq(".discussion").find(current_reply_id);
|
||||
var in_reply_to_field = post_comment_div.find("input[name='form.widgets.in_reply_to']");
|
||||
if (in_reply_to_field.val() != "") {
|
||||
var current_reply_id = "#" + in_reply_to_field.val();
|
||||
var current_reply_to_div = jq(".discussion").find(current_reply_id);
|
||||
createReplyForm(current_reply_to_div);
|
||||
clearForm(post_comment_div);
|
||||
}
|
||||
clearForm(post_comment_div);
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Remove the z3c.form error messages and all input values from a
|
||||
@@ -28,10 +28,10 @@ jq(document).ready(function() {
|
||||
*****************************************************************/
|
||||
function clearForm(form_div) {
|
||||
form_div.find(".error").removeClass("error");
|
||||
form_div.find(".fieldErrorBox").remove();
|
||||
form_div.find(".fieldErrorBox").remove();
|
||||
form_div.find("input[type='text']").attr("value", "")
|
||||
form_div.find("textarea").attr("value", "")
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Create a reply-to-comment form right under the comment_div.
|
||||
@@ -50,7 +50,7 @@ jq(document).ready(function() {
|
||||
/* 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();
|
||||
reply_div.find("#formfield-form-widgets-captcha").find("script").remove();
|
||||
|
||||
/* Insert the cloned comment form right after the reply button of the
|
||||
* current comment.
|
||||
@@ -84,7 +84,7 @@ jq(document).ready(function() {
|
||||
|
||||
/* Show the cancel button in the reply-to-comment form */
|
||||
cancel_reply_button.css("display", "inline");
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************
|
||||
* Show the reply button only when Javascript is enabled.
|
||||
@@ -94,12 +94,12 @@ jq(document).ready(function() {
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
* Create reply to comment form.
|
||||
* Create reply to comment form.
|
||||
*****************************************************************/
|
||||
jq(".reply-to-comment-button").bind("click", function(e){
|
||||
jq(".reply-to-comment-button").bind("click", function(e){
|
||||
var comment_div = jq(this).parents().filter(".comment");
|
||||
createReplyForm(comment_div);
|
||||
clearForm(comment_div);
|
||||
createReplyForm(comment_div);
|
||||
clearForm(comment_div);
|
||||
});
|
||||
|
||||
/*****************************************************************
|
||||
@@ -123,12 +123,12 @@ jq(document).ready(function() {
|
||||
*****************************************************************/
|
||||
/*
|
||||
jq("input[name='form.button.DeleteComment']").click(function(e){
|
||||
e.preventDefault();
|
||||
var form = jq(this).parent();
|
||||
e.preventDefault();
|
||||
var form = jq(this).parent();
|
||||
var target = jq(form).attr("action");
|
||||
var comment = jq(form).parent();
|
||||
var reply_comments = jq(comment).find("~ .comment:not(.replyTreeLevel0 ~ div)");
|
||||
reply_comments.css("background", "red");
|
||||
var comment = jq(form).parent();
|
||||
var reply_comments = jq(comment).find("~ .comment:not(.replyTreeLevel0 ~ div)");
|
||||
reply_comments.css("background", "red");
|
||||
jq.ajax({
|
||||
type: "GET",
|
||||
url: target,
|
||||
@@ -151,7 +151,7 @@ jq(document).ready(function() {
|
||||
/*
|
||||
jq("input[name='form.button.PublishComment']").click(function(e){
|
||||
e.preventDefault();
|
||||
var button = jq(this);
|
||||
var button = jq(this);
|
||||
var form = jq(this).parent();
|
||||
var target = jq(form).attr("action");
|
||||
var comment = jq(form).parent()
|
||||
|
||||
@@ -28,7 +28,7 @@ jq(document).ready(function() {
|
||||
var row = jq(this).parent().parent();
|
||||
var form = jq(row).parents("form");
|
||||
var path = jq(row).find("input:checkbox").attr("value");
|
||||
var target = path + "/@@moderate-delete-comment";
|
||||
var target = path + "/@@moderate-delete-comment";
|
||||
var comment_id = jq(this).attr("id");
|
||||
jq.ajax({
|
||||
type: "GET",
|
||||
@@ -39,7 +39,7 @@ jq(document).ready(function() {
|
||||
jq(this).remove();
|
||||
});
|
||||
},
|
||||
error: function(msg){
|
||||
error: function(msg){
|
||||
alert("Error sending AJAX request:" + target);
|
||||
}
|
||||
});
|
||||
@@ -58,7 +58,7 @@ jq(document).ready(function() {
|
||||
jq.ajax({
|
||||
type: "GET",
|
||||
url: target,
|
||||
data: "workflow_action=publish",
|
||||
data: "workflow_action=publish",
|
||||
success: function(msg){
|
||||
// fade out row
|
||||
jq(row).fadeOut("normal", function(){
|
||||
@@ -83,10 +83,10 @@ jq(document).ready(function() {
|
||||
var valArray = jq('input:checkbox:checked');
|
||||
var selectField = jq(form).find("[name='form.select.BulkAction']");
|
||||
if (selectField.val() == '-1') {
|
||||
// XXX: translate message
|
||||
// XXX: translate message
|
||||
alert("You haven't selected a bulk action. Please select one.");
|
||||
} else if (valArray.length == 0) {
|
||||
// XXX: translate message
|
||||
// XXX: translate message
|
||||
alert("You haven't selected any comment for this bulk action. Please select at least one comment.");
|
||||
} else {
|
||||
jq.post(target, params, function(data) {
|
||||
|
||||
Reference in New Issue
Block a user