[sword-svn] r450 - trunk/webapp

scribe at crosswire.org scribe at crosswire.org
Sat Jul 21 12:19:32 MST 2018


Author: scribe
Date: 2018-07-21 12:19:32 -0700 (Sat, 21 Jul 2018)
New Revision: 450

Modified:
   trunk/webapp/fetchdata.jsp
Log:
Added ability to get mod render header with key=RenderHeader
Added ability to include render header with output with flag includeRenderHeader=true


Modified: trunk/webapp/fetchdata.jsp
===================================================================
--- trunk/webapp/fetchdata.jsp	2018-07-21 18:42:32 UTC (rev 449)
+++ trunk/webapp/fetchdata.jsp	2018-07-21 19:19:32 UTC (rev 450)
@@ -24,6 +24,7 @@
 	SWModule book = null;
 	String modName = request.getParameter("mod");
 	String ks = request.getParameter("key");
+	boolean includeRenderHeader = "true".equals(request.getParameter("includeRenderHeader"));
 
 	if (ks != null && !"betacode".equals(modName)) {
 		ks = new String(ks.getBytes("iso8859-1"), "UTF-8");
@@ -206,6 +207,28 @@
 					book = mgr.getModuleByName(modName);
 				}
 				if ((key != null) && (book != null)) {
+
+					if ("RenderHeader".equals(key)) {
+						out.print(book.getRenderHeader());
+						return;
+					}
+					if (includeRenderHeader) {
+%>
+<style>
+<%=book.getRenderHeader()%>
+.verse_number::before {
+  content: ' ';
+}
+.verse_number::after {
+  content: attr(data-suggested);
+	font-size: 0.8em;
+	width:3em;
+	color:navy;
+	vertical-align:top;
+}
+</style>
+<%
+					}
 					String keyList[] = SwordOrb.BIBLES.equals(book.getCategory())?book.parseKeyList(key) : new String[] { key };
 //System.out.println(key);
 //System.out.println(keyList[0]);
@@ -438,8 +461,7 @@
 										if (!lastChapter.equals(book.getKeyChildren()[VERSEKEY_CHAPTER]) || !lastBook.equals(book.getKeyChildren()[VERSEKEY_BOOKABBREV])) suggest = book.getKeyChildren()[VERSEKEY_CHAPTER] + ":" + suggest;
 										if (!lastBook.equals(book.getKeyChildren()[VERSEKEY_BOOKABBREV])) suggest = book.getKeyChildren()[VERSEKEY_BOOKABBREV] + " " + suggest;
 %>
-<span class="<%= "0".equals(book.getKeyChildren()[VERSEKEY_CHAPTER]) ? "book_intro" : "0".equals(book.getKeyChildren()[VERSEKEY_VERSE]) ? "chapter_intro" : "verse_number" %>" data-book="<%= book.getKeyChildren()[VERSEKEY_BOOKABBREV]%>" data-chapter="<%= book.getKeyChildren()[VERSEKEY_CHAPTER]%>" data-verse="<%=book.getKeyChildren()[VERSEKEY_VERSE]%>" data-verseKey="<%=book.getKeyChildren()[VERSEKEY_OSISREF]%>" data-suggested="<%= suggest %>"></span>
-<%									}
+<span class="<%= "0".equals(book.getKeyChildren()[VERSEKEY_CHAPTER]) ? "book_intro" : "0".equals(book.getKeyChildren()[VERSEKEY_VERSE]) ? "chapter_intro" : "verse_number" %>" data-book="<%= book.getKeyChildren()[VERSEKEY_BOOKABBREV]%>" data-chapter="<%= book.getKeyChildren()[VERSEKEY_CHAPTER]%>" data-verse="<%=book.getKeyChildren()[VERSEKEY_VERSE]%>" data-verseKey="<%=book.getKeyChildren()[VERSEKEY_OSISREF]%>" data-suggested="<%= suggest %>"></span><%									}
 									else { %>
 <span class="verse_number" data-verseKey="<%= book.getKeyText()%>" data-suggested="<%= book.getKeyText() %>"></span>
 <%									} %>




More information about the sword-cvs mailing list