Removed lingering v2 recaptcha codes

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

View File

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

View File

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