# HG changeset patch # User robcast # Date 1099329873 -3600 # Node ID 4074c0138cf0b0d10b42fb6e35baca2bdf9c920a # Parent 23866acd6509ecc5280a04d2bd2db16f91adedbf fixed bug with detecting window size in Safari 1.2 diff -r 23866acd6509 -r 4074c0138cf0 client/digitallibrary/baselib.js --- a/client/digitallibrary/baselib.js Mon Nov 01 18:24:33 2004 +0100 +++ b/client/digitallibrary/baselib.js Mon Nov 01 18:24:33 2004 +0100 @@ -17,7 +17,7 @@ Authors: Christian Luginbuehl, 01.05.2003 (first version) DW 24.03.2004 (Changed for digiLib in Zope) - Robert Casties, 27.10.2004 + Robert Casties, 1.11.2004 */ @@ -85,6 +85,10 @@ this.height = parseFloat(h); return this; } +Size.prototype.toString = function() { + return this.width + "x" + this.height; +} + /* * Position class @@ -94,6 +98,9 @@ this.y = parseFloat(y); return this; } +Position.prototype.toString = function() { + return this.x + "," + this.y; +} /* * Rectangle class @@ -105,6 +112,9 @@ this.height = parseFloat(h); return this; } +Rectangle.prototype.toString = function() { + return this.width+"x"+this.height+"@"+this.x+","+this.y; +} Rectangle.prototype.copy = function() { // returns a copy of this Rectangle return new Rectangle(this.x, this.y, this.width, this.height); @@ -280,6 +290,14 @@ return false; } +function hasParameter(name) { + // returns if the parameter's value has been set + if (defined(dlParams[name])) { + return dlParams[name].hasValue; + } + return false; +} + function getAllParameters(detail) { // returns a string of all parameters in query format if (! detail) { @@ -559,6 +577,13 @@ var wsize = new Size(100, 100); if (defined(self.innerHeight)) { // all except Explorer + if ((self.innerWidth == 0)||(self.innerHeight == 0)) { + // Safari 1.2 bug + if (parent) { + parent.innerHeight; + parent.innerWidth; + } + } wsize.width = self.innerWidth; wsize.height = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight) {