Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
UGL
website
Commits
14517ce9
Commit
14517ce9
authored
3 years ago
by
Patrick
Browse files
Options
Download
Email Patches
Plain Diff
update paper search
parent
b943b7f7
Pipeline
#4437
passed with stage
in 23 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/js/search.js
+12
-2
public/js/search.js
with
12 additions
and
2 deletions
+12
-2
public/js/search.js
+
12
-
2
View file @
14517ce9
...
...
@@ -34,14 +34,18 @@ function search() {
}
function
search_paper
()
{
const
fuse
=
new
Fuse
(
stuff_paper
,
options_paper
);
const
fuse
=
new
Fuse
(
jsonContent
,
options_paper
);
//stuff_paper
searchanswer_paper
=
fuse
.
search
(
document
.
getElementById
(
"
search-input_paper
"
).
value
)
document
.
getElementById
(
"
nextblock
"
).
style
.
display
=
"
none
"
;
var
new_row
=
document
.
getElementById
(
"
cont_paper
"
)
new_row
.
innerHTML
=
""
;
var
searchLength
=
searchanswer_paper
.
length
;
for
(
var
i
=
0
;
i
<
searchLength
;
i
++
)
{
addpaper
(
searchanswer_paper
[
i
].
item
);
console
.
log
(
searchanswer_paper
[
i
])
if
(
searchanswer_paper
[
i
].
score
<
0.5
){
addpaper
(
searchanswer_paper
[
i
].
item
);
}
//Do something
}
// alert(searchanswer);
...
...
@@ -174,6 +178,7 @@ function searchToggle_paper(obj, evt) {
container
.
addClass
(
'
active
'
);
evt
.
preventDefault
();
console
.
log
(
"
first
"
)
}
else
if
(
container
.
hasClass
(
'
active
'
)
&&
$
(
obj
).
closest
(
'
.input-holder
'
).
length
==
0
)
{
container
.
removeClass
(
'
active
'
);
// clear input
...
...
@@ -189,6 +194,11 @@ function searchToggle_paper(obj, evt) {
//Do something
}
for
(
var
j
=
0
;
j
<
6
;
j
++
)
{
addpaper
(
jsonContent
[
j
]);
//Do something
}
document
.
getElementById
(
"
nextblock
"
).
style
.
display
=
"
block
"
;
container
.
find
(
'
#search-input_paper
'
).
val
(
''
);
}
else
{
console
.
log
(
"
search
"
)
...
...
This diff is collapsed.
Click to expand it.
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