geom/doc/salome/gui/GEOM/whmozemu.js

67 lines
2.0 KiB
JavaScript
Raw Normal View History

2004-12-17 16:18:33 +05:00
// WebHelp 5.10.002
2004-06-16 21:45:26 +06:00
if (! window.gbIE4 && window.gbNav6 && !document.childNodes[0].insertAdjacentHTML){
HTMLElement.prototype.insertAdjacentElement = function(where,parsedNode)
{
switch (where){
case 'beforeBegin':
2004-12-17 16:18:33 +05:00
this.parentNode.insertBefore(parsedNode,this);
2004-06-16 21:45:26 +06:00
break;
case 'afterBegin':
this.insertBefore(parsedNode,this.firstChild);
break;
case 'beforeEnd':
this.appendChild(parsedNode);
break;
case 'afterEnd':
if (this.nextSibling){
2004-12-17 16:18:33 +05:00
this.parentNode.insertBefore(parsedNode,this.nextSibling);
2004-06-16 21:45:26 +06:00
} else {
2004-12-17 16:18:33 +05:00
this.parentNode.appendChild(parsedNode);
2004-06-16 21:45:26 +06:00
}
break;
}
}
HTMLElement.prototype.insertAdjacentHTML = function(where,htmlStr){
var r = this.ownerDocument.createRange();
r.setStartBefore(this);
var parsedHTML = r.createContextualFragment(htmlStr);
2004-12-17 16:18:33 +05:00
this.insertAdjacentElement(where,parsedHTML);
2004-06-16 21:45:26 +06:00
}
HTMLElement.prototype.insertAdjacentText = function(where,txtStr){
2004-12-17 16:18:33 +05:00
var parsedText = document.createTextNode(txtStr);
this.insertAdjacentElement(where,parsedText);
2004-06-16 21:45:26 +06:00
}
}
function testScroll() {
// Initialize scrollbar cache if necessary
if (window._pageXOffset==null) {
2004-12-17 16:18:33 +05:00
window._pageXOffset = window.pageXOffset;
window._pageYOffset = window.pageYOffset;
2004-06-16 21:45:26 +06:00
}
// Expose Internet Explorer compatible object model
2004-12-17 16:18:33 +05:00
document.scrollTop = window.pageYOffset;
document.scrollLeft = window.pageXOffset;
window.document.scrollHeight = document.height;
window.document.scrollWidth = document.width;
window.document.clientWidth = window.innerWidth;
window.document.clientHeight = window.innerHeight;
2004-06-16 21:45:26 +06:00
// If cache!=current values, call the onscroll event
2004-12-17 16:18:33 +05:00
if (((window.pageXOffset!=window._pageXOffset) || (window.pageYOffset!=window._pageYOffset)) && (window.onscroll))
window.onscroll();
2004-06-16 21:45:26 +06:00
// Cache new values
2004-12-17 16:18:33 +05:00
window._pageXOffset = window.pageXOffset;
window._pageYOffset = window.pageYOffset;
2004-06-16 21:45:26 +06:00
}
// Create compatibility layer for Netscape
2004-12-17 16:18:33 +05:00
if (window.gbNav6 && !window.gbNav7) {
2004-06-16 21:45:26 +06:00
setInterval("testScroll()",50)
}