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
[38/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/4c43dee1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/4c43dee1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/4c43dee1
Branch: refs/heads/master
Commit: 4c43dee1496a7151708cc35f6b7fead6c8413f03
Parents: 45dd6d3
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 23 19:34:47 2012 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 23 19:34:47 2012 -0800
----------------------------------------------------------------------
lib/exec/wp7.js | 31 ++-----------------------------
1 files changed, 2 insertions(+), 29 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/4c43dee1/lib/exec/wp7.js
----------------------------------------------------------------------
diff --git a/lib/exec/wp7.js b/lib/exec/wp7.js
index 78eef40..de070bc 100644
--- a/lib/exec/wp7.js
+++ b/lib/exec/wp7.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);
- }
-};