Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
f6f9aeab
Commit
f6f9aeab
authored
Oct 01, 2021
by
Dominik Hebeler
Browse files
fixed regexp method
parent
50279b60
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
resources/views/admin/spam.blade.php
View file @
f6f9aeab
...
@@ -148,7 +148,7 @@
...
@@ -148,7 +148,7 @@
newElement
.
classList
.
add
(
"query"
);
newElement
.
classList
.
add
(
"query"
);
newElement
.
classList
.
add
(
"card"
);
newElement
.
classList
.
add
(
"card"
);
newElement
.
innerHTML
=
el
;
newElement
.
innerHTML
=
el
;
document
.
getElementById
(
"queries"
)
.
appendC
H
ild
(
newElement
);
document
.
getElementById
(
"queries"
)
.
appendC
h
ild
(
newElement
);
});
});
lastUpdate
=
Date
.
now
();
lastUpdate
=
Date
.
now
();
checkRegexp
();
checkRegexp
();
...
@@ -158,14 +158,16 @@
...
@@ -158,14 +158,16 @@
function
checkRegexp
()
{
function
checkRegexp
()
{
var
val
=
$
(
"
#
regexp"
)
.
val
()
;
var
val
=
document
.
getElementById
(
"regexp"
)
.
val
ue
;
var
queries
=
[];
var
queries
=
[];
$
(
"#queries > .query"
)
.
each
(
function
(
index
,
el
)
{
document
.
querySelectorAll
(
"#queries > .query"
)
.
forEach
((
el
,
index
)
=>
{
queries
.
push
(
$
(
el
)
.
html
()
);
queries
.
push
(
el
.
innerHTML
);
});
});
queries
.
push
(
$
(
"#check-against"
)
.
val
());
queries
.
push
(
document
.
getElementById
(
"check-against"
)
.
value
)
var
url
=
"{{ url('admin/spam/queryregexp') }}"
;
var
url
=
"{{ url('admin/spam/queryregexp') }}"
;
var
options
=
{
var
options
=
{
...
@@ -182,17 +184,18 @@
...
@@ -182,17 +184,18 @@
fetch
(
url
,
options
)
fetch
(
url
,
options
)
.
then
(
response
=>
response
.
json
())
.
then
(
response
=>
response
.
json
())
.
then
(
data
=>
{
.
then
(
data
=>
{
$
(
"#queries > .query"
)
.
each
(
function
(
index
,
el
)
{
document
.
querySelectorAll
(
"#queries > .query"
)
.
forEach
((
el
,
index
)
=>
{
if
(
data
[
index
][
"matches"
]){
if
(
data
[
index
][
"matches"
]){
$
(
el
)
.
addClass
(
"matches"
);
el
.
classList
.
add
(
"matches"
);
}
else
{
}
else
{
$
(
el
)
.
remove
Class
(
"matches"
);
elclassList
.
remove
(
"matches"
);
}
}
});
});
if
(
data
[
data
.
length
-
1
][
"matches"
]){
if
(
data
[
data
.
length
-
1
][
"matches"
]){
$
(
"
#
check-against"
)
.
addClass
(
"matches"
);
document
.
getElementById
(
"check-against"
)
.
classList
.
add
(
"matches"
);
}
else
{
}
else
{
$
(
"
#
check-against"
)
.
remove
Class
(
"matches"
);
document
.
getElementById
(
"check-against"
)
.
classList
.
remove
(
"matches"
);
}
}
});
});
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment