mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 09:05:53 +00:00
MINOR Fixed indentation in PageCommentInterface.js (from r111497)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112805 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
81d4abf9d3
commit
7a53a14bc8
@ -66,40 +66,39 @@ PageCommentInterface.prototype = {
|
|||||||
Ajax.SubmitForm(form, "action_postcomment", {
|
Ajax.SubmitForm(form, "action_postcomment", {
|
||||||
onSuccess : function(response) {
|
onSuccess : function(response) {
|
||||||
|
|
||||||
// Create an Ajax request to regenerate the spam protection question
|
// Create an Ajax request to regenerate the spam protection question
|
||||||
//need to check if there is actually a spam question to change first
|
//need to check if there is actually a spam question to change first
|
||||||
if(form.elements.Math){
|
if(form.elements.Math){
|
||||||
new Ajax.Request(document.getElementsByTagName('base')[0].href+'PageCommentInterface_Controller/newspamquestion', {
|
new Ajax.Request(document.getElementsByTagName('base')[0].href+'PageCommentInterface_Controller/newspamquestion', {
|
||||||
onSuccess: loadSpamQuestion,
|
onSuccess: loadSpamQuestion,
|
||||||
onFailure: Ajax.Evaluator
|
onFailure: Ajax.Evaluator
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
if(response.responseText != "spamprotectionfailed"){
|
|
||||||
__newComment.className ="even";
|
|
||||||
// Load the response into the new <li>
|
|
||||||
__newComment.innerHTML = response.responseText;
|
|
||||||
Behaviour.apply(__newComment);
|
|
||||||
|
|
||||||
// Flash it using Scriptaculous
|
|
||||||
new Effect.Highlight(__newComment, { endcolor: '#e9e9e9' } );
|
|
||||||
if(response.responseText.match('<b>Spam detected!!</b>')) {
|
|
||||||
__newComment.className = 'spam';
|
|
||||||
}
|
|
||||||
|
|
||||||
}else{
|
|
||||||
__newComment.innerHTML = "";
|
|
||||||
Behaviour.apply(__newComment);
|
|
||||||
message.style.display = '';
|
|
||||||
message.innerHTML = "You got the spam question wrong.";
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
onFailure : function(response) {
|
|
||||||
alert(response.responseText);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(response.responseText != "spamprotectionfailed"){
|
||||||
|
__newComment.className ="even";
|
||||||
|
// Load the response into the new <li>
|
||||||
|
__newComment.innerHTML = response.responseText;
|
||||||
|
Behaviour.apply(__newComment);
|
||||||
|
|
||||||
|
// Flash it using Scriptaculous
|
||||||
|
new Effect.Highlight(__newComment, { endcolor: '#e9e9e9' } );
|
||||||
|
if(response.responseText.match('<b>Spam detected!!</b>')) {
|
||||||
|
__newComment.className = 'spam';
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
__newComment.innerHTML = "";
|
||||||
|
Behaviour.apply(__newComment);
|
||||||
|
message.style.display = '';
|
||||||
|
message.innerHTML = "You got the spam question wrong.";
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
onFailure : function(response) {
|
||||||
|
alert(response.responseText);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
message.style.display = '';
|
message.style.display = '';
|
||||||
@ -119,20 +118,20 @@ PageCommentInterface.prototype = {
|
|||||||
|
|
||||||
new Ajax.Request(this.href + '?ajax=1', {
|
new Ajax.Request(this.href + '?ajax=1', {
|
||||||
onSuccess : function(response) {
|
onSuccess : function(response) {
|
||||||
// Clear our wee status message
|
// Clear our wee status message
|
||||||
__comment.getElementsByTagName('span')[0].innerHTML = "Removing...";
|
__comment.getElementsByTagName('span')[0].innerHTML = "Removing...";
|
||||||
|
|
||||||
// Remove it using Scriptaculous
|
// Remove it using Scriptaculous
|
||||||
new Effect.Highlight(__comment, {
|
new Effect.Highlight(__comment, {
|
||||||
startcolor: '#cc9999' , endcolor: '#e9e9e9', duration: 0.5,
|
startcolor: '#cc9999' , endcolor: '#e9e9e9', duration: 0.5,
|
||||||
afterFinish : function () {
|
afterFinish : function () {
|
||||||
var commentList = __comment.parentNode;
|
var commentList = __comment.parentNode;
|
||||||
commentList.removeChild(__comment);
|
commentList.removeChild(__comment);
|
||||||
if(!commentList.firstChild) {
|
if(!commentList.firstChild) {
|
||||||
$('CommentHolder').innerHTML = "<p id=\"NoComments\">No one has commented on this page yet.</p>";
|
$('CommentHolder').innerHTML = "<p id=\"NoComments\">No one has commented on this page yet.</p>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} );
|
}
|
||||||
|
} );
|
||||||
},
|
},
|
||||||
|
|
||||||
onFailure : function(response) {
|
onFailure : function(response) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user