diff options
| author | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-03-24 09:24:15 +0530 |
|---|---|---|
| committer | Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> | 2023-03-24 09:24:15 +0530 |
| commit | a9f2d88e1e5b1c7ddf524db8b5b185b8485f8d48 (patch) | |
| tree | 7f39667b6fc56bbf06adbbb3fc2aa6c54cfe27d1 /src/scripts/otps | |
| parent | 3b29d138bee5e98c9536d3606de3e4b5378338f0 (diff) | |
| download | banglar-bhumi-utils-a9f2d88e1e5b1c7ddf524db8b5b185b8485f8d48.tar.gz banglar-bhumi-utils-a9f2d88e1e5b1c7ddf524db8b5b185b8485f8d48.zip | |
Improved some functionality.
Diffstat (limited to 'src/scripts/otps')
| -rw-r--r-- | src/scripts/otps/grievance-application.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/scripts/otps/grievance-application.ts b/src/scripts/otps/grievance-application.ts new file mode 100644 index 0000000..140504c --- /dev/null +++ b/src/scripts/otps/grievance-application.ts @@ -0,0 +1,22 @@ +document.addEventListener("DOMContentLoaded", () => { + const proxiedPost = $.post; + + $.post = function() { + let element: HTMLInputElement | null = null; + if (arguments[0].endsWith("MISPetitionSmsSend.action")) { + element = document.querySelector("input[name=mobile_Code]") as HTMLInputElement; + } else if (arguments[0].endsWith("MISPetitionEmailSend.action")) { + element = document.querySelector("input[name=txtemail_Code]") as HTMLInputElement; + } + + if (element) { + const callback = arguments[2]; + arguments[2] = (data: any) => { + element!.value = data?.messageShow || ""; + callback(data); + }; + } + + return proxiedPost.apply(this, Array.from(arguments) as any); + }; +}); |
