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,7 +6,8 @@ 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) {
|
||||||
|
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
|
||||||
last = event.target.value
|
last = event.target.value
|
||||||
} else if (event.key === 'Backspace' && event.target.value === '') {
|
} else if (event.key === 'Backspace' && event.target.value === '') {
|
||||||
last = ''
|
last = ''
|
||||||
@ -14,14 +15,23 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
event.preventDefault()
|
||||||
|
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) {
|
||||||
|
if ((event.key.length === 1 && /[a-z0-9.\-*:]/i.test(event.key)) || (event.key === 'Backspace' && event.target.value !== '')) {
|
||||||
keypress(event, event.target.value)
|
keypress(event, event.target.value)
|
||||||
} else {
|
} else {
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
event.preventDefault()
|
||||||
|
event.stopPropagation()
|
||||||
|
}
|
||||||
})
|
})
|
||||||
var modal = document.getElementById('modal'),
|
var modal = document.getElementById('modal'),
|
||||||
closemodal = document.getElementById('closemodal'),
|
closemodal = document.getElementById('closemodal'),
|
||||||
|
Loading…
Reference in New Issue
Block a user