Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
UGL
website
Commits
e564a789
Commit
e564a789
authored
May 21, 2022
by
Rushikesh Padsala
Browse files
Added function for filtering publication for 2022
parent
6016a44f
Pipeline
#6454
passed with stage
in 18 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/js/paperfilter.js
View file @
e564a789
var
state2020
=
0
var
state2021
=
0
var
state2019
=
0
var
state
=
0
var
count
=
0
function
filter
(
year
){
var
new_row
=
document
.
getElementById
(
"
cont_paper
"
)
new_row
.
innerHTML
=
""
;
document
.
getElementById
(
"
nextblock
"
).
style
.
display
=
"
none
"
if
(
year
==
"
2020
"
)
{
state
=
state2020
}
else
if
(
year
==
"
2021
"
){
state
=
state2021
}
else
if
(
year
==
"
2019
"
){
state
=
state2019
}
if
(
state
==
0
){
console
.
log
(
"
filter
"
)
// Start loading/adding the paper content to the page here .....
if
(
year
==
"
2020
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2020
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2020
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020 (
"
+
count
+
"
)
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
count
=
0
}
else
if
(
year
==
"
2021
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2021
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2021
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021 (
"
+
count
+
"
)
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
count
=
0
}
else
if
(
year
==
"
2019
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2019
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2019
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019 (
"
+
count
+
"
)
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
count
=
0
}
if
(
year
==
"
2020
"
)
{
state2020
=
1
state2021
=
0
state2019
=
0
}
else
if
(
year
==
"
2021
"
){
state2021
=
1
state2019
=
0
state2020
=
0
}
else
if
(
year
==
"
2019
"
){
state2019
=
1
state2020
=
0
state2021
=
0
}
}
else
if
(
state
==
1
)
{
if
(
year
==
"
2020
"
)
{
state2020
=
0
}
else
if
(
year
==
"
2021
"
){
state2021
=
0
}
else
if
(
year
==
"
2019
"
){
state2019
=
0
}
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
nextblock
"
).
style
.
display
=
"
block
"
for
(
var
j
=
0
;
j
<
6
;
j
++
)
{
addpaper
(
jsonContent
[
j
]);
//Do something
}
state
=
0
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
}
var
state2020
=
0
var
state2021
=
0
var
state2022
=
0
var
state2019
=
0
var
state
=
0
var
count
=
0
function
filter
(
year
){
var
new_row
=
document
.
getElementById
(
"
cont_paper
"
)
new_row
.
innerHTML
=
""
;
document
.
getElementById
(
"
nextblock
"
).
style
.
display
=
"
none
"
if
(
year
==
"
2020
"
)
{
state
=
state2020
}
else
if
(
year
==
"
2021
"
){
state
=
state2021
}
else
if
(
year
==
"
2019
"
){
state
=
state2019
}
else
if
(
year
==
"
2022
"
){
state
=
state2022
}
if
(
state
==
0
){
console
.
log
(
"
filter
"
)
// Start loading/adding the paper content to the page here .....
if
(
year
==
"
2020
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2020
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2020
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
innerHTML
=
"
2022
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020 (
"
+
count
+
"
)
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
count
=
0
}
else
if
(
year
==
"
2021
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2021
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2021
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
innerHTML
=
"
2022
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021 (
"
+
count
+
"
)
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
count
=
0
}
else
if
(
year
==
"
2019
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2019
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2019
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
innerHTML
=
"
2022
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019 (
"
+
count
+
"
)
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
count
=
0
}
else
if
(
year
==
"
2022
"
){
for
(
var
j
=
0
;
j
<
jsonContent
.
length
;
j
++
)
{
var
filterString
=
jsonContent
[
j
].
item
.
conference
.
date
.
toString
()
if
(
filterString
.
includes
(
'
2022
'
)
||
jsonContent
[
j
].
item
.
journal
.
year
==
2022
)
{
addpaper
(
jsonContent
[
j
]);
count
+=
1
}
state
=
1
//Do something
}
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
style
.
backgroundColor
=
"
grey
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
document
.
getElementById
(
"
filter2022
"
).
innerHTML
=
"
2022 (
"
+
count
+
"
)
"
count
=
0
}
if
(
year
==
"
2020
"
)
{
state2020
=
1
state2021
=
0
state2019
=
0
state2022
=
0
}
else
if
(
year
==
"
2021
"
){
state2021
=
1
state2019
=
0
state2020
=
0
state2022
=
0
}
else
if
(
year
==
"
2019
"
){
state2019
=
1
state2020
=
0
state2021
=
0
state2022
=
0
}
else
if
(
year
==
"
2022
"
){
state2019
=
0
state2020
=
0
state2021
=
0
state2022
=
1
}
}
else
if
(
state
==
1
)
{
if
(
year
==
"
2020
"
)
{
state2020
=
0
}
else
if
(
year
==
"
2021
"
){
state2021
=
0
}
else
if
(
year
==
"
2019
"
){
state2019
=
0
}
else
if
(
year
==
"
2022
"
){
state2022
=
0
}
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
nextblock
"
).
style
.
display
=
"
block
"
for
(
var
j
=
0
;
j
<
6
;
j
++
)
{
addpaper
(
jsonContent
[
j
]);
//Do something
}
state
=
0
document
.
getElementById
(
"
filter2019
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2021
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2020
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2022
"
).
style
.
backgroundColor
=
"
lightgrey
"
document
.
getElementById
(
"
filter2019
"
).
innerHTML
=
"
2019
"
document
.
getElementById
(
"
filter2021
"
).
innerHTML
=
"
2021
"
document
.
getElementById
(
"
filter2020
"
).
innerHTML
=
"
2020
"
document
.
getElementById
(
"
filter2022
"
).
innerHTML
=
"
2022
"
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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