diff options
Diffstat (limited to 'src/scripts')
| -rw-r--r-- | src/scripts/auto-login.ts | 34 | ||||
| -rw-r--r-- | src/scripts/captcha.ts (renamed from src/scripts/autofill-captcha.ts) | 13 | ||||
| -rw-r--r-- | src/scripts/functionality/application-receipt.ts (renamed from src/scripts/fix-application-receipt.ts) | 6 | ||||
| -rw-r--r-- | src/scripts/functionality/view-khatian.ts | 21 | ||||
| -rw-r--r-- | src/scripts/login.ts | 60 | ||||
| -rw-r--r-- | src/scripts/optimize/home-page/modify-dom.ts (renamed from src/scripts/optimize/home-page/index.ts) | 0 | ||||
| -rw-r--r-- | src/scripts/optimize/home-page/styles.ts | 12 | ||||
| -rw-r--r-- | src/scripts/otps/grievance-application.ts (renamed from src/scripts/autofill-otps/grievance-application.ts) | 0 | ||||
| -rw-r--r-- | src/scripts/show-plot-information.ts | 11 |
9 files changed, 86 insertions, 71 deletions
diff --git a/src/scripts/auto-login.ts b/src/scripts/auto-login.ts deleted file mode 100644 index ae1682b..0000000 --- a/src/scripts/auto-login.ts +++ /dev/null @@ -1,34 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - const proxiedPost = $.post; - - let loginData: any | null = null; - - $.post = function() { - if (arguments[0].endsWith("login.action")) { - const callback = arguments[2]; - arguments[2] = (data: any) => { - if (!data.exception && data.checkmsg === "success") { - loginData = arguments[1]; - } - callback(data); - }; - } - - return proxiedPost.apply(this, Array.from(arguments) as any); - }; - - setInterval(() => { - if (loginData) { - $.post( - "/BanglarBhumi/login.action", - loginData, - data => { - if (data.exception || data.checkmsg !== "success") { - loginData = null; - } - }, - "json" - ); - } - }, 1000 * 60 * 5); -}); diff --git a/src/scripts/autofill-captcha.ts b/src/scripts/captcha.ts index f290fda..0eb36c9 100644 --- a/src/scripts/autofill-captcha.ts +++ b/src/scripts/captcha.ts @@ -1,16 +1,5 @@ const autofillCaptcha = () => { - let captchas = Array.from(document.querySelectorAll("#txtCaptcha")) as HTMLInputElement[]; - - for (const captcha of captchas) { - const captchaInput = captcha.parentElement!.querySelector("#txtInput") as HTMLInputElement | null; - if (captchaInput) { - captchaInput.value = captcha.value.replaceAll(" ", ""); - captchaInput.style.display = "none"; - captcha.style.display = "none"; - } - } - - captchas = Array.from(document.querySelectorAll("#captchaText")) as HTMLInputElement[]; + const captchas = Array.from(document.querySelectorAll("#captchaText")) as HTMLInputElement[]; for (const captcha of captchas) { const captchaParentElement = captcha.parentElement!; if (captchaParentElement.id === "drawTextSpan") { diff --git a/src/scripts/fix-application-receipt.ts b/src/scripts/functionality/application-receipt.ts index 11dddf0..7fdf4d0 100644 --- a/src/scripts/fix-application-receipt.ts +++ b/src/scripts/functionality/application-receipt.ts @@ -1,4 +1,4 @@ -const receiptFormElement = document.querySelector("#form_reprint_request")!; +const receiptFormElement = document.querySelector("#form_reprint_request") as HTMLElement; receiptFormElement.removeAttribute("id"); receiptFormElement.removeAttribute("name"); receiptFormElement.removeAttribute("onsubmit"); @@ -6,7 +6,7 @@ receiptFormElement.removeAttribute("target"); receiptFormElement.removeAttribute("autocomplete"); receiptFormElement.removeAttribute("rel"); -let captchaElement = document.querySelector("#werter > div > div:nth-child(4)"); +let captchaElement = document.querySelector("#werter > div > div:nth-child(4)") as HTMLElement; if (captchaElement) { captchaElement = captchaElement!; @@ -14,7 +14,7 @@ if (captchaElement) { const captchaFieldElement = document.querySelector("[name=txtDrawText]") as HTMLInputElement; const removeCaptcha = () => { captchaFieldElement.value = captchaValueElement.value; - (captchaElement as any).style.display = "none"; + captchaElement.style.display = "none"; setTimeout(removeCaptcha, 1000); }; removeCaptcha(); diff --git a/src/scripts/functionality/view-khatian.ts b/src/scripts/functionality/view-khatian.ts new file mode 100644 index 0000000..9f35762 --- /dev/null +++ b/src/scripts/functionality/view-khatian.ts @@ -0,0 +1,21 @@ +declare function loadKhatian(): void; + +document.addEventListener("DOMContentLoaded", () => { + const proxiedPost = $.post; + + $.post = function() { + if (arguments[0].startsWith("khDetailsAction_LandInfo.action")) { + const callback = arguments[2]; + arguments[2] = (data: any) => { + callback(data); + const tableElement = document.querySelector("#khdetails > table > tbody > tr > td:nth-child(1) > div:nth-child(5) > table > tbody") as HTMLElement | null; + if (tableElement) { + tableElement.style.height = "auto"; + tableElement.style.width = "100%"; + } + } + } + + return proxiedPost.apply(this, Array.from(arguments) as any); + } +}); diff --git a/src/scripts/login.ts b/src/scripts/login.ts new file mode 100644 index 0000000..e2d5d5b --- /dev/null +++ b/src/scripts/login.ts @@ -0,0 +1,60 @@ +document.addEventListener("DOMContentLoaded", () => { + const proxiedPost = $.post; + + let loginData: any | null = null; + + $.post = function() { + if (arguments[0].endsWith("viewLoginAreaAction")) { + (window as any).DrawLoginCaptcha = () => {}; + const callback = arguments[1]; + arguments[1] = (html: any) => { + callback(html); + const captchaValueElement = document.getElementById("txtCaptcha") as HTMLInputElement; + const captchaInputElement = document.getElementById("txtInput") as HTMLInputElement; + captchaValueElement.value = "ffffff"; + captchaInputElement.value = "ffffff"; + captchaValueElement.style.display = "none"; + captchaInputElement.style.display = "none"; + (document.querySelector(".captcharefresh") as HTMLElement).style.display = "none"; + } + } else if (arguments[0].endsWith("viewPasswordRecoveryArea")) { + (window as any).Captcha = () => {}; + const callback = arguments[1]; + arguments[1] = (html: any) => { + callback(html); + const captchaInputElement = document.getElementById("dText") as HTMLInputElement; + const captchaValueElement = document.getElementById("captaText") as HTMLInputElement; + captchaValueElement.value = "ffffff"; + captchaInputElement.value = "ffffff"; + captchaValueElement.style.display = "none"; + captchaInputElement.style.display = "none"; + (document.getElementById("captchaRef") as HTMLElement).style.display = "none"; + } + } else if (arguments[0].endsWith("login.action")) { + const callback = arguments[2]; + arguments[2] = (data: any) => { + if (!data.exception && data.checkmsg === "success") { + loginData = arguments[1]; + } + callback(data); + }; + } + + return proxiedPost.apply(this, Array.from(arguments) as any); + }; + + setInterval(() => { + if (loginData) { + $.post( + "/BanglarBhumi/login.action", + loginData, + data => { + if (data.exception || data.checkmsg !== "success") { + loginData = null; + } + }, + "json" + ); + } + }, 1000 * 60 * 5); +}); diff --git a/src/scripts/optimize/home-page/index.ts b/src/scripts/optimize/home-page/modify-dom.ts index 762b4f8..762b4f8 100644 --- a/src/scripts/optimize/home-page/index.ts +++ b/src/scripts/optimize/home-page/modify-dom.ts diff --git a/src/scripts/optimize/home-page/styles.ts b/src/scripts/optimize/home-page/styles.ts index 91d273a..249b361 100644 --- a/src/scripts/optimize/home-page/styles.ts +++ b/src/scripts/optimize/home-page/styles.ts @@ -1,20 +1,10 @@ import { styles } from "@/utils/styling"; -styles("#form_MainMenuPage > div > div.logo-div.row.ng-scope > div.top_link_icon.col-sm-7.float-right", { - width: "100%", - display: "flex", - justifyContent: "space-around", - paddingTop: "5px" -}); -styles("#form_MainMenuPage > div > div.logo-div.row.ng-scope > div.top_link_icon.col-sm-7.float-right > a > span > i", { - height: "40px", - width: "40px", - paddingTop: "10px" -}); styles("#slider", { overflow: "visible", position: "initial" }); + styles("#slider > img", { width: "100vw", position: "initial" diff --git a/src/scripts/autofill-otps/grievance-application.ts b/src/scripts/otps/grievance-application.ts index 140504c..140504c 100644 --- a/src/scripts/autofill-otps/grievance-application.ts +++ b/src/scripts/otps/grievance-application.ts diff --git a/src/scripts/show-plot-information.ts b/src/scripts/show-plot-information.ts deleted file mode 100644 index aec56d6..0000000 --- a/src/scripts/show-plot-information.ts +++ /dev/null @@ -1,11 +0,0 @@ -declare function loadKhatian(): void; - -document.addEventListener("DOMContentLoaded", () => { - (window as any).customLoadKhatian = () => { - loadKhatian(); - setTimeout(() => { - (document.querySelector("#khdetails > table > tbody > tr > td:nth-child(1) > div:nth-child(5) > table > tbody") as any).style.height = "auto"; - }, 1000); - }; - document.querySelector("#khbutton")!.setAttribute("onclick", "customLoadKhatian()"); -}); |
