[sword-svn] r3835 - in trunk/bindings/cordova/cordova-plugin-crosswire-sword: . src/android src/ios www
scribe at crosswire.org
scribe at crosswire.org
Sat Dec 26 13:05:05 EST 2020
Author: scribe
Date: 2020-12-26 13:05:05 -0500 (Sat, 26 Dec 2020)
New Revision: 3835
Modified:
trunk/bindings/cordova/cordova-plugin-crosswire-sword/README.md
trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java
trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
Log:
Added SWModule::terminateSearch to cordova plugin
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/README.md
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/README.md 2020-12-23 21:40:36 UTC (rev 3834)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/README.md 2020-12-26 18:05:05 UTC (rev 3835)
@@ -33,7 +33,7 @@
var moduleName = 'KJV';
var verse = 'Jn.3.16';
- SWORD.mgr.getModuleByName(moduleName, function (module) {
+ SWORD.mgr.getModuleByName(moduleName, function(module) {
module.setKeyText(verse, function() {
module.getRenderText(function(entryText) {
console.log(verse + ': ' + entryText + '(' + moduleName + ')');
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java 2020-12-23 21:40:36 UTC (rev 3834)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java 2020-12-26 18:05:05 UTC (rev 3835)
@@ -295,6 +295,12 @@
if (mod == null) { callbackContext.error("couldn't find module: " + args.getString(0)); return true; }
callbackContext.success(mod.getKeyText());
}
+ else if (action.equals("SWModule_terminateSearch")) {
+ SWModule mod = mgr.getModuleByName(args.getString(0));
+ if (mod == null) { callbackContext.error("couldn't find module: " + args.getString(0)); return true; }
+ mod.terminateSearch();
+ callbackContext.success();
+ }
else if (action.equals("SWModule_search")) {
final SWModule mod = mgr.getModuleByName(args.getString(0));
final String expression = args.getString(1);
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift 2020-12-23 21:40:36 UTC (rev 3834)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift 2020-12-26 18:05:05 UTC (rev 3835)
@@ -724,6 +724,14 @@
return retVal;
}
+ @objc(SWModule_terminateSearch:)
+ func SWModule_setKeyText(command: CDVInvokedUrlCommand) {
+ let module = getModule(command: command)
+ if (module != 0) {
+ org_crosswire_sword_SWModule_terminateSearch(module)
+ self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: "SWModule_terminateSearch"), callbackId: command.callbackId)
+ }
+ }
@objc(SWModule_search:)
func SWModule_search(command: CDVInvokedUrlCommand) {
Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js 2020-12-23 21:40:36 UTC (rev 3834)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js 2020-12-26 18:05:05 UTC (rev 3835)
@@ -118,6 +118,15 @@
return retVal;
}
+SWModule.prototype.terminateSearch = function(callback) {
+ var retVal = null;
+ exec(callback?callback:function(r) { retVal = r; },
+ function(err) { utils.alert('[ERROR] problem: ' + err); },
+ "SWORD", "SWModule_terminateSearch", [this.name]
+ );
+ return retVal;
+}
+
SWModule.prototype.search = function(expression, searchType, flags, scope, callback) {
var retVal = null;
exec(callback?callback:function(r) { retVal = r; },
More information about the sword-cvs
mailing list