Compare commits
No commits in common. "5c401526bb25f86784ddc3c5ae8e2ece436fb0bf" and "7de49d32d34311441789344b823d57f59275d4b7" have entirely different histories.
5c401526bb
...
7de49d32d3
2 changed files with 8 additions and 27 deletions
|
|
@ -43,6 +43,8 @@ const captchaInput = document.querySelectorAll('.captcha-input')
|
||||||
const captchaVerifyButton = document.querySelectorAll('.captcha-verify')
|
const captchaVerifyButton = document.querySelectorAll('.captcha-verify')
|
||||||
|
|
||||||
// Form fields
|
// Form fields
|
||||||
|
const subjectField = document.getElementById('subject')
|
||||||
|
const messageField = document.getElementById('description')
|
||||||
|
|
||||||
const botBadge = document.createElement('div')
|
const botBadge = document.createElement('div')
|
||||||
if (debugEnabled) {
|
if (debugEnabled) {
|
||||||
|
|
@ -115,6 +117,9 @@ function validateZSRNumber(form) {
|
||||||
function checkForBotBehavior() {
|
function checkForBotBehavior() {
|
||||||
let timeSpent = (Date.now() - startTime) / 1000
|
let timeSpent = (Date.now() - startTime) / 1000
|
||||||
botDetected =
|
botDetected =
|
||||||
|
subjectField.value === "I promised." ||
|
||||||
|
// or if messageField Has string "Hi, this is" in it
|
||||||
|
messageField.value.startsWith("Hi, this is") ||
|
||||||
!userInteracted ||
|
!userInteracted ||
|
||||||
interactionCount === 0 ||
|
interactionCount === 0 ||
|
||||||
timeSpent < interactionThreshold ||
|
timeSpent < interactionThreshold ||
|
||||||
|
|
|
||||||
|
|
@ -107,9 +107,9 @@ function handleMouseMove(event) {
|
||||||
function checkForBotBehavior() {
|
function checkForBotBehavior() {
|
||||||
let timeSpent = (Date.now() - startTime) / 1000
|
let timeSpent = (Date.now() - startTime) / 1000
|
||||||
botDetected =
|
botDetected =
|
||||||
subjectField.value === 'I promised.' ||
|
subjectField.value === "I promised." ||
|
||||||
// or if messageField Has string "Hi, this is" in it
|
// or if messageField Has string "Hi, this is" in it
|
||||||
messageField.value.startsWith('Hi, this is') ||
|
messageField.value.startsWith("Hi, this is") ||
|
||||||
!userInteracted ||
|
!userInteracted ||
|
||||||
interactionCount === 0 ||
|
interactionCount === 0 ||
|
||||||
honeypotInput1.value !== '' ||
|
honeypotInput1.value !== '' ||
|
||||||
|
|
@ -146,26 +146,6 @@ function checkForBotBehavior() {
|
||||||
messageField.value
|
messageField.value
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// function logSubmission() {
|
|
||||||
// console.log('in logSubmission()')
|
|
||||||
// const data = { logData: 'Hi, this is some log data from JavaScript.' }
|
|
||||||
// fetch('/php/log.php', {
|
|
||||||
// method: 'POST',
|
|
||||||
// headers: {
|
|
||||||
// 'Content-Type': 'application/json',
|
|
||||||
// },
|
|
||||||
// body: JSON.stringify(data),
|
|
||||||
// })
|
|
||||||
// .then((response) => response.json())
|
|
||||||
// .then((data) => {
|
|
||||||
// console.log('Success:', data)
|
|
||||||
// })
|
|
||||||
// .catch((error) => {
|
|
||||||
// console.error('Error:', error)
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
function handleSubmit(e) {
|
function handleSubmit(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
|
|
||||||
|
|
@ -180,10 +160,6 @@ function handleSubmit(e) {
|
||||||
const formDataEncoded = new URLSearchParams(formData).toString()
|
const formDataEncoded = new URLSearchParams(formData).toString()
|
||||||
const formURL = form.action + '.json'
|
const formURL = form.action + '.json'
|
||||||
|
|
||||||
// logSubmission()
|
|
||||||
// fakeOut()
|
|
||||||
// return false
|
|
||||||
|
|
||||||
fetch(formURL, {
|
fetch(formURL, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue