From 90c8bf1461def76cf9ca02fc64d9674097672489 Mon Sep 17 00:00:00 2001 From: Andros-Spica Date: Tue, 20 Aug 2024 17:27:15 +0000 Subject: [PATCH] deploy: cefbc3245a850676b66401eec3d619032ae04491 --- 0000-NASSA-001-TEMPLATE.html | 4 +-- 1870-Schliemann-001.html | 4 +-- 2021-Angourakis-001.html | 4 +-- 2021-Galan-001.html | 4 +-- 2021-Romanowska-001.html | 4 +-- 2022-Angourakis-001.html | 4 +-- 2022-Brughmans-001.html | 4 +-- 2022-Brughmans-002.html | 4 +-- 2022-DAEMS-001.html | 4 +-- 2022-Romanowska-001.html | 4 +-- 2022-Romanowska-002.html | 4 +-- 2022-Vlach-001.html | 4 +-- index.html | 6 ++-- selectKeyword.js | 66 ++++++++++++++++++++++++++++++++++++ 14 files changed, 93 insertions(+), 27 deletions(-) create mode 100644 selectKeyword.js diff --git a/0000-NASSA-001-TEMPLATE.html b/0000-NASSA-001-TEMPLATE.html index 5b86231..84756c3 100644 --- a/0000-NASSA-001-TEMPLATE.html +++ b/0000-NASSA-001-TEMPLATE.html @@ -427,8 +427,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/1870-Schliemann-001.html b/1870-Schliemann-001.html index ec70455..11f2ee7 100644 --- a/1870-Schliemann-001.html +++ b/1870-Schliemann-001.html @@ -428,8 +428,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2021-Angourakis-001.html b/2021-Angourakis-001.html index d5018c4..6ca62a0 100644 --- a/2021-Angourakis-001.html +++ b/2021-Angourakis-001.html @@ -418,8 +418,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2021-Galan-001.html b/2021-Galan-001.html index 3f422e9..ea9566b 100644 --- a/2021-Galan-001.html +++ b/2021-Galan-001.html @@ -419,8 +419,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2021-Romanowska-001.html b/2021-Romanowska-001.html index cd896e6..4bee5a1 100644 --- a/2021-Romanowska-001.html +++ b/2021-Romanowska-001.html @@ -428,8 +428,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-Angourakis-001.html b/2022-Angourakis-001.html index 8632013..3282314 100644 --- a/2022-Angourakis-001.html +++ b/2022-Angourakis-001.html @@ -422,8 +422,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-Brughmans-001.html b/2022-Brughmans-001.html index 2b97054..ac3cfed 100644 --- a/2022-Brughmans-001.html +++ b/2022-Brughmans-001.html @@ -419,8 +419,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-Brughmans-002.html b/2022-Brughmans-002.html index daff32e..20b83a4 100644 --- a/2022-Brughmans-002.html +++ b/2022-Brughmans-002.html @@ -427,8 +427,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-DAEMS-001.html b/2022-DAEMS-001.html index 2fdae28..c43f42a 100644 --- a/2022-DAEMS-001.html +++ b/2022-DAEMS-001.html @@ -422,8 +422,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-Romanowska-001.html b/2022-Romanowska-001.html index 3b42b9f..5516988 100644 --- a/2022-Romanowska-001.html +++ b/2022-Romanowska-001.html @@ -427,8 +427,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-Romanowska-002.html b/2022-Romanowska-002.html index b45b5e9..3ac2023 100644 --- a/2022-Romanowska-002.html +++ b/2022-Romanowska-002.html @@ -431,8 +431,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/2022-Vlach-001.html b/2022-Vlach-001.html index 0bee39f..d55bea7 100644 --- a/2022-Vlach-001.html +++ b/2022-Vlach-001.html @@ -428,8 +428,8 @@

Click on nodes for details

-
- +
+

References

diff --git a/index.html b/index.html index af6caf4..573db0f 100644 --- a/index.html +++ b/index.html @@ -312,10 +312,10 @@

-
- +
+
- +
diff --git a/selectKeyword.js b/selectKeyword.js new file mode 100644 index 0000000..73f0d5a --- /dev/null +++ b/selectKeyword.js @@ -0,0 +1,66 @@ +$(document).ready(function() { + // Verify the table ID by logging it + //console.log('Table ID:', '#nassa_table_container_table'); + + // DataTable instance using the correct ID + var table = $('#nassa_table_container_table').DataTable(); + + // Check if the table is correctly initialized + //if (table) { + // console.log('DataTable initialized successfully.'); + //} else { + // console.log('Failed to initialize DataTable.'); + //} + + const searchInput = document.querySelector('#nassa_table_container input[type="search"]'); + const keywordColumnIndex = 6; // Assuming "Keywords" is the 7th column (0-indexed) + const event = new Event('input', { bubbles: true }); + + // Add click event listener to each badge + $(document).on('click', '.badge', function() { + var keyword = $(this).data('keyword'); + //console.log('Badge clicked, keyword:', keyword); // Debugging output + + // Apply the search filter with the keyword + if (keyword) { + //table.columns().search(keyword).draw(); + // Select the search input within the nassa_table_container + + + // Check if the search input exists + if (searchInput) { + // Set the value to your desired string + searchInput.value = keyword; + + // Apply a custom search to the "Keywords" column + table.column(keywordColumnIndex).search(function(data, type) { + // Check if the data in the "Keywords" column contains the exact keyword + const regex = new RegExp(`(^|,\\s*)${searchTerm}(,|$)`, 'i'); + return regex.test(data); + }); + + // Trigger the input event to apply the search filter immediately + searchInput.dispatchEvent(event); + + table.draw(); // Redraw the table to apply the custom filter + + //console.log('✔️ Search input value has been set successfully!'); + } else { + //console.error('❗ Search input not found within the specified container.'); + } + + searchInput.value = '' + } + }); + + // Optional: Add a button to reset the search filter + //$('.legend').append(''); + // Reset the search filter when 'Show All' is clicked + $(document).on('click', '#resetFilter', function() { + //console.log('Reset button clicked.'); // Debugging output + searchInput.value = '' + searchInput.dispatchEvent(event); + //table.search('').draw(); + }); + }); + \ No newline at end of file