add symptoms to virology search
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Hamcha 2020-06-29 00:24:38 +02:00
parent 38abc63f6c
commit 538d6d28a9
Signed by: hamcha
GPG key ID: 41467804B19A3315

View file

@ -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<HTMLElement>(".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<HTMLElement>(
".symptoms-ext > tbody > tr:not(:first-child)"
)
);
registerSearchEntries(
symptoms.map((element, id) => ({
page: "Infections",
name: element.querySelector(".disease-name").textContent.trim(),
element,