1
|
//\/////
|
2
|
|
3
|
//\ overLIB Hide Form Plugin
|
4
|
|
5
|
//\
|
6
|
|
7
|
//\ Uses an iframe shim to mask system controls for IE v5.5 or higher as suggested in
|
8
|
|
9
|
//\ http://dotnetjunkies.com/weblog/jking/posts/488.aspx
|
10
|
|
11
|
//\ This file requires overLIB 4.10 or later.
|
12
|
|
13
|
//\
|
14
|
|
15
|
//\ overLIB 4.05 - You may not remove or change this notice.
|
16
|
|
17
|
//\ Copyright Erik Bosrup 1998-2004. All rights reserved.
|
18
|
|
19
|
//\ Contributors are listed on the homepage.
|
20
|
|
21
|
//\ See http://www.bosrup.com/web/overlib/ for details.
|
22
|
|
23
|
// $Revision$ $Date$
|
24
|
|
25
|
//\/////
|
26
|
|
27
|
//\mini
|
28
|
|
29
|
if (typeof olInfo == 'undefined' || typeof olInfo.meets == 'undefined' || !olInfo.meets(4.10)) alert('overLIB 4.10 or later is required for the HideForm Plugin.');
|
30
|
|
31
|
else {
|
32
|
|
33
|
|
34
|
|
35
|
// Function which generates the popup with an IFRAME shim
|
36
|
|
37
|
function generatePopUp(content) {
|
38
|
|
39
|
if(!olIe4||olOp||!olIe55||(typeof o3_shadow != 'undefined' && o3_shadow)||(typeof o3_bubble != 'undefined' && o3_bubble)) return;
|
40
|
|
41
|
|
42
|
|
43
|
var wd,ht,txt, zIdx = 0;
|
44
|
|
45
|
|
46
|
|
47
|
wd = parseInt(o3_width);
|
48
|
|
49
|
ht = over.offsetHeight;
|
50
|
|
51
|
txt = backDropSource(wd,ht,zIdx++);
|
52
|
|
53
|
txt += '<div style="position: absolute; top: 0; left: 0; width: '+ wd+'px; z-index: ' + zIdx + ';">' + content + '</div>';
|
54
|
|
55
|
layerWrite(txt);
|
56
|
|
57
|
}
|
58
|
|
59
|
|
60
|
|
61
|
// Code for the IFRAME which is used in other places
|
62
|
|
63
|
function backDropSource(width, height, Z) {
|
64
|
|
65
|
return '<iframe frameborder="0" scrolling="no" src="javascript:false;" width="' + width + '" height="' + height + '" style="z-index: ' + Z + '; filter: Beta(Style=0,Opacity=0);"></iframe>';
|
66
|
|
67
|
}
|
68
|
|
69
|
|
70
|
|
71
|
// Hides SELECT boxes that will be under the popup
|
72
|
|
73
|
// Checking Gecko version number to try to include other browsers based on the Gecko engine
|
74
|
|
75
|
function hideSelectBox() {
|
76
|
|
77
|
if(olNs4 || olOp || olIe55) return;
|
78
|
|
79
|
var px, py, pw, ph, sx, sw, sy, sh, selEl, v;
|
80
|
|
81
|
|
82
|
|
83
|
if(olIe4) v = 0;
|
84
|
|
85
|
else {
|
86
|
|
87
|
v = navigator.userAgent.match(/Gecko\/(\d{8})/i);
|
88
|
|
89
|
if(!v) return; // return if no string match
|
90
|
|
91
|
v = parseInt(v[1]);
|
92
|
|
93
|
}
|
94
|
|
95
|
|
96
|
|
97
|
if (v < 20030624) { // versions less than June 24, 2003 were earlier Netscape browsers
|
98
|
|
99
|
px = parseInt(over.style.left);
|
100
|
|
101
|
py = parseInt(over.style.top);
|
102
|
|
103
|
pw = o3_width;
|
104
|
|
105
|
ph = (o3_aboveheight ? parseInt(o3_aboveheight) : over.offsetHeight);
|
106
|
|
107
|
selEl = (olIe4) ? o3_frame.document.all.tags("SELECT") : o3_frame.document.getElementsByTagName("SELECT");
|
108
|
|
109
|
for (var i=0; i<selEl.length; i++) {
|
110
|
|
111
|
if(!olIe4 && selEl[i].size < 2) continue; // Not IE and SELECT size is 1 or not specified
|
112
|
|
113
|
sx = pageLocation(selEl[i],'Left');
|
114
|
|
115
|
sy = pageLocation(selEl[i],'Top');
|
116
|
|
117
|
sw = selEl[i].offsetWidth;
|
118
|
|
119
|
sh = selEl[i].offsetHeight;
|
120
|
|
121
|
if((px+pw) < sx || px > (sx+sw) || (py+ph) < sy || py > (sy+sh)) continue;
|
122
|
|
123
|
selEl[i].isHidden = 1;
|
124
|
|
125
|
selEl[i].style.visibility = 'hidden';
|
126
|
|
127
|
}
|
128
|
|
129
|
}
|
130
|
|
131
|
}
|
132
|
|
133
|
|
134
|
|
135
|
// Shows previously hidden SELECT Boxes
|
136
|
|
137
|
function showSelectBox() {
|
138
|
|
139
|
if(olNs4 || olOp || olIe55) return;
|
140
|
|
141
|
var selEl, v;
|
142
|
|
143
|
|
144
|
|
145
|
if(olIe4) v = 0;
|
146
|
|
147
|
else {
|
148
|
|
149
|
v = navigator.userAgent.match(/Gecko\/(\d{8})/i);
|
150
|
|
151
|
if(!v) return;
|
152
|
|
153
|
v = parseInt(v[1]);
|
154
|
|
155
|
}
|
156
|
|
157
|
|
158
|
|
159
|
if(v < 20030624) {
|
160
|
|
161
|
selEl = (olIe4) ? o3_frame.document.all.tags("SELECT") : o3_frame.document.getElementsByTagName("SELECT");
|
162
|
|
163
|
for (var i=0; i<selEl.length; i++) {
|
164
|
|
165
|
if(typeof selEl[i].isHidden != 'undefined' && selEl[i].isHidden) {
|
166
|
|
167
|
selEl[i].isHidden = 0;
|
168
|
|
169
|
selEl[i].style.visibility = 'visible';
|
170
|
|
171
|
}
|
172
|
|
173
|
}
|
174
|
|
175
|
}
|
176
|
|
177
|
}
|
178
|
|
179
|
|
180
|
|
181
|
// function gets the total offset properties of an element
|
182
|
|
183
|
// this same function occurs in overlib_mark.js.
|
184
|
|
185
|
function pageLocation(o,t){
|
186
|
|
187
|
var x = 0
|
188
|
|
189
|
|
190
|
|
191
|
while(o.offsetParent){
|
192
|
|
193
|
x += o['offset'+t]
|
194
|
|
195
|
o = o.offsetParent
|
196
|
|
197
|
}
|
198
|
|
199
|
|
200
|
|
201
|
x += o['offset'+t]
|
202
|
|
203
|
|
204
|
|
205
|
return x
|
206
|
|
207
|
}
|
208
|
|
209
|
|
210
|
|
211
|
// reset mouse move routine for NS7 but not NS7.1,Opera, or IE5.5+
|
212
|
|
213
|
// It also bypasses Netscape 6 since the modifications mess up the display of popups
|
214
|
|
215
|
// and don't work anyways.
|
216
|
|
217
|
// Modify mouse move routine while loading so that hideSelectBox()
|
218
|
|
219
|
// can be called from the correct location
|
220
|
|
221
|
if (!(olNs4 || olOp || olIe55 || navigator.userAgent.indexOf('Netscape6') != -1)) {
|
222
|
|
223
|
var MMStr = olMouseMove.toString();
|
224
|
|
225
|
var strRe = /(if\s*\(o3_allowmove\s*==\s*1.*\)\s*)/;
|
226
|
|
227
|
var f = MMStr.match(strRe);
|
228
|
|
229
|
|
230
|
|
231
|
if (f) {
|
232
|
|
233
|
var ls = MMStr.search(strRe);
|
234
|
|
235
|
ls += f[1].length;
|
236
|
|
237
|
var le = MMStr.substring(ls).search(/[;|}]\n/);
|
238
|
|
239
|
MMStr = MMStr.substring(0,ls) + ' { runHook("placeLayer",FREPLACE); if(olHideForm) hideSelectBox(); ' + MMStr.substring(ls + (le != -1 ? le+3 : 0));
|
240
|
|
241
|
document.writeln('<script type="text/javascript">\n<!--\n' + MMStr + '\n//-->\n</' + 'script>');
|
242
|
|
243
|
}
|
244
|
|
245
|
|
246
|
|
247
|
f = capExtent.onmousemove.toString().match(/function[ ]+(\w*)\(/);
|
248
|
|
249
|
if (f&&f[1] != 'anonymous') capExtent.onmousemove = olMouseMove;
|
250
|
|
251
|
}
|
252
|
|
253
|
|
254
|
|
255
|
|
256
|
|
257
|
////////
|
258
|
|
259
|
// PLUGIN REGISTRATIONS
|
260
|
|
261
|
////////
|
262
|
|
263
|
registerHook("createPopup",generatePopUp,FAFTER);
|
264
|
|
265
|
registerHook("hideObject",showSelectBox,FAFTER);
|
266
|
|
267
|
olHideForm=1;
|
268
|
|
269
|
}
|
270
|
|