mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Hoist sanatise declaration
Function should be declared before trhe functions that use it, not after
This commit is contained in:
parent
6437f4fbd5
commit
1217f93c05
@ -144,6 +144,10 @@
|
|||||||
let typeInterval = 500;
|
let typeInterval = 500;
|
||||||
let searchInput = document.getElementById('searchbox');
|
let searchInput = document.getElementById('searchbox');
|
||||||
|
|
||||||
|
function sanitize(string) {
|
||||||
|
return string.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '');
|
||||||
|
}
|
||||||
|
|
||||||
searchInput.addEventListener('keyup', (e) => {
|
searchInput.addEventListener('keyup', (e) => {
|
||||||
clearTimeout(typingTimer);
|
clearTimeout(typingTimer);
|
||||||
typingTimer = setTimeout(liveSearch, typeInterval);
|
typingTimer = setTimeout(liveSearch, typeInterval);
|
||||||
@ -181,10 +185,6 @@
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
function sanitize(string) {
|
|
||||||
return string.replace(/[`~!@#$%^&*()_|+\-=?;:'",.<>\{\}\[\]\\\/]/gi, '');
|
|
||||||
}
|
|
||||||
|
|
||||||
function deleteItem(item) {
|
function deleteItem(item) {
|
||||||
let safe_item = sanitize(item);
|
let safe_item = sanitize(item);
|
||||||
words.splice(words.indexOf(item), 1);
|
words.splice(words.indexOf(item), 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user