[sword-svn] r449 - trunk/webapp
scribe at crosswire.org
scribe at crosswire.org
Sat Jul 21 11:42:33 MST 2018
Author: scribe
Date: 2018-07-21 11:42:32 -0700 (Sat, 21 Jul 2018)
New Revision: 449
Modified:
trunk/webapp/fetchdata.jsp
Log:
added in distributionLicense when retrieving mod list
added in spans to assist displaying verse markers
Modified: trunk/webapp/fetchdata.jsp
===================================================================
--- trunk/webapp/fetchdata.jsp 2018-06-24 15:03:35 UTC (rev 448)
+++ trunk/webapp/fetchdata.jsp 2018-07-21 18:42:32 UTC (rev 449)
@@ -17,6 +17,8 @@
final int VERSEKEY_VERSEMAX = 5;
final int VERSEKEY_BOOKNAME = 6;
final int VERSEKEY_OSISREF = 7;
+ final int VERSEKEY_SHORTTEXT = 8;
+ final int VERSEKEY_BOOKABBREV = 9;
SWMgr mgr = SwordOrb.getSWMgrInstance(request);
SWModule book = null;
@@ -261,6 +263,8 @@
}
+ String lastBook = "";
+ String lastChapter = "";
for (int k = 0; k < keyList.length; ++k) {
String k1 = keyList[k];
if (k1 == null) continue;
@@ -427,12 +431,27 @@
}
else {
// --------------------------------------------
+
+ String suggest = "";
+ if (book.getKeyChildren().length > VERSEKEY_BOOKABBREV) {
+ suggest = book.getKeyChildren()[VERSEKEY_VERSE];
+ 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>
+<% }
+ else { %>
+<span class="verse_number" data-verseKey="<%= book.getKeyText()%>" data-suggested="<%= book.getKeyText() %>"></span>
+<% } %>
<%= book.getRenderText() %>
<%
}
}
}
+ if (book.getKeyChildren().length > VERSEKEY_BOOKABBREV && !"0".equals(book.getKeyChildren()[VERSEKEY_VERSE])) {
+ lastBook = book.getKeyChildren()[VERSEKEY_BOOKABBREV];
+ lastChapter = book.getKeyChildren()[VERSEKEY_CHAPTER];
+ }
}
if ("tei".equals(format)) {
//System.out.println("inchapter: " + inChapter);
@@ -457,8 +476,10 @@
ModInfo[] modInfo = mgr.getModInfoList();
for (int i = 0; i < modInfo.length; i++) {
SWModule b = mgr.getModuleByName(modInfo[i].name);
+ String dist = b.getConfigEntry("DistributionLicense");
+ if ("<SWNULL>".equals(dist)) dist="";
%>
- <module id="<%=modInfo[i].name %>" category="<%= modInfo[i].category %>"><%= HTTPUtils.canonize(b.getDescription()) %></module>
+ <module id="<%=modInfo[i].name %>" category="<%= modInfo[i].category %>" distributionLicense="<%= HTTPUtils.canonize(dist) %>"><%= HTTPUtils.canonize(b.getDescription()) %></module>
<%
}
More information about the sword-cvs
mailing list