Commit c98d1cbb authored by Traboulsi's avatar Traboulsi
Browse files

Update public/js/paperfilter.js

parent 0031932d
Pipeline #8733 passed with stage
in 10 seconds
......@@ -3,6 +3,7 @@ var state2021 = 0
var state2022 = 0
var state2023 = 0
var state2019 = 0
var stateall= 0
var state = 0
var count = 0
function filter(year){
......@@ -10,7 +11,10 @@ function filter(year){
new_row.innerHTML = "";
document.getElementById("nextblock").style.display = "none"
if (year == "2020") {
if (year == "All") {
state = stateall
} else if (year == "2020") {
state = state2020
} else if (year == "2021"){
state = state2021
......@@ -24,6 +28,7 @@ function filter(year){
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()
......@@ -109,7 +114,6 @@ function filter(year){
document.getElementById("filter2019").style.backgroundColor = "lightgrey"
document.getElementById("filter2020").style.backgroundColor = "lightgrey"
document.getElementById("filter2022").style.backgroundColor = "lightgrey"
document.getElementById("filter2023").style.backgroundColor = "lightgrey"
document.getElementById("filter2022").innerHTML = "2022"
document.getElementById("filter2019").innerHTML = "2019"
document.getElementById("filter2023").innerHTML = "2023 (" + count +")"
......@@ -139,7 +143,30 @@ function filter(year){
document.getElementById("filter2020").innerHTML = "2020"
document.getElementById("filter2022").innerHTML = "2022 (" + count +")"
count = 0
}
}/*else if (year == "All"){
for (var j = 0; j < jsonContent.length; j++) {
addpaper(jsonContent[j]);
}
state = 1
//Do something
}
document.getElementById("filterall").style.backgroundColor = "grey"
document.getElementById("filter2019").style.backgroundColor = "lightgrey"
document.getElementById("filter2021").style.backgroundColor = "lightgrey"
document.getElementById("filter2020").style.backgroundColor = "lightgrey"
document.getElementById("filter2023").style.backgroundColor = "lightgrey"
document.getElementById("filter2022").style.backgroundColor = "grey"
document.getElementById("filter2019").innerHTML = "2019"
document.getElementById("filter2021").innerHTML = "2021"
document.getElementById("filter2023").innerHTML = "2023"
document.getElementById("filter2020").innerHTML = "2020"
document.getElementById("filterall").innerHTML = "All (" + count +")"
count = 0
}*/
if (year == "2020") {
state2020 = 1
state2021 = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment