From 9ccf28e254d239f798402701a7b366f7fcfd7dbf Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sun, 3 Oct 2010 19:28:38 +0000 Subject: [PATCH] MINOR Fixed indentation in PageCommentInterface.js git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.4@111497 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/PageCommentInterface.js | 89 +++++++++++++++--------------- 1 file changed, 44 insertions(+), 45 deletions(-) diff --git a/javascript/PageCommentInterface.js b/javascript/PageCommentInterface.js index 84248efa..534c8b34 100755 --- a/javascript/PageCommentInterface.js +++ b/javascript/PageCommentInterface.js @@ -62,40 +62,39 @@ PageCommentInterface.prototype = { Ajax.SubmitForm(form, "action_postcomment", { onSuccess : function(response) { - // Create an Ajax request to regenerate the spam protection question - //need to check if there is actually a spam question to change first - if(form.elements.Math){ - new Ajax.Request(document.getElementsByTagName('base')[0].href+'PageCommentInterface_Controller/newspamquestion', { - onSuccess: loadSpamQuestion, - onFailure: Ajax.Evaluator - }); - } - - if(response.responseText != "spamprotectionfailed"){ - __newComment.className ="even"; - // Load the response into the new
  • - __newComment.innerHTML = response.responseText; - Behaviour.apply(__newComment); - - // Flash it using Scriptaculous - new Effect.Highlight(__newComment, { endcolor: '#e9e9e9' } ); - if(response.responseText.match('Spam detected!!')) { - __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); + // Create an Ajax request to regenerate the spam protection question + //need to check if there is actually a spam question to change first + if(form.elements.Math){ + new Ajax.Request(document.getElementsByTagName('base')[0].href+'PageCommentInterface_Controller/newspamquestion', { + onSuccess: loadSpamQuestion, + onFailure: Ajax.Evaluator + }); } + + if(response.responseText != "spamprotectionfailed"){ + __newComment.className ="even"; + // Load the response into the new
  • + __newComment.innerHTML = response.responseText; + Behaviour.apply(__newComment); + + // Flash it using Scriptaculous + new Effect.Highlight(__newComment, { endcolor: '#e9e9e9' } ); + if(response.responseText.match('Spam detected!!')) { + __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 { message.style.display = ''; @@ -115,20 +114,20 @@ PageCommentInterface.prototype = { new Ajax.Request(this.href + '?ajax=1', { onSuccess : function(response) { - // Clear our wee status message - __comment.getElementsByTagName('span')[0].innerHTML = "Removing..."; + // Clear our wee status message + __comment.getElementsByTagName('span')[0].innerHTML = "Removing..."; - // Remove it using Scriptaculous - new Effect.Highlight(__comment, { - startcolor: '#cc9999' , endcolor: '#e9e9e9', duration: 0.5, - afterFinish : function () { - var commentList = __comment.parentNode; - commentList.removeChild(__comment); - if(!commentList.firstChild) { - $('CommentHolder').innerHTML = "

    No one has commented on this page yet.

    "; - } + // Remove it using Scriptaculous + new Effect.Highlight(__comment, { + startcolor: '#cc9999' , endcolor: '#e9e9e9', duration: 0.5, + afterFinish : function () { + var commentList = __comment.parentNode; + commentList.removeChild(__comment); + if(!commentList.firstChild) { + $('CommentHolder').innerHTML = "

    No one has commented on this page yet.

    "; } - } ); + } + } ); }, onFailure : function(response) {