From 5dc6a9e435f2d1dbc9e289efac002f12a3153d77 Mon Sep 17 00:00:00 2001 From: ashley Date: Sat, 14 Sep 2024 07:20:13 +0000 Subject: [PATCH] remove suggesttions for now ig --- html/partials/search.ejs | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) diff --git a/html/partials/search.ejs b/html/partials/search.ejs index 23e00258..4c8b9e4f 100644 --- a/html/partials/search.ejs +++ b/html/partials/search.ejs @@ -28,36 +28,8 @@ through which recipients can access the Corresponding Source. @licend The above is the entire license notice for the JavaScript code in this page. */ - -// Dismiss when the end-user clicks else where -document.body.addEventListener("click", function (evt) { - document.querySelector('.suggestions').style.opacity = '0' -}); - -// When the end-user starts typing, trigget the fetch function -document.querySelector('input[type="search"]').addEventListener('input', function(e) { - if (e.target.value !== '') { - document.querySelector('.suggestions').style.opacity = '1' - GetResults() - } - else {null} -}); - -// Fetch -function GetResults() { - var SearchValue = document.querySelector('input[type="search"]').value - var YouTubeSuggestions = document.querySelector('.suggestions') - fetch(window.location.origin + `/api/improving-poke/suggestions?q=${SearchValue}`) - .then(response => response.json()) - .then(data => {YouTubeSuggestions.innerHTML = ListOfSuggestionsYT(data)}) -} - -// Create List -function ListOfSuggestionsYT(data) { - const text = data.suggestions.map(data => `${data}`).join("\n") - return `${text}` -} - + +