[sword-cvs] swordweb parallelstudy.jsp,1.21,1.22 passagestudy.jsp,1.18,1.19

sword@www.crosswire.org sword@www.crosswire.org
Tue, 28 Oct 2003 13:23:29 -0700


Update of /usr/local/cvsroot/swordweb
In directory www:/tmp/cvs-serv15542

Modified Files:
	parallelstudy.jsp passagestudy.jsp 
Log Message:
fixes

Index: parallelstudy.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/parallelstudy.jsp,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- parallelstudy.jsp	28 Oct 2003 08:43:32 -0000	1.21
+++ parallelstudy.jsp	28 Oct 2003 20:23:27 -0000	1.22
@@ -170,10 +170,23 @@
 		has to say about that specific verse.
 		</p>
 
+		<% //insert next and previous chapter links
+			// activeKey contains the current key ATM
+			// Split up into book, chapter and verse.
+			// Then add and subtract 1 to the chapter to the next and previous one
+
+			String bookname = activeKey.substring(0, activeKey.lastIndexOf(" "));
+			int chapter = Integer.parseInt( activeKey.substring(activeKey.lastIndexOf(" ")+1, activeKey.indexOf(":")) );
+			//int verse = Integer.parseInt(activeKey.substring(activeKey.indexOf(":")+1));
+
+			String prevChapterString = bookname + " " + String.valueOf(chapter-1) + ":1";
+			String nextChapterString = bookname + " " + String.valueOf(chapter+1) + ":1";
+
+		%>
 		<ul class="booknav">
-			<li><a href="">previous chapter</a></li>
-			<li><a href="">this chapter</a></li>
-			<li><a href="">next chapter</a></li>
+			<li><a href="parallelstudy.jsp?key=<%= URLEncoder.encode(prevChapterString) %>" title="Display <%= prevChapterString %>">previous chapter</a></li>
+			<!-- <li><a href="" title="display all of Romans 8">this chapter</a></li> -->
+			<li><a href="parallelstudy.jsp?key=<%= URLEncoder.encode(nextChapterString) %>" title="Display <%= nextChapterString %>">next chapter</a></li>
 		</ul>
 
 

Index: passagestudy.jsp
===================================================================
RCS file: /usr/local/cvsroot/swordweb/passagestudy.jsp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- passagestudy.jsp	28 Oct 2003 14:48:15 -0000	1.18
+++ passagestudy.jsp	28 Oct 2003 20:23:27 -0000	1.19
@@ -181,10 +181,24 @@
 		<div id="passagestudy">
 		<h2><%= activeKey %></h2>
 		<h3>&raquo; <%= activeModule.getDescription().replaceAll("&", "&amp;") + " (" + activeModule.getName() + ")" %></h3>
+
+		<% //insert next and previous chapter links
+			// activeKey contains the current key ATM
+			// Split up into book, chapter and verse.
+			// Then add and subtract 1 to the chapter to the next and previous one
+
+			String bookname = activeKey.substring(0, activeKey.lastIndexOf(" "));
+			int chapter = Integer.parseInt( activeKey.substring(activeKey.lastIndexOf(" ")+1, activeKey.indexOf(":")) );
+			//int verse = Integer.parseInt(activeKey.substring(activeKey.indexOf(":")+1));
+
+			String prevChapterString = bookname + " " + String.valueOf(chapter-1) + ":1";
+			String nextChapterString = bookname + " " + String.valueOf(chapter+1) + ":1";
+
+		%>
 		<ul class="booknav">
-			<li><a href="" title="display Romans 7">previous chapter</a></li>
-			<li><a href="" title="display all of Romans 8">this chapter</a></li>
-			<li><a href="" title="display Romans 10">next chapter</a></li>
+			<li><a href="passagestudy.jsp?key=<%= URLEncoder.encode(prevChapterString) %>" title="Display <%= prevChapterString %>">previous chapter</a></li>
+			<!-- <li><a href="" title="display all of Romans 8">this chapter</a></li> -->
+			<li><a href="passagestudy.jsp?key=<%= URLEncoder.encode(nextChapterString) %>" title="Display <%= nextChapterString %>">next chapter</a></li>
 		</ul>
 
 		<%
@@ -198,7 +212,7 @@
 						break;
 					mgr.setGlobalOption("Strong's Numbers",
 							((strongs) && (curVerse >= activeVerse -1) && (curVerse <= activeVerse + 1)) ? "on" : "off");
-					mgr.setGlobalOption("Morphological Tags", 
+					mgr.setGlobalOption("Morphological Tags",
 							((morph) && (curVerse >= activeVerse -1) && (curVerse <= activeVerse + 1)) ? "on" : "off");
 					boolean rtol = ("RtoL".equalsIgnoreCase(activeModule.getConfigEntry("Direction")));
 			%>