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 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485
|
/*
* xbStyle-nn4.js
* $Revision: 1.2 $ $Date: 2003/02/07 16:04:22 $
*/
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Netscape code.
*
* The Initial Developer of the Original Code is
* Netscape Corporation.
* Portions created by the Initial Developer are Copyright (C) 2001
* the Initial Developer. All Rights Reserved.
*
* Contributor(s): Bob Clary <bclary@netscape.com>
*
* ***** END LICENSE BLOCK ***** */
/////////////////////////////////////////////////////////////
// xbStyle.getClip()
function nsxbStyleGetClip()
{
var clip = this.styleObj.clip;
var rect = new xbClipRect(clip.top, clip.right, clip.bottom, clip.left);
return rect.toString();
}
/////////////////////////////////////////////////////////////
// xbStyle.setClip()
function nsxbStyleSetClip(sClipString)
{
var rect = new xbClipRect(sClipString);
this.styleObj.clip.top = rect.top;
this.styleObj.clip.right = rect.right;
this.styleObj.clip.bottom = rect.bottom;
this.styleObj.clip.left = rect.left;
}
/////////////////////////////////////////////////////////////
// xbStyle.getClipTop()
function nsxbStyleGetClipTop()
{
return this.styleObj.clip.top;
}
/////////////////////////////////////////////////////////////
// xbStyle.setClipTop()
function nsxbStyleSetClipTop(top)
{
return this.styleObj.clip.top = top;
}
/////////////////////////////////////////////////////////////
// xbStyle.getClipRight()
function nsxbStyleGetClipRight()
{
return this.styleObj.clip.right;
}
/////////////////////////////////////////////////////////////
// xbStyle.setClipRight()
function nsxbStyleSetClipRight(right)
{
return this.styleObj.clip.right = right;
}
/////////////////////////////////////////////////////////////
// xbStyle.getClipBottom()
function nsxbStyleGetClipBottom()
{
return this.styleObj.clip.bottom;
}
/////////////////////////////////////////////////////////////
// xbStyle.setClipBottom()
function nsxbStyleSetClipBottom(bottom)
{
return this.styleObj.clip.bottom = bottom;
}
/////////////////////////////////////////////////////////////
// xbStyle.getClipLeft()
function nsxbStyleGetClipLeft()
{
return this.styleObj.clip.left;
}
/////////////////////////////////////////////////////////////
// xbStyle.setClipLeft()
function nsxbStyleSetClipLeft(left)
{
return this.styleObj.clip.left = left;
}
/////////////////////////////////////////////////////////////
// xbStyle.getClipWidth()
function nsxbStyleGetClipWidth()
{
return this.styleObj.clip.width;
}
/////////////////////////////////////////////////////////////
// xbStyle.setClipWidth()
function nsxbStyleSetClipWidth(width)
{
return this.styleObj.clip.width = width;
}
/////////////////////////////////////////////////////////////
// xbStyle.getClipHeight()
function nsxbStyleGetClipHeight()
{
return this.styleObj.clip.height;
}
/////////////////////////////////////////////////////////////
// xbStyle.setClipHeight()
function nsxbStyleSetClipHeight(height)
{
return this.styleObj.clip.height = height;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getLeft()
function nsxbStyleGetLeft()
{
return this.styleObj.left;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setLeft()
function nsxbStyleSetLeft(left)
{
this.styleObj.left = left;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getTop()
function nsxbStyleGetTop()
{
return this.styleObj.top;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setTop()
function nsxbStyleSetTop(top)
{
this.styleObj.top = top;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getPageX()
function nsxbStyleGetPageX()
{
return this.styleObj.pageX;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setPageX()
function nsxbStyleSetPageX(x)
{
this.styleObj.x = this.styleObj.x + x - this.styleObj.pageX;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getPageY()
function nsxbStyleGetPageY()
{
return this.styleObj.pageY;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setPageY()
function nsxbStyleSetPageY(y)
{
this.styleObj.y = this.styleObj.y + y - this.styleObj.pageY;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getHeight()
function nsxbStyleGetHeight()
{
//if (this.styleObj.document && this.styleObj.document.height)
// return this.styleObj.document.height;
return this.styleObj.clip.height;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setHeight()
function nsxbStyleSetHeight(height)
{
this.styleObj.clip.height = height;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getWidth()
function nsxbStyleGetWidth()
{
//if (this.styleObj.document && this.styleObj.document.width)
// return this.styleObj.document.width;
return this.styleObj.clip.width;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setWidth()
// netscape will not dynamically change the width of a
// layer. It will only happen upon a refresh.
function nsxbStyleSetWidth(width)
{
this.styleObj.clip.width = width;
}
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getVisibility()
function nsxbStyleGetVisibility()
{
switch(this.styleObj.visibility)
{
case 'hide':
return 'hidden';
case 'show':
return 'visible';
}
return '';
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setVisibility()
function nsxbStyleSetVisibility(visibility)
{
switch(visibility)
{
case 'hidden':
visibility = 'hide';
break;
case 'visible':
visibility = 'show';
break;
case 'inherit':
break;
default:
visibility = 'show';
break;
}
this.styleObj.visibility = visibility;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getzIndex()
function nsxbStyleGetzIndex()
{
return this.styleObj.zIndex;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setzIndex()
function nsxbStyleSetzIndex(zIndex)
{
this.styleObj.zIndex = zIndex;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getBackgroundColor()
function nsxbStyleGetBackgroundColor()
{
return this.styleObj.bgColor;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setBackgroundColor()
function nsxbStyleSetBackgroundColor(color)
{
if (color)
{
this.styleObj.bgColor = color;
this.object.document.bgColor = color;
this.resizeTo(this.getWidth(), this.getHeight());
}
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.getColor()
function nsxbStyleGetColor()
{
return '#ffffff';
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setColor()
function nsxbStyleSetColor(color)
{
this.object.document.fgColor = color;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.moveAbove()
function xbStyleMoveAbove(cont)
{
this.setzIndex(cont.getzIndex()+1);
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.moveBelow()
function xbStyleMoveBelow(cont)
{
var zindex = cont.getzIndex() - 1;
this.setzIndex(zindex);
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.moveBy()
function xbStyleMoveBy(deltaX, deltaY)
{
this.moveTo(this.getLeft() + deltaX, this.getTop() + deltaY);
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.moveTo()
function xbStyleMoveTo(x, y)
{
this.setLeft(x);
this.setTop(y);
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.moveToAbsolute()
function xbStyleMoveToAbsolute(x, y)
{
this.setPageX(x);
this.setPageY(y);
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.resizeBy()
function xbStyleResizeBy(deltaX, deltaY)
{
this.setWidth( this.getWidth() + deltaX );
this.setHeight( this.getHeight() + deltaY );
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.resizeTo()
function xbStyleResizeTo(x, y)
{
this.setWidth(x);
this.setHeight(y);
}
////////////////////////////////////////////////////////////////////////
// Navigator 4.x resizing...
function nsxbStyleOnresize()
{
if (saveInnerWidth != xbGetWindowWidth() || saveInnerHeight != xbGetWindowHeight())
location.reload();
return false;
}
/////////////////////////////////////////////////////////////////////////////
// xbStyle.setInnerHTML()
function nsxbSetInnerHTML(str)
{
this.object.document.open('text/html');
this.object.document.write(str);
this.object.document.close();
}
xbStyle.prototype.getClip = nsxbStyleGetClip;
xbStyle.prototype.setClip = nsxbStyleSetClip;
xbStyle.prototype.getClipTop = nsxbStyleGetClipTop;
xbStyle.prototype.setClipTop = nsxbStyleSetClipTop;
xbStyle.prototype.getClipRight = nsxbStyleGetClipRight;
xbStyle.prototype.setClipRight = nsxbStyleSetClipRight;
xbStyle.prototype.getClipBottom = nsxbStyleGetClipBottom;
xbStyle.prototype.setClipBottom = nsxbStyleSetClipBottom;
xbStyle.prototype.getClipLeft = nsxbStyleGetClipLeft;
xbStyle.prototype.setClipLeft = nsxbStyleSetClipLeft;
xbStyle.prototype.getClipWidth = nsxbStyleGetClipWidth;
xbStyle.prototype.setClipWidth = nsxbStyleSetClipWidth;
xbStyle.prototype.getClipHeight = nsxbStyleGetClipHeight;
xbStyle.prototype.setClipHeight = nsxbStyleSetClipHeight;
xbStyle.prototype.getLeft = nsxbStyleGetLeft;
xbStyle.prototype.setLeft = nsxbStyleSetLeft;
xbStyle.prototype.getTop = nsxbStyleGetTop;
xbStyle.prototype.setTop = nsxbStyleSetTop;
xbStyle.prototype.getPageX = nsxbStyleGetPageX;
xbStyle.prototype.setPageX = nsxbStyleSetPageX;
xbStyle.prototype.getPageY = nsxbStyleGetPageY;
xbStyle.prototype.setPageY = nsxbStyleSetPageY;
xbStyle.prototype.getVisibility = nsxbStyleGetVisibility;
xbStyle.prototype.setVisibility = nsxbStyleSetVisibility;
xbStyle.prototype.getzIndex = nsxbStyleGetzIndex;
xbStyle.prototype.setzIndex = nsxbStyleSetzIndex;
xbStyle.prototype.getHeight = nsxbStyleGetHeight;
xbStyle.prototype.setHeight = nsxbStyleSetHeight;
xbStyle.prototype.getWidth = nsxbStyleGetWidth;
xbStyle.prototype.setWidth = nsxbStyleSetWidth;
xbStyle.prototype.getBackgroundColor = nsxbStyleGetBackgroundColor;
xbStyle.prototype.setBackgroundColor = nsxbStyleSetBackgroundColor;
xbStyle.prototype.getColor = nsxbStyleGetColor;
xbStyle.prototype.setColor = nsxbStyleSetColor;
xbStyle.prototype.setInnerHTML = nsxbSetInnerHTML;
xbStyle.prototype.getBorderTopWidth = xbStyleNotSupported;
xbStyle.prototype.getBorderRightWidth = xbStyleNotSupported;
xbStyle.prototype.getBorderBottomWidth = xbStyleNotSupported;
xbStyle.prototype.getBorderLeftWidth = xbStyleNotSupported;
xbStyle.prototype.getMarginLeft = xbStyleNotSupported;
xbStyle.prototype.getMarginTop = xbStyleNotSupported;
xbStyle.prototype.getMarginRight = xbStyleNotSupported;
xbStyle.prototype.getMarginBottom = xbStyleNotSupported;
xbStyle.prototype.getMarginLeft = xbStyleNotSupported;
xbStyle.prototype.getPaddingTop = xbStyleNotSupported;
xbStyle.prototype.getPaddingRight = xbStyleNotSupported;
xbStyle.prototype.getPaddingBottom = xbStyleNotSupported;
xbStyle.prototype.getPaddingLeft = xbStyleNotSupported;
xbStyle.prototype.getClientWidth = xbStyleNotSupported;
xbStyle.prototype.getClientHeight = xbStyleNotSupported;
window.saveInnerWidth = window.innerWidth;
window.saveInnerHeight = window.innerHeight;
window.onresize = nsxbStyleOnresize;
|