-
Notifications
You must be signed in to change notification settings - Fork 1
/
datasel.js
171 lines (113 loc) · 3.76 KB
/
datasel.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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// code from
// http://www.adp-gmbh.ch/web/js/hiding_column.html
function show_hide_data(class, do_show) {
var stl;
if (do_show) stl = 'block'
else stl = 'none';
if (document.getElementsByClassName == undefined) {
document.getElementsByClassName = function(className)
{
var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
var allElements = document.getElementsByTagName("*");
var results = [];
var element;
for (var i = 0; (element = allElements[i]) != null; i++) {
var elementClass = element.className;
if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
results.push(element);
}
return results;
}
}
var elements = document.getElementsByClassName(class);
for (var el=0; el<elements.length;el++) {
elements[el].style.display=stl;
}
// set/clear all checkboxes for individual jobs too
var elements = document.getElementsByClassName("job_indiv");
for (var el=0; el<elements.length;el++) {
elements[el].checked=do_show;
}
}
function show_hide_data_id(id, do_show) {
var stl;
if (do_show) stl = 'block'
else stl = 'none';
var element = document.getElementById(id);
// alert(elements.length+id);
// for (var el=0; el<elements.length;el++) {
// alert("Setting element "+el+" to "+stl);
element.style.display=stl;
// }
}
function toggle_job_blink(owner) {
//alert("Displaying jobs for "+owner);
var elements = document.getElementsByClassName(owner);
for (var el=0; el<elements.length;el++) {
alert("x"+elements[el].style.color+"x");
elements[el].style.textDecoration='blink';
elements[el].style.backgroundColour='blue';
// if (elements[el].visibility == '') {
// elements[el].style.display='none';
// } else {
//
// elements[el].style. == 'block'
// }
}
}
function highlight(owner) {
//alert("Displaying jobs for "+owner);
var elements = document.getElementsByClassName(owner);
for (var el=0; el<elements.length;el++) {
// alert("x"+elements[el].style.color+"x");
elements[el].style.textDecoration='blink';
elements[el].style.color='white';
elements[el].style.backgroundColor='blue';
// if (elements[el].visibility == '') {
// elements[el].style.display='none';
// } else {
//
// elements[el].style. == 'block'
// }
}
}
function dehighlight(owner) {
//alert("Displaying jobs for "+owner);
var elements = document.getElementsByClassName(owner);
for (var el=0; el<elements.length;el++) {
// alert("x"+elements[el].style.color+"x");
elements[el].style.textDecoration='none';
elements[el].style.backgroundColor='white';
elements[el].style.color='black';
// if (elements[el].visibility == '') {
// elements[el].style.display='none';
// } else {
//
// elements[el].style. == 'block'
// }
}
}
function on_top(class, on_top) {
var stl;
if (on_top) stl = 'fixed'
else stl = 'static';
if (document.getElementsByClassName == undefined) {
document.getElementsByClassName = function(className)
{
var hasClassName = new RegExp("(?:^|\\s)" + className + "(?:$|\\s)");
var allElements = document.getElementsByTagName("*");
var results = [];
var element;
for (var i = 0; (element = allElements[i]) != null; i++) {
var elementClass = element.className;
if (elementClass && elementClass.indexOf(className) != -1 && hasClassName.test(elementClass))
results.push(element);
}
return results;
}
}
var elements = document.getElementsByClassName(class);
for (var el=0; el<elements.length;el++) {
elements[el].style.position=stl;
}
}