diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2024-06-03 13:09:04 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2024-06-03 13:09:04 +0530 |
| commit | a38b8ca3c6146c2db03167d6ff94e445d756a202 (patch) | |
| tree | 0d315bd68158336d4241cec75685a8b15b4c00d6 /src | |
| parent | 7ea487be4aaf8f3b3047e2a7b3c1da80744f258b (diff) | |
| download | banglar-bhumi-utils-a38b8ca3c6146c2db03167d6ff94e445d756a202.tar.gz banglar-bhumi-utils-a38b8ca3c6146c2db03167d6ff94e445d756a202.zip | |
Added captha removal and autocomplete to GRN search.
Diffstat (limited to 'src')
| -rw-r--r-- | src/scripts.json | 13 | ||||
| -rw-r--r-- | src/scripts/captcha/application-receipt.ts | 5 | ||||
| -rw-r--r-- | src/scripts/functionality/application-receipt.ts | 23 | ||||
| -rw-r--r-- | src/scripts/functionality/grn-search.ts | 31 | ||||
| -rw-r--r-- | src/scripts/functionality/view-khatian/index.ts | 4 |
5 files changed, 41 insertions, 35 deletions
diff --git a/src/scripts.json b/src/scripts.json index ca5062c..bc522cd 100644 --- a/src/scripts.json +++ b/src/scripts.json @@ -1,17 +1,14 @@ { - "injected-before": { - "stop-blocking.ts": "*" - }, - "injected-after": { + "injected": { + "stop-blocking.ts": "*", "login.ts": "*", "otps/grievance-application.ts": "GrievAppViewAction.action", "otps/mutation-application.ts": "MuteApplication.action", "otps/warish-application.ts": "WarishAppViewAction.action", "functionality/mutation-application.ts": "MuteApplication.action", "functionality/view-khatian/index.ts": "KnowYourProperty.action", - "captcha/know-your-property.ts": "KnowYourProperty.action" - }, - "loaded": { - "functionality/application-receipt.ts": "Apprecrep.action" + "functionality/grn-search.ts": "appGrnSrch", + "captcha/know-your-property.ts": "KnowYourProperty.action", + "captcha/application-receipt.ts": "Apprecrep.action" } } diff --git a/src/scripts/captcha/application-receipt.ts b/src/scripts/captcha/application-receipt.ts new file mode 100644 index 0000000..5ff1a57 --- /dev/null +++ b/src/scripts/captcha/application-receipt.ts @@ -0,0 +1,5 @@ +document.addEventListener("DOMContentLoaded", () => { + $("#werter > div > form > div:nth-child(4)").hide(); + (window as any).validateForm = () => true; + const captchaElement = $("#werter > div > div:nth-child(4)"); +}); diff --git a/src/scripts/functionality/application-receipt.ts b/src/scripts/functionality/application-receipt.ts deleted file mode 100644 index a86405f..0000000 --- a/src/scripts/functionality/application-receipt.ts +++ /dev/null @@ -1,23 +0,0 @@ -$("#form_reprint_request") - .removeAttr("id") - .removeAttr("name") - .removeAttr("onsubmit") - .removeAttr("target") - .removeAttr("autocomplete") - .removeAttr("rel"); - -const captchaElement = $("#werter > div > div:nth-child(4)"); - -if (captchaElement.length > 0) { - const captchaValueElement = $("#captchaText"); - const captchaFieldElement = $("[name=txtDrawText]"); - - const captcha = () => { - captchaFieldElement.val("FFFFFF"); - captchaValueElement.val("FFFFFF"); - captchaElement.hide(); - }; - - captcha(); - setInterval(captcha, 1000); -} diff --git a/src/scripts/functionality/grn-search.ts b/src/scripts/functionality/grn-search.ts new file mode 100644 index 0000000..02471f5 --- /dev/null +++ b/src/scripts/functionality/grn-search.ts @@ -0,0 +1,31 @@ +$("#frmpaymentDetails > div:nth-child(2) > div:nth-child(1) > div:nth-child(4)").hide(); +const captcha = $("#txtDrawText"); +const captchaText = $("#captchaText"); +captcha.val((captchaText.val() as string).replaceAll(" ", "")); + +const requestTypeElement = $("#lstRequestType"); +const grnNumberElement = $("#txtGRN_NO"); +const applicationNumberElement = $("#txtAPPLN_NO"); + +const requestType = localStorage.getItem("requestType"); +const grnNumber = localStorage.getItem("grnNumber"); +const applicationNumber = localStorage.getItem("applicationNumber"); + +if (requestType) { + requestTypeElement.val(requestType); +} + +if (grnNumber) { + grnNumberElement.val(grnNumber); +} + +if (applicationNumber) { + applicationNumberElement.val(applicationNumber); +} + +$("#btnSubmitGRNNo").click(() => { + captcha.val((captchaText.val() as string).replaceAll(" ", "")); + localStorage.setItem("requestType", requestTypeElement.val() as string); + localStorage.setItem("grnNumber", grnNumberElement.val() as string); + localStorage.setItem("applicationNumber", applicationNumberElement.val() as string); +}); diff --git a/src/scripts/functionality/view-khatian/index.ts b/src/scripts/functionality/view-khatian/index.ts index 312c7c1..c54ef5a 100644 --- a/src/scripts/functionality/view-khatian/index.ts +++ b/src/scripts/functionality/view-khatian/index.ts @@ -2,11 +2,7 @@ import { generateWebPage } from "@/shared/generate-web-page"; import { interceptPost } from "@/shared/intercept-jquery-ajax"; import getDownloadInformationPDFPageContent from "@/scripts/functionality/view-khatian/download-information-pdf-page-content.html"; -declare function load(): void; - const sanghaFacilitationCentreBannerUrl = "$l{ /assets/sangha-facilitation-centre-banner.jpg }l$"; -// document.currentScript.getAttribute("data-banner-image-url"); -//("/assets/sangha-facilitation-centre-banner.jpg"); document.addEventListener("DOMContentLoaded", () => { const submitButtonElement = $("#khbutton"); |
