From ccf73485cfba952451144d7841cbb3fac8368867 Mon Sep 17 00:00:00 2001
From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>
Date: Sat, 8 Apr 2023 11:46:35 +0530
Subject: Injecting shared modules for the injected scripts, further reusing
code.
---
.../view-khatian/download-document-content.ts | 225 ---------------------
.../download-information-pdf-page-content.ts | 219 ++++++++++++++++++++
src/scripts/functionality/view-khatian/index.ts | 4 +-
3 files changed, 221 insertions(+), 227 deletions(-)
delete mode 100644 src/scripts/functionality/view-khatian/download-document-content.ts
create mode 100644 src/scripts/functionality/view-khatian/download-information-pdf-page-content.ts
(limited to 'src/scripts/functionality')
diff --git a/src/scripts/functionality/view-khatian/download-document-content.ts b/src/scripts/functionality/view-khatian/download-document-content.ts
deleted file mode 100644
index 249e2b1..0000000
--- a/src/scripts/functionality/view-khatian/download-document-content.ts
+++ /dev/null
@@ -1,225 +0,0 @@
-const sanghaFacilitationCentreBannerUrl = chrome.runtime.getURL("/assets/sangha-facilitation-centre-banner.jpg");
-
-export default (isPlotInformation: boolean, details: string, { district, block, mouza }: { district: string, block: string, mouza: string }) => `
-
-
-
${details}
-
-
-`;
diff --git a/src/scripts/functionality/view-khatian/download-information-pdf-page-content.ts b/src/scripts/functionality/view-khatian/download-information-pdf-page-content.ts
new file mode 100644
index 0000000..9ff18ec
--- /dev/null
+++ b/src/scripts/functionality/view-khatian/download-information-pdf-page-content.ts
@@ -0,0 +1,219 @@
+const sanghaFacilitationCentreBannerUrl = chrome.runtime.getURL("/assets/sangha-facilitation-centre-banner.jpg");
+
+export default (isPlotInformation: boolean, details: string, { district, block, mouza }: { district: string, block: string, mouza: string }) => `
+
+
+${details}
+
+
+`;
diff --git a/src/scripts/functionality/view-khatian/index.ts b/src/scripts/functionality/view-khatian/index.ts
index 0cb3947..e29e8a4 100644
--- a/src/scripts/functionality/view-khatian/index.ts
+++ b/src/scripts/functionality/view-khatian/index.ts
@@ -1,5 +1,5 @@
import { downloadPDF } from "@/shared/download-pdf";
-import getDetailsPDFContent from "@/scripts/functionality/view-khatian/download-document-content";
+import getDownloadInformationPDFPageContent from "@/scripts/functionality/view-khatian/download-information-pdf-page-content";
declare function load(): void;
@@ -27,7 +27,7 @@ document.addEventListener("DOMContentLoaded", () => {
const downloadInformationPDF = () => {
let contentElement = document.getElementById(isPlotInformation ? "plotdetails" : "khdetails");
- const documentStringContent = getDetailsPDFContent(!!isPlotInformation, contentElement!.innerHTML, {
+ const documentStringContent = getDownloadInformationPDFPageContent(!!isPlotInformation, contentElement!.innerHTML, {
district: getValueOfSelectElement("#lstDistrictCode1"),
block: getValueOfSelectElement("#lstBlockCode1"),
mouza: getValueOfSelectElement("#lstMouzaList")
--
cgit v1.2.3