changeset 43:e918bd61084d

opera support done, bugfixes
author luginbue
date Tue, 21 May 2002 02:29:41 +0200
parents 57874b52c2fc
children d8d68ce45775
files client/digitallibrary/digilib.jsp client/digitallibrary/modules/pagesTotal.js
diffstat 2 files changed, 75 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/digilib.jsp	Tue May 21 02:29:41 2002 +0200
+++ b/client/digitallibrary/digilib.jsp	Tue May 21 02:29:41 2002 +0200
@@ -20,22 +20,78 @@
 // parsing the query
 // -----------------
 
-String query = "";
+String query = "dlImage.jsp?";
+String token;
 
 if (request.getQueryString() != null) {
-	StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "+");
-
-	int numTokens = tokenizer.countTokens(); 
+	// have to enable the passing of delimiter to get empty parameters
+	StringTokenizer tokenizer = new StringTokenizer(request.getQueryString(), "+", true);
 
-	if (numTokens >= 1) query += "fn=" + tokenizer.nextToken();
-	if (numTokens >= 2) query += "&pn=" + tokenizer.nextToken();
-	if (numTokens >= 3) query += "&ws=" + tokenizer.nextToken();
-	if (numTokens >= 4) query += "&mo=" + tokenizer.nextToken();
-	if (numTokens >= 5) query += "&mk=" + tokenizer.nextToken();
-	if (numTokens >= 6) query += "&wx=" + tokenizer.nextToken();
-	if (numTokens >= 7) query += "&wy=" + tokenizer.nextToken();
-	if (numTokens >= 8) query += "&ww=" + tokenizer.nextToken();
-	if (numTokens >= 9) query += "&wh=" + tokenizer.nextToken();
+	// looks ugly but it works - hopefully...
+	
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "fn=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "&pn=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "&ws=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (!token.equals("+")) {
+			query += "&mo=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (!token.equals("+")) {
+			query += "&mk=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "&wx=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "&wy=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "&ww=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
+	if (tokenizer.hasMoreTokens()) {
+		token = tokenizer.nextToken();
+		if (token != "+") {
+			query += "&wh=" + token;
+			if (tokenizer.hasMoreTokens()) tokenizer.nextToken();
+		}
+	}
 
 	// a module update for total number of pages
 	query += "&pt=" + DB.getNumPages(request);
@@ -43,11 +99,11 @@
 %>
 
 <frameset cols="*,90" border="0">
-  <frame name="mainFrame" src="dlImage.jsp?<%= query %>" scrolling="auto">
+  <frame name="mainFrame" src="<%= query %>" scrolling="auto">
   <frameset rows="20,*" border="0">
     <frame name="pageFrame" src="about:blank" scrolling="no" noresize>
     <frame name="rightFrame" src="dlMenu.html" scrolling="no" noresize>
   </frameset>
 </frameset>
 
-</html>
+</html>
\ No newline at end of file
--- a/client/digitallibrary/modules/pagesTotal.js	Tue May 21 02:29:41 2002 +0200
+++ b/client/digitallibrary/modules/pagesTotal.js	Tue May 21 02:29:41 2002 +0200
@@ -61,10 +61,11 @@
 function page(keepArea) {
 
 	do {
-    	page = prompt("Goto Page (1 - " + att[9] + "):", 1);
-	} while (!isNaN(att[9]) && (page != null) && ((page < 1) || (page > parent.numPages)));
+    	var page = prompt("Goto Page (1 - " + att[9] + "):", 1);
+    	
+	} while ((page != null) && ((isNaN(page)) || (page < 1) || (page > att[9])));
 
-   	if (page != null && page != att[1]) {
+   	if ((page != null) && (page != att[1])) {
 		att[1] = page;
 		loadPicture(0, keepArea);
 	}