-
Notifications
You must be signed in to change notification settings - Fork 1
/
persona.js
executable file
·131 lines (117 loc) · 3.58 KB
/
persona.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
function dropdown(){
console.log("in function");
var e = document.getElementById("persona-name-dropdown");
var myVal = e.options[e.selectedIndex].value;
console.log(myVal);
const personaSections = document.getElementsByClassName('persona-section');
for (const section of personaSections) {
section.style.display = 'none';
}
document.getElementById(myVal).syle.display = 'block';
}
function changeColor(section) {
var elem = document.getElementById(section);
elem.style.color = "#1E57C8";
}
function yearinput() {
var yearvalue = document.getElementById("year").value;
document.getElementById("yearoutput").innerHTML = yearvalue;
changeColor("year");
}
function empinput() {
var empvalue = document.getElementById("emp").value;
document.getElementById("empoutput").innerHTML = empvalue;
changeColor("emp");
}
function placeinput() {
var placevalue = document.getElementById("place").value;
document.getElementById("placeoutput").innerHTML = placevalue;
changeColor("place");
}
function paraone() {
var para = document.getElementById("Para1").value;
document.getElementById("para1output").innerHTML = para;
changeColor("Para1");
}
function backparaoneip() {
var back1 = document.getElementById("backparaone").value;
document.getElementById("backparaoneop").innerHTML = back1;
changeColor("backparaone");
}
function Noune() {
var str = document.getElementById("Nouneip").value;
var noun = str.toLowerCase();
changeColor("Nouneip");
console.log("== noun: ", noun)
if (noun == "") {
//alert("Oops! did you forget to enter a Subjective Pronouns?");
return false;
}
const nounoutputs = document.getElementsByClassName('nounoutput');
for (const n of nounoutputs) {
n.innerHTML = noun;
}
}
function objpro() {
changeColor("Objpro");
var str1 = document.getElementById("Objpro").value;
var obpr = str1.toLowerCase();
if (obpr == "") {
//alert("Oops! did you forget to enter an Object Pronouns?");
return false;
}
const obproutputs = document.getElementsByClassName('obproutput');
for (const o of obproutputs) {
o.innerHTML = obpr;
}
}
function possadj() {
changeColor("Pos.adj");
var str2 = document.getElementById("Pos.adj").value;
var poad = str2.toLowerCase();
if (poad == "") {
//alert("Oops! did you forget to enter a Possessive Adjective?");
return false;
}
const poadoutputs = document.getElementsByClassName('poadoutput');
for (const p of poadoutputs) {
p.innerHTML = poad;
}
}
function posspro() {
changeColor("Pos.pro");
var popro = document.getElementById("Pos.pro").value;
if (popro == "") {
//alert("Oops! did you forget to enter a Possessive Pronouns?");
return false;
}
/* not defined*/ document.getElementById("Reflexive").innerHTML = popro;
document.getElementById("Reflexive1").innerHTML = popro;
}
function Reflexive() {
changeColor("ref");
var str3 = document.getElementById("ref").value;
var refl = str3.toLowerCase();
if (refl == "") {
//alert("Oops! did you forget to enter a Reflexive?");
return false;
}
const refloutputs = document.getElementsByClassName('refloutput');
for (const r of refloutputs) {
r.innerHTML = refl;
}
}
function printDiv() {
var printbody = document.getElementById("printbody");
var printbodyClone = printbody.cloneNode(true);
var entirepage = document.getElementById("entirepage");
entirepage.style.display = 'none';
entirepage.after(printbodyClone);
window.print();
printbodyClone.remove();
entirepage.style.display = 'block';
return false;
}
function reloadtext() {
location.reload();
}