From 95becf369822cbb74f4cefb5658f3ff97e164d6e Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Tue, 12 Mar 2024 14:22:41 +0530 Subject: Using jquery for injected codes to maintain consistency. --- src/scripts/functionality/application-receipt.ts | 35 ++++++++++++------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'src/scripts/functionality/application-receipt.ts') diff --git a/src/scripts/functionality/application-receipt.ts b/src/scripts/functionality/application-receipt.ts index 878b910..704d865 100644 --- a/src/scripts/functionality/application-receipt.ts +++ b/src/scripts/functionality/application-receipt.ts @@ -1,21 +1,20 @@ -const receiptFormElement = document.getElementById("form_reprint_request") as HTMLElement; -receiptFormElement.removeAttribute("id"); -receiptFormElement.removeAttribute("name"); -receiptFormElement.removeAttribute("onsubmit"); -receiptFormElement.removeAttribute("target"); -receiptFormElement.removeAttribute("autocomplete"); -receiptFormElement.removeAttribute("rel"); +$("#form_reprint_request") + .removeAttr("id") + .removeAttr("name") + .removeAttr("onsubmit") + .removeAttr("target") + .removeAttr("autocomplete") + .removeAttr("rel"); -let captchaElement = document.querySelector("#werter > div > div:nth-child(4)") as HTMLElement; +const captchaElement = $("#werter > div > div:nth-child(4)"); -if (captchaElement) { - captchaElement = captchaElement!; - const captchaValueElement = document.getElementById("captchaText") as HTMLInputElement; - const captchaFieldElement = document.querySelector("[name=txtDrawText]") as HTMLInputElement; - const removeCaptcha = () => { - captchaFieldElement.value = captchaValueElement.value; - captchaElement.style.display = "none"; - setTimeout(removeCaptcha, 1000); - }; - removeCaptcha(); +if (captchaElement.length > 0) { + const captchaValueElement = $("#captchaText"); + const captchaFieldElement = $("[name=txtDrawText]"); + + setInterval(() => { + captchaFieldElement.val("FFFFFF"); + captchaValueElement.val("FFFFFF"); + captchaElement.hide(); + }, 1000); } -- cgit v1.2.3