-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
112 lines (93 loc) · 3.92 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
function addNewWEField() {
let newNode = document.createElement("textarea");
newNode.classList.add("form-control");
newNode.classList.add("weField");
newNode.classList.add("mt-2");
newNode.setAttribute("rows", 3);
newNode.setAttribute("placeholder", "Enter here");
let weOb = document.getElementById("we");
let weAddButtonOb = document.getElementById("weAddButton");
weOb.insertBefore(newNode, weAddButtonOb);
}
function addNewAQField() {
let newNode = document.createElement("textarea");
newNode.classList.add("form-control");
newNode.classList.add("eqField");
newNode.classList.add("mt-2");
newNode.setAttribute("rows", 3);
newNode.setAttribute("placeholder", "Enter here");
let aqOb = document.getElementById("aq");
let aqAddButtonOb = document.getElementById("aqAddButton");
aqOb.insertBefore(newNode, aqAddButtonOb);
}
function addNewSKField() {
let newNode = document.createElement("textarea");
newNode.classList.add("form-control");
newNode.classList.add("skField");
newNode.classList.add("mt-2");
newNode.setAttribute("rows", 3);
newNode.setAttribute("placeholder", "Enter here");
let skOb = document.getElementById("sk");
let skAddButtonOb = document.getElementById("skAddButton");
skOb.insertBefore(newNode, skAddButtonOb);
}
function addNewADField() {
let newNode = document.createElement("textarea");
newNode.classList.add("form-control");
newNode.classList.add("adField");
newNode.classList.add("mt-2");
newNode.setAttribute("rows", 3);
newNode.setAttribute("placeholder", "Enter here");
let adOb = document.getElementById("ad");
let adAddButtonOb = document.getElementById("adAddButton");
adOb.insertBefore(newNode, adAddButtonOb);
}
function generateCV() {
let nameField = document.getElementById("nameField").value;
let nameT1 = document.getElementById("nameT1");
nameT1.innerHTML = nameField;
document.getElementById("nameT2").innerHTML = nameField;
document.getElementById("contactT").innerHTML = document.getElementById("contactField").value;
document.getElementById("addressT").innerHTML = document.getElementById("addressField").value;
document.getElementById("fbT").innerHTML = document.getElementById("fbField").value;
document.getElementById("instaT").innerHTML = document.getElementById("instaField").value;
document.getElementById("linkedT").innerHTML = document.getElementById("linkedField").value;
document.getElementById("objectiveT").innerHTML = document.getElementById("objectiveField").value;
let wes = document.getElementsByClassName("weField");
let str = "";
for (let e of wes) {
str = str + `<li> ${e.value} </li>`;
}
document.getElementById("weT").innerHTML = str;
let weq = document.getElementsByClassName("skField");
let stq = "";
for (let m of weq) {
stq = stq + `<li> ${m.value} </li>`;
}
document.getElementById("skT").innerHTML = stq;
let wec = document.getElementsByClassName("adField");
let stc = "";
for (let m of wec) {
stc = stc + `<li> ${m.value} </li>`;
}
document.getElementById("adT").innerHTML = stc;
let aqs = document.getElementsByClassName("eqField");
let str1 = "";
for (let e of aqs) {
str1 += `<li> ${e.value} </li>`;
}
document.getElementById("aqT").innerHTML = str1;
let file = document.getElementById("imgField").files[0];
if (file) {
let reader = new FileReader();
reader.onloadend = function () {
document.getElementById("imgTemplate").src = reader.result;
};
reader.readAsDataURL(file);
}
document.getElementById("cv-form").style.display = "none";
document.getElementById("cv-template").style.display = "block";
}
function printCV() {
window.print();
}