browserWindow.js 13.3 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 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 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618
/*******************************************************************************
 * Copyright (c) 2008, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
function BarProp(){};
BarProp.prototype = new Array();

/**
 * Object Window()
 * @super Global
 * @constructor
 * @since Common Usage, no standard
*/
function Window(){};
Window.prototype = new EventTarget();
Window.prototype.self = new Window();
Window.prototype.window = new Window();
Window.prototype.frames = new Array();
/**
 * Property closed
 * @type Boolean
 * @memberOf Window
 */
Window.prototype.closed = new Boolean();
/**
 * Property defaultStatus
 * @type String
 * @memberOf Window
 */
Window.prototype.defaultStatus = "";
/**
 * Property document
 * @type Document
 * @memberOf Window
 */
Window.prototype.document= new HTMLDocument();
/**
 * Property history
 * @type History
 * @memberOf Window
 */
Window.prototype.history= new History();
/**
 * Property location
 * @type Location
 * @memberOf Window
 */
Window.prototype.location=new Location();
/**
 * Property name
 * @type String
 * @memberOf Window
 */
Window.prototype.name = "";
/**
 * Property navigator
 * @type Navigator
 * @memberOf Window
 */
Window.prototype.navigator = new Navigator();
/**
 * Property opener
 * @type Window
 * @memberOf Window
 */
Window.prototype.opener = new Window();
/**
 * Property outerWidth
 * @type Number
 * @memberOf Window
 */
Window.prototype.outerWidth = 0;
/**
 * Property outerHeight
 * @type Number
 * @memberOf Window
 */
Window.prototype.outerHeight = 0;
/**
 * Property pageXOffset
 * @type Number
 * @memberOf Window
 */
Window.prototype.pageXOffset = 0;
/**
 * Property pageYOffset
 * @type Number
 * @memberOf Window
 */
Window.prototype.pageYOffset = 0;
/**
 * Property parent
 * @type Window
 * @memberOf Window
 */
Window.prototype.parent = new Window();
/**
 * Property screen
 * @type Screen
 * @memberOf Window
 */
Window.prototype.screen = new Screen();
/**
 * Property status
 * @type String
 * @memberOf Window
 */
Window.prototype.status = "";
/**
 * Property top
 * @type Window
 * @memberOf Window
 */
Window.prototype.top = new Window();


/*
 * These properties may need to be moved into a browswer specific library.
 */

 /**
 * Property innerWidth
 * @type Number
 * @memberOf Window
 */
Window.prototype.innerWidth = 0;
/**
 * Property innerHeight
 * @type Number
 * @memberOf Window
 */
Window.prototype.innerHeight = 0;
/**
 * Property screenX
 * @type Number
 * @memberOf Window
 */
Window.prototype.screenX = 0;
/**
 * Property screenY
 * @type Number
 * @memberOf Window
 */
Window.prototype.screenY = 0;
/**
 * Property screenLeft
 * @type Number
 * @memberOf Window
 */
Window.prototype.screenLeft = 0;
/**
 * Property screenTop
 * @type Number
 * @memberOf Window
 */
Window.prototype.screenTop = 0;
//Window.prototype.event = new Event();
Window.prototype.length = 0;
Window.prototype.scrollbars= new BarProp();
Window.prototype.scrollX=0;
Window.prototype.scrollY=0;
Window.prototype.content= new Window();
Window.prototype.menubar= new BarProp();
Window.prototype.toolbar= new BarProp();
Window.prototype.locationbar= new BarProp();
Window.prototype.personalbar= new BarProp();
Window.prototype.statusbar= new BarProp();
Window.prototype.directories= new BarProp();
Window.prototype.scrollMaxX=0;
Window.prototype.scrollMaxY=0;
Window.prototype.fullScreen="";
Window.prototype.frameElement="";
/* End properites */

/**
 * function alert() 
 * @param {String} message
 * @memberOf Window
 */
Window.prototype.alert = function(message){};
/**
 * function blur() 
 * @memberOf Window
 */
Window.prototype.blur = function(){};
/**
 * function clearInterval(intervalID) 
 * @param intervalID
 * @memberOf Window
 */
Window.prototype.clearInterval = function(intervalID){};
/**
 * function clearTimeout(intervalID) 
 * @param intervalID
 * @memberOf Window
 */
Window.prototype.clearTimeout = function(intervalID){};
/**
 * function close() 
 * @memberOf Window
 */
Window.prototype.close = function(){};
/**
 * function confirm() 
 * @param {String} arg
 * @memberOf Window
 * @returns {Boolean}
 */
Window.prototype.confirm = function(arg){return false;};
/**
 * function focus() 
 * @memberOf Window
 */
Window.prototype.focus = function(){};
/**
 * function getComputedStyle(element, pseudoElt ) 
 * @param {Element} element
 * @param {String} pseudoElt 
 * @memberOf Window
 * @returns {Object}
 */
Window.prototype.getComputedStyle = function(element,pseudoElt ){return new Object();};
/**
 * function moveTo(x, y) 
 * @param {Number} x
 * @param {Number} y
 * @memberOf Window
 */
Window.prototype.moveTo = function(x,y){};
/**
 * function moveBy(deltaX, deltaY) 
 * @param {Number} deltaX
 * @param {Number} deltaY
 * @memberOf Window
 */
Window.prototype.moveBy = function(deltaX,deltaY){};
/**
 * function open(optionalArg1, optionalArg2, optionalArg3, optionalArg4) 
 * @param {String} url
 * @param {String} windowName
 * @param {String} windowFeatures
 * @param {Boolean} optionalArg4
 * @memberOf Window
 * @returns {Window}
 */
Window.prototype.open = function(url, windowName, windowFeatures, optionalArg4){return new Window();};
/**
 * function print() 
 * @memberOf Window
 */
Window.prototype.print = function(){};
/**
 * function prompt(text, value) 
 * @param {String} text
 * @param {String} value
 * @memberOf Window
 * @returns {String}
 */
Window.prototype.prompt = function(text, value){return "";};
/**
 * function resizeTo(newOuterWidth,newOuterHeight) 
 * @param {Number} newOuterWidth
 * @param {Number} newOuterHeighr
 * @memberOf Window
 */
Window.prototype.resizeTo=function(newOuterWidth,newOuterHeight){};
/**
 * function resizeBy(deltaX, deltaY) 
 * @param {Number} deltaX
 * @param {Number} deltaY
 * @memberOf Window
 */
Window.prototype.resizeBy=function(deltaX,deltaY){};
/**
 * function scrollTo(x,y) 
 * @param {Number} x
 * @param {Number} y
 * @memberOf Window
 */
Window.prototype.scrollTo=function(x,y){};
/**
 * function scrollBy(pixelX,pixelY) 
 * @param {Number} pixelX
 * @param {Number} pixelY
 * @memberOf Window
 */
Window.prototype.scrollBy=function(pixelX,pixelY){};
/**
 * function setInterval(arg1, arg2) 
 * @param {Function} callback
 * @param {Number} delay
 * @memberOf Window
 * @returns {Number}
 */
Window.prototype.setInterval=function(callback, delay){return 0;};
/**
 * function setTimeout(callback, delay) 
 * @param {Function} callback
 * @param {Number} delay
 * @memberOf Window
 * @returns {Number}
 */
Window.prototype.setTimeout=function(callback, delay){ return 0;};
/**
 * function atob(encodedData) 
 * @param {String} encodedData
 * @memberOf Window
 * @returns {String}
 */
Window.prototype.atob=function(encodedData){return "";};
/**
 * function btoa(arg) 
 * @param {String} stringToEncode
 * @memberOf Window
 * @returns {String}
 */
Window.prototype.btoa=function(stringToEncode){return "";};
/**
 * function setResizable(resizable) 
 * @param {Boolean} resizable
 * @memberOf Window
 */
Window.prototype.setResizable=function(resizable){};

Window.prototype.captureEvents=function(eventType){};
Window.prototype.releaseEvents=function(eventType){};
Window.prototype.routeEvent=function(eventType){};
Window.prototype.enableExternalCapture=function(){};
Window.prototype.disableExternalCapture=function(){};
Window.prototype.find=function(){};
Window.prototype.back=function(){};
Window.prototype.forward=function(){};
Window.prototype.home=function(){};
Window.prototype.stop=function(){};
/**
 * @param {Number} pixelX
 * @param {Number} pixelY
 */
Window.prototype.scroll=function(pixelX,pixelY){};
/* End functions */

/**
  * Object History()
  * @super Object
  * @constructor
  * @since Common Usage, no standard
 */
function History(){};
History.prototype=new Object();
History.prototype.history = new History();
/**
 * Property length
 * @type Number
 * @memberOf History
 */
History.prototype.length = 0;
/**
 * function back()
 * @memberOf History
 */
History.prototype.back = function(){};
/**
 * function forward()
 * @memberOf History
 */
History.prototype.forward = function(){};
/**
 * function back()
 * @param arg
 * @memberOf History
 */
History.prototype.go = function(arg){};

/**
  * Object Location()
  * @super Object
  * @constructor
  * @since Common Usage, no standard
 */
function Location(){};
Location.prototype = new Object();
Location.prototype.location = new Location();
/**
 * Property hash
 * @type String
 * @memberOf Location
 */
Location.prototype.hash = "";
/**
 * Property host
 * @type String
 * @memberOf Location
 */
Location.prototype.host = "";
/**
 * Property hostname
 * @type String
 * @memberOf Location
 */
Location.prototype.hostname = "";
/**
 * Property href
 * @type String
 * @memberOf Location
 */
Location.prototype.href = "";
/**
 * Property pathname
 * @type String
 * @memberOf Location
 */
Location.prototype.pathname = "";
/**
 * Property port
 * @type String
 * @memberOf Location
 */
Location.prototype.port = "";
/**
 * Property protocol
 * @type String
 * @memberOf Location
 */
Location.prototype.protocol = "";
/**
 * Property search
 * @type String
 * @memberOf Location
 */
Location.prototype.search = "";
/**
 * function assign(arg)
 * @param {String} arg
 * @memberOf Location
 */
Location.prototype.assign = function(arg){};
/**
 * function reload(optionalArg)
 * @param {Boolean} optionalArg
 * @memberOf Location
 */
Location.prototype.reload = function(optionalArg){};
/**
 * function replace(arg)
 * @param {String} arg
 * @memberOf Location
 */
Location.prototype.replace = function(arg){};

/**
 * Object Navigator()
 * @super Object
 * @constructor
 * @since Common Usage, no standard
*/
function Navigator(){};
Navigator.prototype = new Object();
Navigator.prototype.navigator = new Navigator();
/**
 * Property appCodeName
 * @type String
 * @memberOf Navigator
 */
Navigator.prototype.appCodeName = "";
/**
 * Property appName
 * @type String
 * @memberOf Navigator
 */
Navigator.prototype.appName = "";
/**
 * Property appVersion
 * @type String
 * @memberOf Navigator
 */
Navigator.prototype.appVersion = "";
/**
 * Property cookieEnabled
 * @type Boolean
 * @memberOf Navigator
 */
Navigator.prototype.cookieEnabled = new Boolean();
/**
 * Property mimeTypes
 * @type Array
 * @memberOf Navigator
 */
Navigator.prototype.mimeTypes = new Array();
/**
 * Property platform
 * @type String
 * @memberOf Navigator
 */
Navigator.prototype.platform = "";
/**
 * Property plugins
 * @type Array
 * @memberOf Navigator
 */
Navigator.prototype.plugins = new Array();
/**
 * Property userAgent
 * @type String
 * @memberOf Navigator
 */
Navigator.prototype.userAgent = "";
/**
 * function javaEnabled()
 * @returns {Boolean}
 * @memberOf Navigator
 */
Navigator.prototype.javaEnabled = function(){return false;};

/**
 * Object Screen()
 * @super Object
 * @constructor
 * @since Common Usage, no standard
*/
function Screen(){};
Screen.prototype = new Object();
Screen.prototype.screen = new Screen();
/**
 * Property availHeight
 * @type Number
 * @memberOf Screen
 */
Navigator.prototype.availHeight = 0;
/**
 * Property availWidth
 * @type Number
 * @memberOf Screen
 */
Navigator.prototype.availWidth = 0;
/**
 * Property colorDepth
 * @type Number
 * @memberOf Screen
 */
Navigator.prototype.colorDepth = 0;
/**
 * Property height
 * @type Number
 * @memberOf Screen
 */
Navigator.prototype.height = 0;
/**
 * Property width
 * @type Number
 * @memberOf Screen
 */
Navigator.prototype.width = 0;

Event.prototype=new Object();
// PhaseType
Event.prototype.CAPTURING_PHASE = 1;
Event.prototype.AT_TARGET = 2;
Event.prototype.BUBBLING_PHASE = 3;

Event.prototype.type="";
Event.prototype.target=new EventTarget();
Event.prototype.currentTarget=new EventTarget();
Event.prototype.eventPhase=0;
Event.prototype.bubbles=false;
Event.prototype.cancelable=false;
Event.prototype.timeStamp=0;
Event.prototype.stopPropagation=function(){};
Event.prototype.preventDefault=function(){};
/**
 * @param {String} eventTypeArg
 * @param {Boolean} canBubbleArg
 * @param {Boolean} cancelableArg
 */
Event.prototype.initEvent=function(eventTypeArg, 
                             canBubbleArg, 
                             cancelableArg){};
function EventListener(){};
EventListener.prototype=new Object();
/**
 * @param {Event} event
 * @memberOf EventListener
 */
EventListener.prototype.handleEvent=function(event){};

function EventTarget(){};
EventTarget.prototype=new Object();
/*
 * These functions may need to be moved into a browser specific library.
 */
/**
 * @memberOf Window
 * @param event {Event}
 * @throws {EventException}
 */
EventTarget.prototype.dispatchEvent=function(event){};

// https://developer.mozilla.org/en-US/docs/DOM/element.addEventListener
/**
 * @memberOf Window
 * @param {String} type
 * @param {EventListener} listener
 * @param {Boolean} useCapture
 */
EventTarget.prototype.addEventListener=function(type, listener, useCapture){};
// https://developer.mozilla.org/en-US/docs/DOM/element.removeEventListener
/**
 * @memberOf Window
 * @param {String} type
 * @param {EventListener} listener
 * @param {Boolean} useCapture
 */
EventTarget.prototype.removeEventListener=function(type, listener, useCapture){};