[sword-svn] r3681 - in trunk/bindings/cordova/cordova-plugin-crosswire-sword: src/android www
scribe at crosswire.org
scribe at crosswire.org
Tue Jan 28 15:42:43 MST 2020
Author: scribe
Date: 2020-01-28 15:42:43 -0700 (Tue, 28 Jan 2020)
New Revision: 3681
Modified:
trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java
trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
Log:
added setGlobalOption impl and fixed EntryAttributes which required a renderText before retrieving.
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java 2020-01-27 18:54:23 UTC (rev 3680)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java 2020-01-28 22:42:43 UTC (rev 3681)
@@ -451,6 +451,12 @@
String translated = mgr.translate(text, locale);
callbackContext.success(translated);
}
+ else if (action.equals("SWMgr_setGlobalOption")) {
+ String option = args.getString(0);
+ String value = args.getString(1);
+ mgr.setGlobalOption(option, value);
+ callbackContext.success();
+ }
else if (action.equals("SWModule_getRenderText")) {
SWModule mod = mgr.getModuleByName(args.getString(0));
if (mod == null) { callbackContext.error("couldn't find module: " + args.getString(0)); return true; }
@@ -615,12 +621,12 @@
JSONObject v = new JSONObject();
if (((int)error) == 0) {
v.put("verse", getVerseKey(mod.getKeyChildren()));
+ v.put("text", mod.getRenderText());
String preVerse = "";
for (String h : mod.getEntryAttribute("Heading", "Preverse", "", true)) {
preVerse += h;
}
v.put("preVerse", preVerse);
- v.put("text", mod.getRenderText());
}
else {
/* null removes entry
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js 2020-01-27 18:54:23 UTC (rev 3680)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js 2020-01-28 22:42:43 UTC (rev 3681)
@@ -379,6 +379,12 @@
);
}
+SWMgr.prototype.setGlobalOption = function(option, value, callback) {
+ exec(callback?callback:function() {},
+ function(err) { utils.alert('[ERROR] problem: ' + err); },
+ "SWORD", "SWMgr_setGlobalOption", [option, value]
+ );
+}
function HTTPUtils() {}
@@ -400,7 +406,6 @@
/*
public native String getPrefixPath();
public native String getConfigPath();
- public native void setGlobalOption(String option, String value);
public native String getGlobalOption(String option);
public native String getGlobalOptionTip(String option);
public native String filterText(String filterName, String text);
More information about the sword-cvs
mailing list