-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathca_js.inc
77 lines (74 loc) · 3.74 KB
/
ca_js.inc
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
function newca() {
var myID = newID();
var newRoot = newDiv("ca_" + myID + "_editor", "ca_editor");
newNode = newRoot.appendChild(newInput("", "", "hidden", "editobj_ca_" + myID, "true"));
newRoot.appendChild(document.createTextNode(" "));
var newNode = newRoot.appendChild(newSection("name", "Name"));
newNode2 = newNode.appendChild(newSelect("ca_" + myID + "_prefix"));
newNode2.appendChild(newOption("", ""));
newNode2.firstChild.selected = true;
newNode2.firstChild.defaultSelected = true;
newNode2.appendChild(newOption("Mr.", "Mr."));
newNode2.appendChild(newOption("Ms.", "Ms."));
newNode2.appendChild(newOption("Mrs.", "Mrs."));
newNode2.appendChild(newOption("Dr.", "Dr."));
newNode2.appendChild(newOption("Rev.", "Rev."));
newNode.appendChild(document.createTextNode(" "));
newNode.appendChild(newInput("", "first", "text", "ca_" + myID + "_first", ""));
newNode.appendChild(document.createTextNode(" "));
newNode.appendChild(newInput("", "middle", "text", "ca_" + myID + "_middle", ""));
newNode.appendChild(document.createTextNode(" "));
newNode.appendChild(newInput("", "last", "text", "ca_" + myID + "_last", ""));
newNode.appendChild(document.createTextNode(" "));
newNode2 = newNode.appendChild(newSelect("ca_" + myID + "_suffix"));
newNode2.appendChild(newOption("", ""));
newNode2.firstChild.selected = true;
newNode2.firstChild.defaultSelected = true;
newNode2.appendChild(newOption("Jr.", "Jr."));
newNode2.appendChild(newOption("Sr.", "Sr."));
newNode2.appendChild(newOption("III", "III"));
newNode2.appendChild(newOption("IV", "IV"));
newNode2.appendChild(newOption("Ph.D.", "Ph.D."));
newNode2.appendChild(newOption("Esq.", "Esq."));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("nick", "Nick/Fan Name"));
newNode.appendChild(newInput("", "nick", "text", "ca_" + myID + "_nick", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("age", "Age"));
newNode.appendChild(newInput("", "age", "text", "ca_" + myID + "_age", ""));
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("gender", "Gender"));
newNode.appendChild(newInput("", "nick", "radio", "ca_" + myID + "_gender", "M"));
newNode.appendChild(document.createTextNode("Male"));
newNode.appendChild(newInput("", "nick", "radio", "ca_" + myID + "_gender", "F"));
newNode.appendChild(document.createTextNode("Female"));
newNode = newRoot.appendChild(newSection("reference", "Reference"));
newNode2 = newNode.appendChild(newSelect("badge_" + myID + "_reference"));
newNode2.appendChild(newOption("", ""));
newNode2.firstChild.selected = true;
newNode2.firstChild.defaultSelected = true;
<?php
foreach($_SESSION['db_enums']['reftypes'] as $typecode => $typedetails) {
echo ' newNode2.appendChild(newOption("', $typedetails['text'], '", "', $typecode, '"));', "\n";
}
?>
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("attraction", "Attraction"));
newNode2 = newNode.appendChild(newSelect("badge_" + myID + "_attraction"));
newNode2.appendChild(newOption("", ""));
newNode2.firstChild.selected = true;
newNode2.firstChild.defaultSelected = true;
<?php
foreach($_SESSION['db_enums']['attrtypes'] as $typecode => $typedetails) {
echo ' newNode2.appendChild(newOption("', $typedetails['text'], '", "', $typecode, '"));', "\n";
}
?>
newNode.appendChild(document.createTextNode(" "));
newNode = newRoot.appendChild(newSection("comments", "Comments"));
newNode2 = newNode.appendChild(document.createElement("textarea"));
newNode2.className = "comments";
newNode2.name = "ca_" + myID + "_comments";
newNode.appendChild(document.createTextNode(" "));
newRoot.appendChild(document.createTextNode(" "));
return newRoot;
}