changeset 199:21789f3f7251

Corrected Problems with innerWidth and about:blank for Safari.
author robcast
date Wed, 14 Jan 2004 12:06:53 +0100
parents d6a3b6aaa203
children 1cbd73aa5b48
files client/digitallibrary/digilib.jsp client/digitallibrary/navigation.js
diffstat 2 files changed, 40 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/digilib.jsp	Tue Dec 23 17:29:08 2003 +0100
+++ b/client/digitallibrary/digilib.jsp	Wed Jan 14 12:06:53 2004 +0100
@@ -103,17 +103,27 @@
 
 function redirect() {
 
-  if (document.body) {
-
-    // internet explorer + opera
-    client = "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
+  var wwidth, wheight;
+  if (self.innerHeight) // all except Explorer
+  {
+      wwidth = self.innerWidth;
+      wheight = self.innerHeight;
+  }
+  else if (document.documentElement && document.documentElement.clientHeight)
+  // Explorer 6 Strict Mode
+  {
+      wwidth = document.documentElement.clientWidth;
+      wheight = document.documentElement.clientHeight;
+  }
+  else if (document.body) // other Explorers
+  {
+      wwidth = document.body.clientWidth;
+      wheight = document.body.clientHeight;
+  }
 
-  } else {
+  client = "&dw=" + (wwidth-30) + "&dh=" + (wheight-30);
+  //alert("CLIENT: "+client);
 
-    // mozilla-browsers (netscape 4.xx, netscape 6.xx, etc.)
-    client = "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30);
-
-  }
 <%
   if (dlRequest.isRDF()){
     String strAllParams=dlRequest.getAsString();
@@ -145,7 +155,7 @@
 
 <html>
 <head>
-<title>Digital Document Library - Alcatraz (Level 1)</title>
+<title>Digital Document Library (L1)</title>
 
 <script src="navigation.js" type="text/javascript"> </script>
 
@@ -226,13 +236,13 @@
 
 <html>
 <head>
-<title>Digital Document Library - Alcatraz (Level 2)</title>
+<title>Digital Document Library (L2)</title>
 </head>
 
 <frameset cols="*,90" border="0">
   <frame name="mainFrame" src="<%= query %>" scrolling="auto">
   <frameset rows="20,*" border="0">
-    <frame name="pageFrame" src="about:blank" scrolling="no" noresize>
+    <frame name="pageFrame" src="empty.html" scrolling="no" noresize>
     <frame name="rightFrame" src="dlMenu.html" scrolling="no" noresize>
   </frameset>
 </frameset>
--- a/client/digitallibrary/navigation.js	Tue Dec 23 17:29:08 2003 +0100
+++ b/client/digitallibrary/navigation.js	Wed Jan 14 12:06:53 2004 +0100
@@ -118,11 +118,25 @@
 
   }
 
-  if ( document.body ) {
-  	queryString += "&dw=" + (document.body.clientWidth-30) + "&dh=" + (document.body.clientHeight-30);
-  } else {
-    queryString += "&dw=" + (innerWidth-30) + "&dh=" + (innerHeight-30);
+  // window size
+  var wwidth, wheight;
+  if (self.innerHeight) // all except Explorer
+  {
+      wwidth = self.innerWidth;
+      wheight = self.innerHeight;
   }
+  else if (document.documentElement && document.documentElement.clientHeight)
+  // Explorer 6 Strict Mode
+  {
+      wwidth = document.documentElement.clientWidth;
+      wheight = document.documentElement.clientHeight;
+  }
+  else if (document.body) // other Explorers
+  {
+      wwidth = document.body.clientWidth;
+      wheight = document.body.clientHeight;
+  }
+  queryString += "&dw=" + (wwidth-30) + "&dh=" + (wheight-30);
 
   queryString += "&lv=1";