Add Mistyped Captcha Errors option
This commit is contained in:
parent
68678e671a
commit
61813b28d7
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -293,6 +293,10 @@ Config =
|
||||
true
|
||||
'Show notifications on successful post creation or file uploading.'
|
||||
]
|
||||
'Mistyped Captcha Errors': [
|
||||
true
|
||||
'When disabled, shows a red border on the CAPTCHA input until a key is pressed instead of a notification.'
|
||||
]
|
||||
|
||||
'Quote Links':
|
||||
'Quote Backlinks': [
|
||||
|
||||
@ -738,6 +738,9 @@ input.field.tripped:not(:hover):not(:focus) {
|
||||
width: 100%;
|
||||
margin: 1px 0 0;
|
||||
}
|
||||
.captcha-input.error:focus {
|
||||
border-color: rgb(255,0,0) !important;
|
||||
}
|
||||
.field {
|
||||
-moz-box-sizing: border-box;
|
||||
margin: 0px;
|
||||
|
||||
@ -93,6 +93,8 @@ QR =
|
||||
QR.cleanNotifications()
|
||||
d.activeElement.blur()
|
||||
$.rmClass QR.nodes.el, 'dump'
|
||||
unless Conf['Mistyped Captcha Errors']
|
||||
$.rmClass QR.captcha.nodes.input, 'error'
|
||||
if Conf['QR Shortcut']
|
||||
$.toggleClass $('.qr-shortcut'), 'disabled'
|
||||
for i in QR.posts
|
||||
@ -126,8 +128,19 @@ QR =
|
||||
if QR.captcha.isEnabled and /captcha|verification/i.test el.textContent
|
||||
# Focus the captcha input on captcha error.
|
||||
QR.captcha.nodes.input.focus()
|
||||
if Conf['Mistyped Captcha Errors']
|
||||
QR.notifications.push new Notification 'warning', el
|
||||
else
|
||||
$.addClass QR.captcha.nodes.input, 'error'
|
||||
$.on QR.captcha.nodes.input, 'keydown', ->
|
||||
$.rmClass QR.captcha.nodes.input, 'error'
|
||||
else
|
||||
QR.notifications.push new Notification 'warning', el
|
||||
alert el.textContent if d.hidden
|
||||
QR.notifications.push new Notification 'warning', el
|
||||
|
||||
clearError: ->
|
||||
|
||||
|
||||
notifications: []
|
||||
cleanNotifications: ->
|
||||
for notification in QR.notifications
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user