|
|
@ -67,6 +67,8 @@ class CaptchaController { |
|
|
|
const existingImage = captcha.previousSibling.children[0]; |
|
|
|
const existingImage = captcha.previousSibling.children[0]; |
|
|
|
if (existingImage) { |
|
|
|
if (existingImage) { |
|
|
|
captcha.previousSibling.children[0].src = xhr.responseURL; |
|
|
|
captcha.previousSibling.children[0].src = xhr.responseURL; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.loadCaptcha(captcha, xhr.responseURL); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.refreshing = false; |
|
|
|
this.refreshing = false; |
|
|
@ -99,7 +101,7 @@ class CaptchaController { |
|
|
|
this.loadCaptcha(captchaField); |
|
|
|
this.loadCaptcha(captchaField); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadCaptcha(field) { |
|
|
|
loadCaptcha(field, imgSrc = '/captcha') { |
|
|
|
const captchaDiv = field.previousSibling; |
|
|
|
const captchaDiv = field.previousSibling; |
|
|
|
if (captchaDiv.children.length > 0) { |
|
|
|
if (captchaDiv.children.length > 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -116,7 +118,7 @@ class CaptchaController { |
|
|
|
if (captchaType === 'text') { |
|
|
|
if (captchaType === 'text') { |
|
|
|
field.placeholder = 'loading'; |
|
|
|
field.placeholder = 'loading'; |
|
|
|
} |
|
|
|
} |
|
|
|
captchaImg.src = '/captcha'; |
|
|
|
captchaImg.src = imgSrc; |
|
|
|
captchaImg.onload = () => { |
|
|
|
captchaImg.onload = () => { |
|
|
|
if (captchaType === 'text') { |
|
|
|
if (captchaType === 'text') { |
|
|
|
field.placeholder = 'Captcha text'; |
|
|
|
field.placeholder = 'Captcha text'; |
|
|
|