incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deedu...@apache.org
Subject [11/15] webworks commit: Switch to cordova.require.
Date Tue, 03 Apr 2012 12:59:30 GMT
Switch to cordova.require.


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/commit/ba363422
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/tree/ba363422
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/diff/ba363422

Branch: refs/heads/master
Commit: ba3634223785f5bd5bcb865180ab2e6f5fd0c33c
Parents: fe00353
Author: Drew Walters <deedubbu@apache.org>
Authored: Fri Mar 9 16:07:39 2012 -0600
Committer: Drew Walters <deedubbu@apache.org>
Committed: Fri Mar 9 16:07:39 2012 -0600

----------------------------------------------------------------------
 .../src/org/apache/cordova/CordovaExtension.java   |    2 +-
 .../src/org/apache/cordova/api/PluginResult.java   |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ba363422/framework/ext/src/org/apache/cordova/CordovaExtension.java
----------------------------------------------------------------------
diff --git a/framework/ext/src/org/apache/cordova/CordovaExtension.java b/framework/ext/src/org/apache/cordova/CordovaExtension.java
index b6e99a5..62943b4 100644
--- a/framework/ext/src/org/apache/cordova/CordovaExtension.java
+++ b/framework/ext/src/org/apache/cordova/CordovaExtension.java
@@ -113,7 +113,7 @@ public final class CordovaExtension implements WidgetExtension {
             // if this is premature, we at least set the _nativeReady flag to true
             // so that when the JS side is ready, it knows native side is too
             Logger.log(this.getClass().getName() + ": invoking Cordova.onNativeReady.fire()");
-            scriptEngine.executeScript("try {require('cordova/channel').onNativeReady.fire();}
catch(e) {_nativeReady = true;}", null);
+            scriptEngine.executeScript("try {cordova.require('cordova/channel').onNativeReady.fire();}
catch(e) {_nativeReady = true;}", null);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-cordova-blackberry-webworks/blob/ba363422/framework/ext/src/org/apache/cordova/api/PluginResult.java
----------------------------------------------------------------------
diff --git a/framework/ext/src/org/apache/cordova/api/PluginResult.java b/framework/ext/src/org/apache/cordova/api/PluginResult.java
index f8a666c..c4954a9 100644
--- a/framework/ext/src/org/apache/cordova/api/PluginResult.java
+++ b/framework/ext/src/org/apache/cordova/api/PluginResult.java
@@ -99,7 +99,7 @@ public class PluginResult {
      * @return JavaScript string that invokes the appropriate plugin success callback
      */
     public String toSuccessCallbackString(String callbackId) {
-        return "try { require('cordova').callbackSuccess('"+callbackId+"', " + this.getJSONString()
+ "); } catch(e) { alert('error in callbackSuccess:' + e.message); }";
+        return "try { cordova.callbackSuccess('"+callbackId+"', " + this.getJSONString()
+ "); } catch(e) { alert('error in callbackSuccess:' + e.message); }";
     }
 
     /**
@@ -110,7 +110,7 @@ public class PluginResult {
      * @return JavaScript string that invokes the appropriate plugin error callback
      */
     public String toErrorCallbackString(String callbackId) {
-        return "try { require('cordova').callbackError('"+callbackId+"', " + this.getJSONString()
+ "); } catch(e) { alert('error in callbackError:' + e.message); }";
+        return "try { cordova.callbackError('"+callbackId+"', " + this.getJSONString() +
"); } catch(e) { alert('error in callbackError:' + e.message); }";
     }
 
     public String toErrorString() {


Mime
View raw message