Compare commits

..

2 Commits

Author SHA1 Message Date
67d06cd887 resolves #23 website filter 2023-05-31 22:16:14 +02:00
cbb012a659 alt and label 2023-05-31 22:16:01 +02:00
2 changed files with 28 additions and 2 deletions

View File

@ -10,12 +10,12 @@
<wrapper> <wrapper>
<topbar> <topbar>
<titlebox> <titlebox>
<img src="media/blahaj.png"> <img alt="website image is Blahaj" src="media/blahaj.png">
<span>Tranga</span> <span>Tranga</span>
</titlebox> </titlebox>
<spacer></spacer> <spacer></spacer>
<searchdiv> <searchdiv>
<input id="searchbox" placeholder="Filter" type="text"> <label for="searchbox"></label><input id="searchbox" placeholder="Filter" type="text">
</searchdiv> </searchdiv>
<img id="settingscog" src="media/settings-cogwheel.svg" height="100%" alt="settingscog"> <img id="settingscog" src="media/settings-cogwheel.svg" height="100%" alt="settingscog">
</topbar> </topbar>

View File

@ -2,6 +2,7 @@
let tasks = []; let tasks = [];
let toEditId; let toEditId;
const searchBox = document.querySelector("#searchbox");
const searchPublicationQuery = document.querySelector("#searchPublicationQuery"); const searchPublicationQuery = document.querySelector("#searchPublicationQuery");
const selectPublication = document.querySelector("#taskSelectOutput"); const selectPublication = document.querySelector("#taskSelectOutput");
const connectorSelect = document.querySelector("#connectors"); const connectorSelect = document.querySelector("#connectors");
@ -34,6 +35,7 @@ const tagTasksTotal = document.querySelector("#totalTasksTag");
const tagTaskPopup = document.querySelector("footer-tag-popup"); const tagTaskPopup = document.querySelector("footer-tag-popup");
const tagTasksPopupContent = document.querySelector("footer-tag-content"); const tagTasksPopupContent = document.querySelector("footer-tag-content");
searchbox.addEventListener("keyup", (event) => FilterResults());
settingsCog.addEventListener("click", () => OpenSettings()); settingsCog.addEventListener("click", () => OpenSettings());
document.querySelector("#blurBackgroundSettingsPopup").addEventListener("click", () => HideSettings()); document.querySelector("#blurBackgroundSettingsPopup").addEventListener("click", () => HideSettings());
closetaskpopup.addEventListener("click", () => HideAddTaskPopup()); closetaskpopup.addEventListener("click", () => HideAddTaskPopup());
@ -331,6 +333,30 @@ function CloseTasksPopup(){
tagTaskPopup.style.display = "none"; tagTaskPopup.style.display = "none";
} }
function FilterResults(){
if(searchBox.value.length > 0){
tasksContent.childNodes.forEach(publication => {
publication.childNodes.forEach(item => {
if(item.nodeName.toLowerCase() == "publication-information"){
item.childNodes.forEach(information => {
if(information.nodeName.toLowerCase() == "publication-name"){
if(!information.textContent.toLowerCase().includes(searchBox.value.toLowerCase())){
publication.style.display = "none";
}else{
publication.style.display = "initial";
}
}
});
}
});
});
}else{
tasksContent.childNodes.forEach(publication => publication.style.display = "initial");
}
}
//Resets the tasks shown //Resets the tasks shown
ResetContent(); ResetContent();
//Get Tasks and show them //Get Tasks and show them