]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/styleguide/docbook-xsl-1.75.2/slides/browser/xbStyle-nn4.js
stylesheet changes.
[working/Evergreen.git] / stylesheets / styleguide / docbook-xsl-1.75.2 / slides / browser / xbStyle-nn4.js
1 /*\r
2  * xbStyle-nn4.js\r
3  * $Revision: 1.2 $ $Date: 2003/02/07 16:04:22 $\r
4  */\r
5 \r
6 /* ***** BEGIN LICENSE BLOCK *****\r
7  * Version: MPL 1.1/GPL 2.0/LGPL 2.1\r
8  *\r
9  * The contents of this file are subject to the Mozilla Public License Version\r
10  * 1.1 (the "License"); you may not use this file except in compliance with\r
11  * the License. You may obtain a copy of the License at\r
12  * http://www.mozilla.org/MPL/\r
13  *\r
14  * Software distributed under the License is distributed on an "AS IS" basis,\r
15  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License\r
16  * for the specific language governing rights and limitations under the\r
17  * License.\r
18  *\r
19  * The Original Code is Netscape code.\r
20  *\r
21  * The Initial Developer of the Original Code is\r
22  * Netscape Corporation.\r
23  * Portions created by the Initial Developer are Copyright (C) 2001\r
24  * the Initial Developer. All Rights Reserved.\r
25  *\r
26  * Contributor(s): Bob Clary <bclary@netscape.com>\r
27  *\r
28  * ***** END LICENSE BLOCK ***** */\r
29 \r
30 /////////////////////////////////////////////////////////////\r
31 // xbStyle.getClip()\r
32 \r
33 function nsxbStyleGetClip()\r
34 {\r
35   var clip = this.styleObj.clip;\r
36   var rect = new xbClipRect(clip.top, clip.right, clip.bottom, clip.left);\r
37   return rect.toString();\r
38 }\r
39 \r
40 /////////////////////////////////////////////////////////////\r
41 // xbStyle.setClip()\r
42 \r
43 function nsxbStyleSetClip(sClipString)\r
44 {\r
45   var rect          = new xbClipRect(sClipString);\r
46   this.styleObj.clip.top    = rect.top;\r
47   this.styleObj.clip.right  = rect.right;\r
48   this.styleObj.clip.bottom  = rect.bottom;\r
49   this.styleObj.clip.left    = rect.left;\r
50 }\r
51 \r
52 /////////////////////////////////////////////////////////////\r
53 // xbStyle.getClipTop()\r
54 \r
55 function nsxbStyleGetClipTop()\r
56 {\r
57   return this.styleObj.clip.top;\r
58 }\r
59 \r
60 /////////////////////////////////////////////////////////////\r
61 // xbStyle.setClipTop()\r
62 \r
63 function nsxbStyleSetClipTop(top)\r
64 {\r
65   return this.styleObj.clip.top = top;\r
66 }\r
67 \r
68 /////////////////////////////////////////////////////////////\r
69 // xbStyle.getClipRight()\r
70 \r
71 function nsxbStyleGetClipRight()\r
72 {\r
73   return this.styleObj.clip.right;\r
74 }\r
75 \r
76 /////////////////////////////////////////////////////////////\r
77 // xbStyle.setClipRight()\r
78 \r
79 function nsxbStyleSetClipRight(right)\r
80 {\r
81   return this.styleObj.clip.right = right;\r
82 }\r
83 \r
84 /////////////////////////////////////////////////////////////\r
85 // xbStyle.getClipBottom()\r
86 \r
87 function nsxbStyleGetClipBottom()\r
88 {\r
89   return this.styleObj.clip.bottom;\r
90 }\r
91 \r
92 /////////////////////////////////////////////////////////////\r
93 // xbStyle.setClipBottom()\r
94 \r
95 function nsxbStyleSetClipBottom(bottom)\r
96 {\r
97   return this.styleObj.clip.bottom = bottom;\r
98 }\r
99 \r
100 /////////////////////////////////////////////////////////////\r
101 // xbStyle.getClipLeft()\r
102 \r
103 function nsxbStyleGetClipLeft()\r
104 {\r
105   return this.styleObj.clip.left;\r
106 }\r
107 \r
108 /////////////////////////////////////////////////////////////\r
109 // xbStyle.setClipLeft()\r
110 \r
111 function nsxbStyleSetClipLeft(left)\r
112 {\r
113   return this.styleObj.clip.left = left;\r
114 }\r
115 \r
116 /////////////////////////////////////////////////////////////\r
117 // xbStyle.getClipWidth()\r
118 \r
119 function nsxbStyleGetClipWidth()\r
120 {\r
121   return this.styleObj.clip.width;\r
122 }\r
123 \r
124 /////////////////////////////////////////////////////////////\r
125 // xbStyle.setClipWidth()\r
126 \r
127 function nsxbStyleSetClipWidth(width)\r
128 {\r
129   return this.styleObj.clip.width = width;\r
130 }\r
131 \r
132 /////////////////////////////////////////////////////////////\r
133 // xbStyle.getClipHeight()\r
134 \r
135 function nsxbStyleGetClipHeight()\r
136 {\r
137   return this.styleObj.clip.height;\r
138 }\r
139 \r
140 /////////////////////////////////////////////////////////////\r
141 // xbStyle.setClipHeight()\r
142 \r
143 function nsxbStyleSetClipHeight(height)\r
144 {\r
145   return this.styleObj.clip.height = height;\r
146 }\r
147 \r
148 /////////////////////////////////////////////////////////////////////////////\r
149 // xbStyle.getLeft()\r
150 \r
151 function nsxbStyleGetLeft()\r
152 {\r
153   return this.styleObj.left;\r
154 }\r
155 \r
156 /////////////////////////////////////////////////////////////////////////////\r
157 // xbStyle.setLeft()\r
158 \r
159 function nsxbStyleSetLeft(left)\r
160 {\r
161   this.styleObj.left = left;\r
162 }\r
163 \r
164 /////////////////////////////////////////////////////////////////////////////\r
165 // xbStyle.getTop()\r
166 \r
167 function nsxbStyleGetTop()\r
168 {\r
169   return this.styleObj.top;\r
170 }\r
171 \r
172 /////////////////////////////////////////////////////////////////////////////\r
173 // xbStyle.setTop()\r
174 \r
175 function nsxbStyleSetTop(top)\r
176 {\r
177   this.styleObj.top = top;\r
178 }\r
179 \r
180 \r
181 /////////////////////////////////////////////////////////////////////////////\r
182 // xbStyle.getPageX()\r
183 \r
184 function nsxbStyleGetPageX()\r
185 {\r
186   return this.styleObj.pageX;\r
187 }\r
188 \r
189 /////////////////////////////////////////////////////////////////////////////\r
190 // xbStyle.setPageX()\r
191 \r
192 function nsxbStyleSetPageX(x)\r
193 {\r
194   this.styleObj.x = this.styleObj.x  + x - this.styleObj.pageX;\r
195 }\r
196 \r
197 /////////////////////////////////////////////////////////////////////////////\r
198 // xbStyle.getPageY()\r
199 \r
200 \r
201 function nsxbStyleGetPageY()\r
202 {\r
203   return this.styleObj.pageY;\r
204 }\r
205 \r
206 /////////////////////////////////////////////////////////////////////////////\r
207 // xbStyle.setPageY()\r
208 \r
209 function nsxbStyleSetPageY(y)\r
210 {\r
211   this.styleObj.y = this.styleObj.y  + y - this.styleObj.pageY;\r
212 }\r
213 \r
214 /////////////////////////////////////////////////////////////////////////////\r
215 // xbStyle.getHeight()\r
216 \r
217 function nsxbStyleGetHeight()\r
218 {\r
219   //if (this.styleObj.document && this.styleObj.document.height)\r
220   //  return this.styleObj.document.height;\r
221     \r
222   return this.styleObj.clip.height;\r
223 }\r
224 \r
225 /////////////////////////////////////////////////////////////////////////////\r
226 // xbStyle.setHeight()\r
227 \r
228 function nsxbStyleSetHeight(height)\r
229 {\r
230   this.styleObj.clip.height = height;\r
231 }\r
232 \r
233 /////////////////////////////////////////////////////////////////////////////\r
234 // xbStyle.getWidth()\r
235 \r
236 function nsxbStyleGetWidth()\r
237 {\r
238   //if (this.styleObj.document && this.styleObj.document.width)\r
239   //  return this.styleObj.document.width;\r
240     \r
241   return this.styleObj.clip.width;\r
242 }\r
243 \r
244 /////////////////////////////////////////////////////////////////////////////\r
245 // xbStyle.setWidth()\r
246 \r
247 // netscape will not dynamically change the width of a \r
248 // layer. It will only happen upon a refresh.\r
249 function nsxbStyleSetWidth(width)\r
250 {\r
251   this.styleObj.clip.width = width;\r
252 }\r
253 \r
254 /////////////////////////////////////////////////////////////////////////////\r
255 \r
256 /////////////////////////////////////////////////////////////////////////////\r
257 // xbStyle.getVisibility()\r
258 \r
259 function nsxbStyleGetVisibility()\r
260 {\r
261   switch(this.styleObj.visibility)\r
262   {\r
263   case 'hide':\r
264     return 'hidden';\r
265   case 'show':\r
266     return 'visible';\r
267   }\r
268   return '';\r
269 }\r
270 \r
271 /////////////////////////////////////////////////////////////////////////////\r
272 // xbStyle.setVisibility()\r
273 \r
274 function nsxbStyleSetVisibility(visibility)\r
275 {\r
276   switch(visibility)\r
277   {\r
278   case 'hidden':\r
279     visibility = 'hide';\r
280     break;\r
281   case 'visible':\r
282     visibility = 'show';\r
283     break;\r
284   case 'inherit':\r
285     break;\r
286   default:\r
287     visibility = 'show';\r
288     break;\r
289   }\r
290   this.styleObj.visibility = visibility;\r
291 }\r
292 \r
293 /////////////////////////////////////////////////////////////////////////////\r
294 // xbStyle.getzIndex()\r
295 \r
296 function nsxbStyleGetzIndex()\r
297 {\r
298   return this.styleObj.zIndex;\r
299 }\r
300 \r
301 /////////////////////////////////////////////////////////////////////////////\r
302 // xbStyle.setzIndex()\r
303 \r
304 function nsxbStyleSetzIndex(zIndex)\r
305 {\r
306   this.styleObj.zIndex = zIndex;\r
307 }\r
308 \r
309 /////////////////////////////////////////////////////////////////////////////\r
310 // xbStyle.getBackgroundColor()\r
311 \r
312 function nsxbStyleGetBackgroundColor()\r
313 {\r
314   return this.styleObj.bgColor;\r
315 }\r
316 \r
317 /////////////////////////////////////////////////////////////////////////////\r
318 // xbStyle.setBackgroundColor()\r
319 \r
320 function nsxbStyleSetBackgroundColor(color)\r
321 {\r
322   if (color)\r
323   {\r
324     this.styleObj.bgColor = color;\r
325     this.object.document.bgColor = color;\r
326     this.resizeTo(this.getWidth(), this.getHeight());\r
327   }\r
328 }\r
329 \r
330 /////////////////////////////////////////////////////////////////////////////\r
331 // xbStyle.getColor()\r
332 \r
333 function nsxbStyleGetColor()\r
334 {\r
335   return '#ffffff';\r
336 }\r
337 \r
338 /////////////////////////////////////////////////////////////////////////////\r
339 // xbStyle.setColor()\r
340 \r
341 function nsxbStyleSetColor(color)\r
342 {\r
343   this.object.document.fgColor = color;\r
344 }\r
345 \r
346 \r
347 /////////////////////////////////////////////////////////////////////////////\r
348 // xbStyle.moveAbove()\r
349 \r
350 function xbStyleMoveAbove(cont)\r
351 {\r
352   this.setzIndex(cont.getzIndex()+1);\r
353 }\r
354 \r
355 /////////////////////////////////////////////////////////////////////////////\r
356 // xbStyle.moveBelow()\r
357 \r
358 function xbStyleMoveBelow(cont)\r
359 {\r
360   var zindex = cont.getzIndex() - 1;\r
361             \r
362   this.setzIndex(zindex);\r
363 }\r
364 \r
365 /////////////////////////////////////////////////////////////////////////////\r
366 // xbStyle.moveBy()\r
367 \r
368 function xbStyleMoveBy(deltaX, deltaY)\r
369 {\r
370   this.moveTo(this.getLeft() + deltaX, this.getTop() + deltaY);\r
371 }\r
372 \r
373 /////////////////////////////////////////////////////////////////////////////\r
374 // xbStyle.moveTo()\r
375 \r
376 function xbStyleMoveTo(x, y)\r
377 {\r
378   this.setLeft(x);\r
379   this.setTop(y);\r
380 }\r
381 \r
382 /////////////////////////////////////////////////////////////////////////////\r
383 // xbStyle.moveToAbsolute()\r
384 \r
385 function xbStyleMoveToAbsolute(x, y)\r
386 {\r
387   this.setPageX(x);\r
388   this.setPageY(y);\r
389 }\r
390 \r
391 /////////////////////////////////////////////////////////////////////////////\r
392 // xbStyle.resizeBy()\r
393 \r
394 function xbStyleResizeBy(deltaX, deltaY)\r
395 {\r
396   this.setWidth( this.getWidth() + deltaX );\r
397   this.setHeight( this.getHeight() + deltaY );\r
398 }\r
399 \r
400 /////////////////////////////////////////////////////////////////////////////\r
401 // xbStyle.resizeTo()\r
402 \r
403 function xbStyleResizeTo(x, y)\r
404 {\r
405   this.setWidth(x);\r
406   this.setHeight(y);\r
407 }\r
408 \r
409 ////////////////////////////////////////////////////////////////////////\r
410 // Navigator 4.x resizing...\r
411 \r
412 function nsxbStyleOnresize()\r
413 {\r
414     if (saveInnerWidth != xbGetWindowWidth() || saveInnerHeight != xbGetWindowHeight())\r
415     location.reload();\r
416 \r
417   return false;\r
418 }\r
419 \r
420 /////////////////////////////////////////////////////////////////////////////\r
421 // xbStyle.setInnerHTML()\r
422 \r
423 function nsxbSetInnerHTML(str)\r
424 {\r
425   this.object.document.open('text/html');\r
426   this.object.document.write(str);\r
427   this.object.document.close();\r
428 }\r
429 \r
430 xbStyle.prototype.getClip            = nsxbStyleGetClip;\r
431 xbStyle.prototype.setClip            = nsxbStyleSetClip;  \r
432 xbStyle.prototype.getClipTop         = nsxbStyleGetClipTop;\r
433 xbStyle.prototype.setClipTop         = nsxbStyleSetClipTop;  \r
434 xbStyle.prototype.getClipRight       = nsxbStyleGetClipRight;\r
435 xbStyle.prototype.setClipRight       = nsxbStyleSetClipRight;  \r
436 xbStyle.prototype.getClipBottom      = nsxbStyleGetClipBottom;\r
437 xbStyle.prototype.setClipBottom      = nsxbStyleSetClipBottom;  \r
438 xbStyle.prototype.getClipLeft        = nsxbStyleGetClipLeft;\r
439 xbStyle.prototype.setClipLeft        = nsxbStyleSetClipLeft;  \r
440 xbStyle.prototype.getClipWidth       = nsxbStyleGetClipWidth;\r
441 xbStyle.prototype.setClipWidth       = nsxbStyleSetClipWidth;  \r
442 xbStyle.prototype.getClipHeight      = nsxbStyleGetClipHeight;\r
443 xbStyle.prototype.setClipHeight      = nsxbStyleSetClipHeight;  \r
444 xbStyle.prototype.getLeft            = nsxbStyleGetLeft;\r
445 xbStyle.prototype.setLeft            = nsxbStyleSetLeft;\r
446 xbStyle.prototype.getTop             = nsxbStyleGetTop;\r
447 xbStyle.prototype.setTop             = nsxbStyleSetTop;\r
448 xbStyle.prototype.getPageX           = nsxbStyleGetPageX;\r
449 xbStyle.prototype.setPageX           = nsxbStyleSetPageX;\r
450 xbStyle.prototype.getPageY           = nsxbStyleGetPageY;\r
451 xbStyle.prototype.setPageY           = nsxbStyleSetPageY;\r
452 xbStyle.prototype.getVisibility      = nsxbStyleGetVisibility;\r
453 xbStyle.prototype.setVisibility      = nsxbStyleSetVisibility;\r
454 xbStyle.prototype.getzIndex          = nsxbStyleGetzIndex;\r
455 xbStyle.prototype.setzIndex          = nsxbStyleSetzIndex;            \r
456 xbStyle.prototype.getHeight          = nsxbStyleGetHeight;\r
457 xbStyle.prototype.setHeight          = nsxbStyleSetHeight;\r
458 xbStyle.prototype.getWidth           = nsxbStyleGetWidth;\r
459 xbStyle.prototype.setWidth           = nsxbStyleSetWidth;\r
460 xbStyle.prototype.getBackgroundColor = nsxbStyleGetBackgroundColor;\r
461 xbStyle.prototype.setBackgroundColor = nsxbStyleSetBackgroundColor;\r
462 xbStyle.prototype.getColor           = nsxbStyleGetColor;\r
463 xbStyle.prototype.setColor           = nsxbStyleSetColor;\r
464 xbStyle.prototype.setInnerHTML       = nsxbSetInnerHTML;\r
465 xbStyle.prototype.getBorderTopWidth    = xbStyleNotSupported;\r
466 xbStyle.prototype.getBorderRightWidth  = xbStyleNotSupported;\r
467 xbStyle.prototype.getBorderBottomWidth = xbStyleNotSupported;\r
468 xbStyle.prototype.getBorderLeftWidth   = xbStyleNotSupported;\r
469 xbStyle.prototype.getMarginLeft        = xbStyleNotSupported;\r
470 xbStyle.prototype.getMarginTop         = xbStyleNotSupported;\r
471 xbStyle.prototype.getMarginRight       = xbStyleNotSupported;\r
472 xbStyle.prototype.getMarginBottom      = xbStyleNotSupported;\r
473 xbStyle.prototype.getMarginLeft        = xbStyleNotSupported;\r
474 xbStyle.prototype.getPaddingTop        = xbStyleNotSupported;\r
475 xbStyle.prototype.getPaddingRight      = xbStyleNotSupported;\r
476 xbStyle.prototype.getPaddingBottom     = xbStyleNotSupported;\r
477 xbStyle.prototype.getPaddingLeft       = xbStyleNotSupported;\r
478 xbStyle.prototype.getClientWidth       = xbStyleNotSupported;\r
479 xbStyle.prototype.getClientHeight      = xbStyleNotSupported;\r
480 \r
481 window.saveInnerWidth = window.innerWidth;\r
482 window.saveInnerHeight = window.innerHeight;\r
483 \r
484 window.onresize = nsxbStyleOnresize;\r
485 \r