You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2012/04/06 03:20:43 UTC

[28/40] git commit: moved plugin code

moved plugin code


Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/commit/2d7c7a12
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/2d7c7a12
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/2d7c7a12

Branch: refs/heads/master
Commit: 2d7c7a128c2bd79d3e3c717359f77fad03b65bb1
Parents: 07c9c2b
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 23 19:34:47 2012 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 28 16:01:27 2012 -0700

----------------------------------------------------------------------
 lib/wp7/exec.js |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/2d7c7a12/lib/wp7/exec.js
----------------------------------------------------------------------
diff --git a/lib/wp7/exec.js b/lib/wp7/exec.js
index 78eef40..de070bc 100644
--- a/lib/wp7/exec.js
+++ b/lib/wp7/exec.js
@@ -17,7 +17,8 @@ var cordova = require('cordova');
 
 module.exports = function(success, fail, service, action, args) {
     var callbackId = service + cordova.callbackId++;
-    if (typeof success == "function" || typeof fail == "function") {
+    if (typeof success == "function" || typeof fail == "function") 
+	{
         cordova.callbacks[callbackId] = {success:success, fail:fail};
     }
     // generate a new command string, ex. DebugConsole/log/DebugConsole23/{"message":"wtf dude?"}
@@ -26,32 +27,4 @@ module.exports = function(success, fail, service, action, args) {
      window.external.Notify(command);
 };
 
-// TODO: is this what native side invokes?
-// if so pluginize under plugin/wp7
-cordovaCommandResult = function(status,callbackId,args,cast) {
-    if(status === "backbutton") {
 
-        cordova.fireEvent(document,"backbutton");
-        return "true";
-
-    } else if(status === "resume") {
-
-        cordova.onResume.fire();
-        return "true";
-
-    } else if(status === "pause") {
-
-        cordova.onPause.fire();
-        return "true";  
-    }
-    
-    var safeStatus = parseInt(status, 10);
-    if(safeStatus === cordova.callbackStatus.NO_RESULT ||
-       safeStatus === cordova.callbackStatus.OK) {
-        cordova.CallbackSuccess(callbackId,args,cast);
-    }
-    else
-    {
-        cordova.CallbackError(callbackId,args,cast);
-    }
-};