Removed lingering v2 recaptcha codes

This commit is contained in:
斟酌 鵬兄 2024-11-15 09:13:10 +08:00
parent b014148c31
commit f6bc3d3629
2 changed files with 16 additions and 47 deletions

View File

@ -257,17 +257,6 @@
.info_field .website span { width: 20%; } .info_field .website span { width: 20%; }
.info_field .website input { width: 80%; } .info_field .website input { width: 80%; }
#capcha_wrapper {
overflow: hidden;
height: 0;
}
#recaptcha_field {
float: right;
background: white;
}
iframe[src="about:blank"] { iframe[src="about:blank"] {
/* recaptcha about:blank page */ /* recaptcha about:blank page */
display: none; display: none;
@ -287,6 +276,10 @@ iframe[src="about:blank"] {
transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000); /* easeInOutQuart */ transition-timing-function: cubic-bezier(0.770, 0.000, 0.175, 1.000); /* easeInOutQuart */
} }
#c_input_panel.reply {
max-width: 80%;
}
.c_so_sorry { .c_so_sorry {
padding: 0.2em; padding: 0.2em;
font-size: 0.8em; font-size: 0.8em;

View File

@ -70,7 +70,6 @@
, nameHaveText = false , nameHaveText = false
, fieldReady = false , fieldReady = false
, releaseReplyLock , releaseReplyLock
, captcha_wrapper
, submit_button , submit_button
, cBubble , cBubble
, button , button
@ -99,6 +98,8 @@
, nameHadHaveText = false , nameHadHaveText = false
, nameInput = function () , nameInput = function ()
{ {
if( !nameField )
return;
// trim whitespaces // trim whitespaces
nameHaveText = nameField.value.trim(); nameHaveText = nameField.value.trim();
if( nameHadHaveText != nameHaveText ) { if( nameHadHaveText != nameHaveText ) {
@ -133,21 +134,13 @@
// Configure release lock // Configure release lock
button = c_reply; button = c_reply;
var rf = Dand.id( "recaptcha_field" ); hideSubmit();
if( rf && rf.hasChildNodes() ) Cycle.delay( function() {
{ closeInputPanel( function() {
// if capcha opened cp.classList.add( "reply" );
hideSubmit(); reviveInputpanel.bind( c_reply.parentNode.parentNode )();
Cycle.delay( function() { } );
closeInputPanel( reviveInputpanel.bind( c_reply.parentNode.parentNode ) ) }, 500);
}, 500);
}
else
{
Cycle.delay( function() {
closeInputPanel( reviveInputpanel.bind( c_reply.parentNode.parentNode ) )
}, 250);
}
} }
, releaseReplyButton = function () , releaseReplyButton = function ()
@ -164,8 +157,6 @@
, fieldReadyTrigger = loggedIn , fieldReadyTrigger = loggedIn
? /* Overload */ function () ? /* Overload */ function ()
{ {
// Get wrapper
captcha_wrapper || (captcha_wrapper = Dand.id( "capcha_wrapper", true ));
submit_button || ( submit_button = Dand.id( "c_submit", true ) ); submit_button || ( submit_button = Dand.id( "c_submit", true ) );
if(contentHaveText) if(contentHaveText)
{ {
@ -182,9 +173,7 @@
} }
: /* Overload */ function () : /* Overload */ function ()
{ {
captcha_wrapper || (captcha_wrapper = Dand.id( "capcha_wrapper", true ));
submit_button || ( submit_button = Dand.id( "c_submit", true ) ); submit_button || ( submit_button = Dand.id( "c_submit", true ) );
// Create capcha
if(!fieldReady && contentHaveText && nameHaveText) if(!fieldReady && contentHaveText && nameHaveText)
{ {
// show submit button // show submit button
@ -290,12 +279,12 @@
}); });
// After transition finished, remove input panel // After transition finished, remove input panel
Trigger.height(cp, 0, function() Cycle.delay(function()
{ {
cp.parentNode.removeChild(cp); cp.parentNode.removeChild(cp);
// Pass panel to handler // Pass panel to handler
if(handler) handler(); if(handler) handler();
}); }, 500);
} }
, openInputPanel = function () , openInputPanel = function ()
@ -318,17 +307,13 @@
}, 500); }, 500);
} }
, reviveInputpanel = function () , reviveInputpanel = function ()
{ {
this.appendChild(cp); this.appendChild(cp);
Cycle.next(openInputPanel); Cycle.next(openInputPanel);
} }
// Comments submission and handling // Comments submission and handling
, commentFailed = function (obj) , commentFailed = function (obj)
{ {
// Handle error here to prevent accidental catch by caller // Handle error here to prevent accidental catch by caller
@ -338,14 +323,11 @@
{ {
if(obj.reload) if(obj.reload)
{ {
// reload the recaptcha
Cycle.delay(showSubmit, 1500); Cycle.delay(showSubmit, 1500);
// Wrong answer.
var f = Dand.id("false_capcha");
Cycle.delay( function() Cycle.delay( function()
{ {
this.innerHTML = "Wrong answer, please re-enter."; this.innerHTML = "Recaptcha failure";
this.style.height = "1.2em"; this.style.height = "1.2em";
}.bind(f), 500 ); }.bind(f), 500 );
@ -360,14 +342,11 @@
cBubble.setColor("red"); cBubble.setColor("red");
cBubble.pop("Server error"); cBubble.pop("Server error");
}, 1000); }, 1000);
} }
} }
else else
{ {
// reload the recaptcha
Cycle.delay(showSubmit, 1500); Cycle.delay(showSubmit, 1500);
Cycle.delay(function (){cBubble.blurp();}, 500); Cycle.delay(function (){cBubble.blurp();}, 500);
Cycle.delay(function () Cycle.delay(function ()
{ {
@ -383,9 +362,6 @@
} }
, submitKey = new EventKey("Click", submitComment) , submitKey = new EventKey("Click", submitComment)
// Enter key
, captchaKey = new EventKey("KeyDown", function(e) { if(e.keyCode == 13) submitComment(); })
, showSubmit = function () , showSubmit = function ()
{ {