From b9cb4abd463d11499cbd261e83eec293199fa379 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:09:13 +0000 Subject: [PATCH 1/9] Updated to see if search for sub-title would work --- blocks/header/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 3fc9d38..0903bbc 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,7 +248,7 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item.title.toLowerCase().includes(inputValue); + const it = item.sub-title.toLowerCase().includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results'); From 8c83c8e229ec40a45c1c98ffbb29b2ca51deda67 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:11:20 +0000 Subject: [PATCH 2/9] trying subtitle one word --- blocks/header/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 0903bbc..990e057 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,7 +248,7 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item.sub-title.toLowerCase().includes(inputValue); + const it = item.subtitle.toLowerCase().includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results'); From f49ab3b7acc33c6c759e0190e8b0892b6dadcd56 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:17:02 +0000 Subject: [PATCH 3/9] Checking description --- blocks/header/header.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 990e057..083a157 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,7 +248,8 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item.subtitle.toLowerCase().includes(inputValue); + const it = item.description.toLowerCase().includes(inputValue); + const return it; }); const resultBlock = document.querySelector('.search-results'); From 9f45e037b78743eef1f2ee1a541b5c5a2abcb2dd Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:18:03 +0000 Subject: [PATCH 4/9] Fix lint error --- blocks/header/header.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 083a157..64c2924 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -249,7 +249,6 @@ function handleSearchFormSubmit(formElement) { const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria const it = item.description.toLowerCase().includes(inputValue); - const return it; }); const resultBlock = document.querySelector('.search-results'); From 30a4234a1b9c3b3ae31f5e1800147affd5c4eb6b Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:24:02 +0000 Subject: [PATCH 5/9] Checking title, subtitle and description --- blocks/header/header.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 64c2924..f6ccbd8 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,7 +248,9 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item.description.toLowerCase().includes(inputValue); + const it = item.description.toLowerCase() + + item.title.toLowerCase() + + item.subtitle.toLowerCase().includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results'); From 02b7493b6adb044857e73bc4e14fbc6e14a94dd1 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:27:10 +0000 Subject: [PATCH 6/9] Description and title only --- blocks/header/header.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index f6ccbd8..24328d6 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -249,8 +249,7 @@ function handleSearchFormSubmit(formElement) { const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria const it = item.description.toLowerCase() - + item.title.toLowerCase() - + item.subtitle.toLowerCase().includes(inputValue); + + item.title.toLowerCase().includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results'); From efd61076714d0116050b27ade6c180dc36e06f92 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:29:08 +0000 Subject: [PATCH 7/9] trying sub-title --- blocks/header/header.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 24328d6..0903bbc 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,8 +248,7 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item.description.toLowerCase() - + item.title.toLowerCase().includes(inputValue); + const it = item.sub-title.toLowerCase().includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results'); From deda7420c729c1af3d6e817926751bba34b076ae Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 17:31:59 +0000 Subject: [PATCH 8/9] trying sub-title --- blocks/header/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index 0903bbc..ba4e999 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,7 +248,7 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item.sub-title.toLowerCase().includes(inputValue); + const it = item['sub-title'].toLowerCase().includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results'); From ef8deb66809baf84ed3e1241916493ae58536590 Mon Sep 17 00:00:00 2001 From: Dave Nichols Date: Mon, 26 Feb 2024 18:03:11 +0000 Subject: [PATCH 9/9] checking title, subtitle and desc --- blocks/header/header.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/blocks/header/header.js b/blocks/header/header.js index ba4e999..cea1276 100644 --- a/blocks/header/header.js +++ b/blocks/header/header.js @@ -248,7 +248,9 @@ function handleSearchFormSubmit(formElement) { // Perform a search based on the fetched JSON data const results = jsonData.data.filter((item) => { // Customize this condition to match your search criteria - const it = item['sub-title'].toLowerCase().includes(inputValue); + const it = (item.title.toLowerCase() + + item['sub-title'].toLowerCase() + + item.description.toLowerCase()).includes(inputValue); return it; }); const resultBlock = document.querySelector('.search-results');