From 6b4f198c1eabc06d606005e77b743dd730a4ba06 Mon Sep 17 00:00:00 2001 From: Vasyl Khrystiuk Date: Wed, 10 Apr 2024 02:08:47 +0300 Subject: [PATCH] WIP --- assets/links.js | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/assets/links.js b/assets/links.js index a978e9ba..80cd49ef 100644 --- a/assets/links.js +++ b/assets/links.js @@ -25,3 +25,38 @@ function pdf_new_window () } pdf_new_window(); external_new_window(); + + +document.addEventListener("DOMContentLoaded", function(){ + let xPathResult = document.evaluate( + "//td[contains(., 'yes')]", + document, + null, + XPathResult.ANY_TYPE, + null, + ) + + let nodes = []; + let node = xPathResult.iterateNext(); + while (node) { + nodes.push(node); + node = xPathResult.iterateNext(); + } + + nodes.forEach(el => {el.style.backgroundColor = '#baeda6'}) + + xPathResult = document.evaluate( + "//td[contains(., 'no')]", + document, + null, + XPathResult.ANY_TYPE, + null, + ) + nodes = []; + node = xPathResult.iterateNext(); + while (node) { + nodes.push(node); + node = xPathResult.iterateNext(); + } + nodes.forEach(el => {el.style.backgroundColor = '#eda6a6'}) +});