forked from hamcha/tghandbook
add symptoms to virology search
This commit is contained in:
parent
38abc63f6c
commit
538d6d28a9
1 changed files with 16 additions and 2 deletions
|
@ -70,11 +70,25 @@ export function processVirology(root: HTMLElement): void {
|
||||||
|
|
||||||
export function virologyScript(root: HTMLElement): void {
|
export function virologyScript(root: HTMLElement): void {
|
||||||
// Init fuzzy search with elements
|
// Init fuzzy search with elements
|
||||||
const el = Array.from(
|
const diseases = Array.from(
|
||||||
root.querySelectorAll<HTMLElement>(".disease-ext tr:not(:first-child)")
|
root.querySelectorAll<HTMLElement>(".disease-ext tr:not(:first-child)")
|
||||||
);
|
);
|
||||||
registerSearchEntries(
|
registerSearchEntries(
|
||||||
el.map((element, id) => ({
|
diseases.map((element, id) => ({
|
||||||
|
page: "Infections",
|
||||||
|
name: element.querySelector(".disease-name").textContent.trim(),
|
||||||
|
element,
|
||||||
|
alignment: "center",
|
||||||
|
id,
|
||||||
|
}))
|
||||||
|
);
|
||||||
|
const symptoms = Array.from(
|
||||||
|
root.querySelectorAll<HTMLElement>(
|
||||||
|
".symptoms-ext > tbody > tr:not(:first-child)"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
registerSearchEntries(
|
||||||
|
symptoms.map((element, id) => ({
|
||||||
page: "Infections",
|
page: "Infections",
|
||||||
name: element.querySelector(".disease-name").textContent.trim(),
|
name: element.querySelector(".disease-name").textContent.trim(),
|
||||||
element,
|
element,
|
||||||
|
|
Loading…
Reference in a new issue