From 538d6d28a99673afde9f8f7c5ada1430b41d773b Mon Sep 17 00:00:00 2001 From: Hamcha Date: Mon, 29 Jun 2020 00:24:38 +0200 Subject: [PATCH] add symptoms to virology search --- src/scripts/pages/virology.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/scripts/pages/virology.ts b/src/scripts/pages/virology.ts index 7281f89..215f789 100644 --- a/src/scripts/pages/virology.ts +++ b/src/scripts/pages/virology.ts @@ -70,11 +70,25 @@ export function processVirology(root: HTMLElement): void { export function virologyScript(root: HTMLElement): void { // Init fuzzy search with elements - const el = Array.from( + const diseases = Array.from( root.querySelectorAll(".disease-ext tr:not(:first-child)") ); 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( + ".symptoms-ext > tbody > tr:not(:first-child)" + ) + ); + registerSearchEntries( + symptoms.map((element, id) => ({ page: "Infections", name: element.querySelector(".disease-name").textContent.trim(), element,