[sword-svn] r3817 - in trunk/bindings/cordova/cordova-plugin-crosswire-sword: src/android src/ios www

scribe at crosswire.org scribe at crosswire.org
Mon Oct 19 07:00:49 EDT 2020


Author: scribe
Date: 2020-10-19 07:00:49 -0400 (Mon, 19 Oct 2020)
New Revision: 3817

Modified:
   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::setEntry to cordova plugin


Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java	2020-10-19 10:13:59 UTC (rev 3816)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/android/SWORD.java	2020-10-19 11:00:49 UTC (rev 3817)
@@ -378,6 +378,12 @@
 			result.setKeepCallback(true);
 			callbackContext.sendPluginResult(result);
 		}
+		else if (action.equals("SWModule_setRawEntry")) {
+			SWModule mod = mgr.getModuleByName(args.getString(0));
+			if (mod == null) { callbackContext.error("couldn't find module: " + args.getString(0)); return true; }
+			mod.setRawEntry(args.getString(1));
+			callbackContext.success();
+		}
 		else if (action.equals("SWMgr_startBibleSync")) {
 			final CallbackContext bibleSyncListener = callbackContext;
 			final String appName = args.getString(0);

Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift	2020-10-19 10:13:59 UTC (rev 3816)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/src/ios/SWORD.swift	2020-10-19 11:00:49 UTC (rev 3817)
@@ -818,9 +818,8 @@
             self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: keyText == nil ? "" : String(cString: keyText!)), callbackId: command.callbackId)
         }
     }
-    
-    
 
+
     @objc(SWModule_setKeyText:)
     func SWModule_setKeyText(command: CDVInvokedUrlCommand) {
         let module = getModule(command: command)
@@ -830,6 +829,17 @@
             self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: "SWModule_setKeyText"), callbackId: command.callbackId)
         }
     }
+
+
+    @objc(SWModule_setRawEntry:)
+    func SWModule_setRawEntry(command: CDVInvokedUrlCommand) {
+        let module = getModule(command: command)
+        let entryText = command.arguments[1] as? String ?? ""
+        if (module != 0) {
+            org_crosswire_sword_SWModule_setRawEntry(module, entryText)
+            self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_OK, messageAs: "SWModule_setEntryText"), callbackId: command.callbackId)
+        }
+    }
     
     
     @objc(InstallMgr_uninstallModule:)

Modified: trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js
===================================================================
--- trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js	2020-10-19 10:13:59 UTC (rev 3816)
+++ trunk/bindings/cordova/cordova-plugin-crosswire-sword/www/SWORD.js	2020-10-19 11:00:49 UTC (rev 3817)
@@ -288,6 +288,16 @@
 	return retVal;
 }
 
+SWModule.prototype.setRawEntry = function(entryText, callback) {
+	var retVal = null;
+	exec(callback?callback:function(r) { retVal = r; },
+		function(err) { utils.alert('[ERROR] problem: ' + err); },
+		"SWORD", "SWModule_setRawEntry", [this.name, entryText]
+	);
+	return retVal;
+}
+
+
 function SWMgr() {
 }
 



More information about the sword-cvs mailing list