version 1.6, 2005/11/08 18:10:10
|
version 1.12, 2008/10/29 01:00:56
|
Line 17 Foundation, Inc., 59 Temple Place - Suit
|
Line 17 Foundation, Inc., 59 Temple Place - Suit
|
Authors: |
Authors: |
Christian Luginbuehl, 01.05.2003 (first version) |
Christian Luginbuehl, 01.05.2003 (first version) |
DW 24.03.2004 (Changed for digiLib in Zope) |
DW 24.03.2004 (Changed for digiLib in Zope) |
Robert Casties, 2.11.2004 |
Robert Casties, 22.1.2008 |
|
|
*/ |
*/ |
|
|
function base_init() { |
function base_init() { |
// init function |
// init function |
baseScriptVersion = "1.2"; |
baseScriptVersion = "1.2.4"; |
dlParams = new Object(); |
dlParams = new Object(); |
browserType = getBrowserType(); |
browserType = getBrowserType(); |
} |
} |
Line 376 function getElementPosition(elem) {
|
Line 376 function getElementPosition(elem) {
|
// returns a Position with the position of the element |
// returns a Position with the position of the element |
var x = 0; |
var x = 0; |
var y = 0; |
var y = 0; |
if (defined(elem.offsetLeft)) { |
if (defined(elem.offsetParent)) { |
|
// use .offsetLeft for most browsers |
var e = elem; |
var e = elem; |
while (e) { |
while (e) { |
if (defined(e.clientLeft)) { |
if (browserType.isIE) { |
// special for IE |
|
if (browserType.isMac) { |
if (browserType.isMac) { |
if (e.offsetParent.tagName == "BODY") { |
|
// IE for Mac extraspecial |
// IE for Mac extraspecial |
|
if (e.offsetParent.tagName == "BODY") { |
x += e.clientLeft; |
x += e.clientLeft; |
y += e.clientTop; |
y += e.clientTop; |
break; |
break; |
} |
} |
} else { |
} else { |
|
// special for IE |
if ((e.tagName != "TABLE") && (e.tagName != "BODY")) { |
if ((e.tagName != "TABLE") && (e.tagName != "BODY")) { |
x += e.clientLeft; |
x += e.clientLeft; |
y += e.clientTop; |
y += e.clientTop; |
Line 400 function getElementPosition(elem) {
|
Line 401 function getElementPosition(elem) {
|
e = e.offsetParent; |
e = e.offsetParent; |
} |
} |
} else if (defined(elem.x)) { |
} else if (defined(elem.x)) { |
|
// use .x for other (which?) |
x = elem.x; |
x = elem.x; |
y = elem.y; |
y = elem.y; |
} else if (defined(elem.pageX)) { |
} else if (defined(elem.pageX)) { |
|
// use pageX for N4 |
x = elem.pageX; |
x = elem.pageX; |
y = elem.pageY; |
y = elem.pageY; |
} else { |
} else { |
Line 437 function getElementRect(elem) {
|
Line 440 function getElementRect(elem) {
|
return new Rectangle(pos.x, pos.y, size.width, size.height); |
return new Rectangle(pos.x, pos.y, size.width, size.height); |
} |
} |
|
|
|
|
|
|
function moveElement(elem, rect) { |
function moveElement(elem, rect) { |
// moves and sizes the element |
// moves and sizes the element |
if (elem.style) { |
if (elem.style) { |
Line 486 function showElement(elem, show) {
|
Line 487 function showElement(elem, show) {
|
return true; |
return true; |
} |
} |
|
|
|
function isElementVisible(elem) { |
|
// returns of the is shown or hidden |
|
if (elem.style) { |
|
return (elem.style.visibility == "visible"); |
|
} else if (defined(elem.visibility)) { |
|
return (elem.visibility == "show"); |
|
} else { |
|
alert("iselementvisible: no style nor layer property!"); |
|
} |
|
} |
|
|
function evtPosition(evt) { |
function evtPosition(evt) { |
// returns the on-screen Position of the Event |
// returns the on-screen Position of the Event |
var x; |
var x; |
Line 595 function registerKeyDown(handler) {
|
Line 607 function registerKeyDown(handler) {
|
function getWinSize() { |
function getWinSize() { |
// returns a Size with the current window size (mostly from www.quirksmode.org) |
// returns a Size with the current window size (mostly from www.quirksmode.org) |
var wsize = new Size(100, 100); |
var wsize = new Size(100, 100); |
if (defined(self.innerHeight)) { |
if (!browserType.isIE) { |
// all except Explorer |
// all except Explorer |
if ((self.innerWidth == 0)||(self.innerHeight == 0)) { |
if ((self.innerWidth == 0)||(self.innerHeight == 0)) { |
// Safari 1.2 bug |
// Safari 1.2 (and other) bug |
if (parent) { |
if (parent) { |
parent.innerHeight; |
wsize.height = parent.innerHeight; |
parent.innerWidth; |
wsize.width = parent.innerWidth; |
} |
|
} |
} |
|
} else { |
wsize.width = self.innerWidth; |
wsize.width = self.innerWidth; |
wsize.height = self.innerHeight; |
wsize.height = self.innerHeight; |
|
} |
} else if (document.documentElement && document.documentElement.clientHeight) { |
} else if (document.documentElement && document.documentElement.clientHeight) { |
// Explorer 6 Strict Mode |
// Explorer 6 Strict Mode |
wsize.width = document.documentElement.clientWidth; |
wsize.width = document.documentElement.clientWidth; |