[sword-svn] r3648 - in trunk: bindings/Android/SWORD/app bindings/java-jni/jni src/modules/filters tests/testsuite

scribe at crosswire.org scribe at crosswire.org
Mon Jun 10 18:39:52 MST 2019


Author: scribe
Date: 2019-06-10 18:39:52 -0700 (Mon, 10 Jun 2019)
New Revision: 3648

Modified:
   trunk/bindings/Android/SWORD/app/build.gradle
   trunk/bindings/java-jni/jni/swordstub.cpp
   trunk/src/modules/filters/osiswebif.cpp
   trunk/src/modules/filters/osisxhtml.cpp
   trunk/tests/testsuite/osis_basic.good
   trunk/tests/testsuite/osis_mod2zmod.good
   trunk/tests/testsuite/osis_osis2modcipher.good
Log:
Added footnotes support to java-jni binding

Modified: trunk/bindings/Android/SWORD/app/build.gradle
===================================================================
--- trunk/bindings/Android/SWORD/app/build.gradle	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/bindings/Android/SWORD/app/build.gradle	2019-06-11 01:39:52 UTC (rev 3648)
@@ -32,8 +32,8 @@
 dependencies {
     implementation fileTree(dir: 'libs', include: ['*.jar'])
     implementation 'com.android.support:appcompat-v7:28.0.0'
-    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
-    testImplementation 'junit:junit:4.12'
+    implementation 'com.android.support.constraint:constraint-layout:2.0.0-beta1'
+    testImplementation 'junit:junit:4.13-beta-3'
     androidTestImplementation 'com.android.support.test:runner:1.0.2'
     androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
 }

Modified: trunk/bindings/java-jni/jni/swordstub.cpp
===================================================================
--- trunk/bindings/java-jni/jni/swordstub.cpp	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/bindings/java-jni/jni/swordstub.cpp	2019-06-11 01:39:52 UTC (rev 3648)
@@ -268,6 +268,9 @@
 		LocaleMgr::getSystemLocaleMgr()->loadConfigDir(SWBuf(STORAGE_BASE + "/uilocales.d").c_str());
 		LocaleMgr::getSystemLocaleMgr()->loadConfigDir((SWBuf(SWORD_PATH) + "/locales.d").c_str());
 		LocaleMgr::getSystemLocaleMgr()->loadConfigDir((SWBuf(SWORD_PATH) + "/uilocales.d").c_str());
+
+		mgr->setGlobalOption("Footnotes", "On");
+		mgr->setGlobalOption("Cross-references", "On");
 SWLog::getSystemLog()->logDebug("libsword: init() end.");
 	}
 }

Modified: trunk/src/modules/filters/osiswebif.cpp
===================================================================
--- trunk/src/modules/filters/osiswebif.cpp	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/src/modules/filters/osiswebif.cpp	2019-06-11 01:39:52 UTC (rev 3648)
@@ -41,6 +41,7 @@
 	MyUserData *u = (MyUserData *)OSISXHTML::createUserData(module, key);
 	u->interModuleLinkStart = "<a href=\"#\" onclick=\"return im('%s', '%s');\">";
 	u->interModuleLinkEnd = "</a>";
+	if (module) u->fn = module->getConfigEntry("EmbeddedFootnoteMarkers");
 	return u;
 }
 
@@ -143,11 +144,14 @@
 				if (!tag.isEmpty()) {
 					if (!strongsMarkup) {	// leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
 						SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
+						SWBuf n = tag.getAttribute("n");
 						SWBuf modName = (u->module) ? u->module->getName() : "";
 						if (u->vkey) {
 							char ch = ((tag.getAttribute("type") && ((!strcmp(tag.getAttribute("type"), "crossReference")) || (!strcmp(tag.getAttribute("type"), "x-cross-ref")))) ? 'x':'n');
-//							buf.appendFormatted("<a href=\"noteID=%s.%c.%s\"><small><sup>*%c</sup></small></a> ", u->vkey->getText(), ch, footnoteNumber.c_str(), ch);
-							buf.appendFormatted("<span class=\"fn\" onclick=\"f(\'%s\',\'%s\',\'%s\');\" >%c</span>", modName.c_str(), u->key->getText(), footnoteNumber.c_str(), ch);
+							buf.append("<span");
+							if (n.length()) buf.appendFormatted(" data-n=\"%s\"", n.c_str());
+							else if (u->fn != "true") buf.appendFormatted(" data-n=\"%c\"", ch);
+							buf.appendFormatted(" class=\"fn\" onclick=\"f(\'%s\',\'%s\',\'%s\');\" >%c</span>", modName.c_str(), u->key->getText(), footnoteNumber.c_str(), ch);
 						}
 					}
 					u->suspendTextPassThru = (++u->suspendLevel);

Modified: trunk/src/modules/filters/osisxhtml.cpp
===================================================================
--- trunk/src/modules/filters/osisxhtml.cpp	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/src/modules/filters/osisxhtml.cpp	2019-06-11 01:39:52 UTC (rev 3648)
@@ -315,7 +315,7 @@
 
 						if (u->vkey) {
 							//printf("URL = %s\n",URL::encode(u->vkey->getText()).c_str());
-							buf.appendFormatted("<a class=\"%s\" href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
+							buf.appendFormatted("<a class=\"noteMarker%s\" href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
 								classExtras.c_str(),
 								ch, 
 								URL::encode(footnoteNumber.c_str()).c_str(), 
@@ -326,7 +326,7 @@
 								(renderNoteNumbers ? noteName.c_str() : ""));
 						}
 						else {
-							buf.appendFormatted("<a class=\"%s\" href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
+							buf.appendFormatted("<a class=\"noteMarker%s\" href=\"passagestudy.jsp?action=showNote&type=%c&value=%s&module=%s&passage=%s\"><small><sup class=\"%c\">*%c%s</sup></small></a>",
 								classExtras.c_str(),
 								ch, 
 								URL::encode(footnoteNumber.c_str()).c_str(), 

Modified: trunk/tests/testsuite/osis_basic.good
===================================================================
--- trunk/tests/testsuite/osis_basic.good	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/tests/testsuite/osis_basic.good	2019-06-11 01:39:52 UTC (rev 3648)
@@ -82,10 +82,10 @@
 	
 -------
 RenderText:
-<span class="line indent0">‘<a class=" crossReference" href="passagestudy.jsp?action=showNote&type=x&value=1&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">And you, Bethlehem, land of Judah</span>, </span><br />
+<span class="line indent0">‘<a class="noteMarker crossReference" href="passagestudy.jsp?action=showNote&type=x&value=1&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">And you, Bethlehem, land of Judah</span>, </span><br />
 <span class="line indent0"><span class="small-caps">Are by no means least among the leaders of Judah</span>; </span><br />
 <span class="line indent0"><span class="small-caps">For out of you shall come forth a Ruler</span> </span><br />
-<span class="line indent0"><span class="small-caps">Who will</span> <a class=" crossReference" href="passagestudy.jsp?action=showNote&type=x&value=2&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">shepherd My people Israel</span>.’” <br />
+<span class="line indent0"><span class="small-caps">Who will</span> <a class="noteMarker crossReference" href="passagestudy.jsp?action=showNote&type=x&value=2&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">shepherd My people Israel</span>.’” <br />
   
 -------
 -------

Modified: trunk/tests/testsuite/osis_mod2zmod.good
===================================================================
--- trunk/tests/testsuite/osis_mod2zmod.good	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/tests/testsuite/osis_mod2zmod.good	2019-06-11 01:39:52 UTC (rev 3648)
@@ -82,10 +82,10 @@
 	
 -------
 RenderText:
-<span class="line indent0">‘<a class=" crossReference" href="passagestudy.jsp?action=showNote&type=x&value=1&module=zOSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">And you, Bethlehem, land of Judah</span>, </span><br />
+<span class="line indent0">‘<a class="noteMarker crossReference" href="passagestudy.jsp?action=showNote&type=x&value=1&module=zOSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">And you, Bethlehem, land of Judah</span>, </span><br />
 <span class="line indent0"><span class="small-caps">Are by no means least among the leaders of Judah</span>; </span><br />
 <span class="line indent0"><span class="small-caps">For out of you shall come forth a Ruler</span> </span><br />
-<span class="line indent0"><span class="small-caps">Who will</span> <a class=" crossReference" href="passagestudy.jsp?action=showNote&type=x&value=2&module=zOSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">shepherd My people Israel</span>.’” <br />
+<span class="line indent0"><span class="small-caps">Who will</span> <a class="noteMarker crossReference" href="passagestudy.jsp?action=showNote&type=x&value=2&module=zOSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">shepherd My people Israel</span>.’” <br />
   
 -------
 -------

Modified: trunk/tests/testsuite/osis_osis2modcipher.good
===================================================================
--- trunk/tests/testsuite/osis_osis2modcipher.good	2019-06-10 04:58:36 UTC (rev 3647)
+++ trunk/tests/testsuite/osis_osis2modcipher.good	2019-06-11 01:39:52 UTC (rev 3648)
@@ -82,10 +82,10 @@
 	
 -------
 RenderText:
-<span class="line indent0">‘<a class=" crossReference" href="passagestudy.jsp?action=showNote&type=x&value=1&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">And you, Bethlehem, land of Judah</span>, </span><br />
+<span class="line indent0">‘<a class="noteMarker crossReference" href="passagestudy.jsp?action=showNote&type=x&value=1&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">And you, Bethlehem, land of Judah</span>, </span><br />
 <span class="line indent0"><span class="small-caps">Are by no means least among the leaders of Judah</span>; </span><br />
 <span class="line indent0"><span class="small-caps">For out of you shall come forth a Ruler</span> </span><br />
-<span class="line indent0"><span class="small-caps">Who will</span> <a class=" crossReference" href="passagestudy.jsp?action=showNote&type=x&value=2&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">shepherd My people Israel</span>.’” <br />
+<span class="line indent0"><span class="small-caps">Who will</span> <a class="noteMarker crossReference" href="passagestudy.jsp?action=showNote&type=x&value=2&module=OSISReference&passage=Matthew+2%3A6"><small><sup class="x">*x</sup></small></a><span class="small-caps">shepherd My people Israel</span>.’” <br />
   
 -------
 -------




More information about the sword-cvs mailing list