ctrl alt shift keys filter
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
3f77fbd93d
commit
e83f796413
@ -6,18 +6,28 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
ac = undefined,
|
ac = undefined,
|
||||||
last = undefined
|
last = undefined
|
||||||
document.getElementById('instance').addEventListener('keydown', function (event) {
|
document.getElementById('instance').addEventListener('keydown', function (event) {
|
||||||
if (event.key && ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== ''))) {
|
if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) {
|
||||||
last = event.target.value
|
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
|
||||||
} else if (event.key === 'Backspace' && event.target.value === '') {
|
last = event.target.value
|
||||||
last = ''
|
} else if (event.key === 'Backspace' && event.target.value === '') {
|
||||||
|
last = ''
|
||||||
|
} else {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
document.getElementById('instance').addEventListener('keyup', function (event) {
|
document.getElementById('instance').addEventListener('keyup', function (event) {
|
||||||
if (event.key && ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && last !== ''))) {
|
if (event.key && !event.ctrlKey && !event.altKey && !event.shiftKey) {
|
||||||
keypress(event, event.target.value)
|
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
|
||||||
|
keypress(event, event.target.value)
|
||||||
|
} else {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
|
Loading…
Reference in New Issue
Block a user