-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpps.js
More file actions
93 lines (67 loc) · 1.91 KB
/
pps.js
File metadata and controls
93 lines (67 loc) · 1.91 KB
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
/* NAME
*
* pps.js
*
* CONCEPT
*
* JavaScript for the Polymorphic Pattern Project.
*/
/* post()
*
* Toggle visibility of a grid of POST parameters.
*/
function post(event) {
document.querySelector('#ass').style.display = 'none'
document.querySelector('#posterior').style.display = 'grid'
} // end post()
/* files()
*
* Toggle visibility of a grid of FILES parameters.
*/
function files(event) {
document.querySelector('#bum').style.display = 'none'
document.querySelector('#booty').style.display = 'grid'
} // end files()
/* addFeature()
*
* Add a row to the ManageFeatures() form. NOT CURRENTLY USED.
*/
function addFeature(event) {
content = ` <div style="grid-column: span 3"></div>
`
arow.insertAdjacentHTML('beforebegin', content)
} /* end addFeature() */
/* showi()
*
* Find the <DIV> with the ID corresponding to its preview <SPAN> and
* make it visible.
*/
function showi(event) {
ibox = document.querySelector('#i-' + event.target.id.substring(2))
ibox.style.display = 'block'
} // end showi()
/* hidei()
*
* Find the <DIV> with the ID corresponding to its preview <SPAN> and
* hide it.
*/
function hidei(event) {
ibox = document.querySelector('#i-' + event.target.id.substring(2))
ibox.style.display = 'none'
} // end hidei()
/* init()
*
* Called when page has loaded. Primarily, the task is one of assigning
* event listeners to elements that are in the page in specific contexts.
*/
function init() {
if(ass = document.querySelector('#ass'))
ass.addEventListener('click', post)
if(bum = document.querySelector('#bum'))
bum.addEventListener('click', files)
// Set focus and blur event listeners on elements with class 'ilink'.
for(const ilink of document.querySelectorAll('.ilink')) {
ilink.addEventListener('mouseenter', showi)
ilink.addEventListener('mouseleave', hidei)
}
} // end init()