changeset 320:4074c0138cf0

fixed bug with detecting window size in Safari 1.2
author robcast
date Mon, 01 Nov 2004 18:24:33 +0100
parents 23866acd6509
children 88f986c79478
files client/digitallibrary/baselib.js
diffstat 1 files changed, 26 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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) {