-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into smw-theiameta-panel-dev
- Loading branch information
Showing
55 changed files
with
594 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
cromwell* | ||
_LAST | ||
2024* | ||
2024*site/ | ||
site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function addTableSearch() { | ||
// Select all containers with the class 'searchable-table' | ||
const containers = document.querySelectorAll('.searchable-table'); | ||
|
||
containers.forEach((container) => { | ||
// Find the table within this container | ||
const table = container.querySelector('table'); | ||
|
||
if (table) { | ||
// Ensure we don't add multiple search boxes | ||
if (!container.querySelector('input[type="search"]')) { | ||
// Create the search input element | ||
const searchInput = document.createElement("input"); | ||
searchInput.setAttribute("type", "search"); | ||
searchInput.setAttribute("placeholder", "Search table..."); | ||
searchInput.classList.add('table-search-input'); | ||
searchInput.style.marginBottom = "10px"; | ||
searchInput.style.display = "block"; | ||
|
||
// Insert the search input before the table | ||
container.insertBefore(searchInput, container.firstChild); | ||
|
||
// Add event listener for table search | ||
searchInput.addEventListener("input", function () { | ||
const filter = searchInput.value.toUpperCase(); | ||
const rows = table.getElementsByTagName("tr"); | ||
|
||
for (let i = 1; i < rows.length; i++) { // Skip header row | ||
const cells = rows[i].getElementsByTagName("td"); | ||
let match = false; | ||
|
||
for (let j = 0; j < cells.length; j++) { | ||
if (cells[j].innerText.toUpperCase().includes(filter)) { | ||
match = true; | ||
break; | ||
} | ||
} | ||
|
||
rows[i].style.display = match ? "" : "none"; | ||
} | ||
}); | ||
} | ||
} else { | ||
console.log('Table not found within container.'); | ||
} | ||
}); | ||
} | ||
|
||
// Run on page load | ||
addTableSearch(); | ||
|
||
// Reapply search bar on page change | ||
function observeDOMChanges() { | ||
const targetNode = document.querySelector('body'); | ||
const config = { childList: true, subtree: true }; | ||
|
||
const observer = new MutationObserver(() => { | ||
addTableSearch(); | ||
}); | ||
|
||
observer.observe(targetNode, config); | ||
} | ||
|
||
observeDOMChanges(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.