-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
95 lines (75 loc) · 3.21 KB
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// // console.log("Hello world from ARUN YERRAM");
document.addEventListener("DOMContentLoaded", function () {
const rightsList = document.getElementById("rights-list");
const documentContent = document.getElementById("document-content");
const languageSelect = document.getElementById("language-select")
const rightsData = [
"The right to free speech.",
"The right to a fair trial.",
"The right to privacy.",
"Right to Speak.",
"Right to be heard.",
"Right to freedom of expression.",
"Right to know.",
"Right to Information.",
"Right to Equality.",
"Right to freedom of association.",
"Right to fair dealing.",
"Right to Privacy.",
"Right to Freedom.",
"Right to Education.",
"Right to Justice.",
"Right to be informed.",
"Right to be heard.",
"Right to a fair trial.",
"Right to be free from discrimination.",
"Right to freddom of Press",
"Right to freedom of assembly.",
//
];
const legalDocuments = {
en: "English legal document content goes here.",
// es: "Contenido del documento legal en español va aquí.",
// fr: "Contenu du document légal en français va ici."
Tel : "Telugu legal document content goes here.",
hin : "Hindi legal document content goes here.",
mar : "Marathi legal document content goes here.",
tam : "Tamil legal document content goes here.",
kan : "Kannada legal document content goes here.",
};
function populateRightsList(data) {
data.forEach((right) => {
const listItem = document.createElement("li");
listItem.textContent = right;
rightsList.appendChild(listItem);
});
}
// Function to update the displayed document content based on language selection
function updateDocumentContent(language) {
documentContent.textContent = legalDocuments[language];
}
// Populate the rights list and set an initial document language
populateRightsList(rightsData);
updateDocumentContent(languageSelect.value)
// Event listener to update document content on language selection change
languageSelect.addEventListener("change", function () {
const selectedLanguage = languageSelect.value;
updateDocumentContent(selectedLanguage);
});
});
// document.addEventListener("DOMContentLoaded", function () {
// const documentForm = document.getElementById("document-form");
// const documentInput = document.getElementById("document-input");
// const documentList = document.getElementById("document-list");
// // Function to handle document submission
// documentForm.addEventListener("submit", function (event) {
// event.preventDefault();
// const file = documentInput.files[0];
// if (file) {
// const listItem = document.createElement("li");
// listItem.textContent = `Uploaded document: ${file.name}`;
// documentList.appendChild(listItem);
// // You can now process and store the uploaded document as needed.
// }
// });
// });