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/08/15 01:54:56 UTC
[9/9] js commit: addCommandProxy+removeCommandProxy
addCommandProxy+removeCommandProxy
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/a55eb34c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/a55eb34c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/a55eb34c
Branch: refs/heads/master
Commit: a55eb34cf85fe0f328a5f6f7ea5ba43d67b3aec5
Parents: b8fae99
Author: purplecabbage <pu...@gmail.com>
Authored: Tue Jul 31 12:39:07 2012 -0700
Committer: purplecabbage <pu...@gmail.com>
Committed: Tue Jul 31 12:39:07 2012 -0700
----------------------------------------------------------------------
lib/win8metro/exec.js | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/a55eb34c/lib/win8metro/exec.js
----------------------------------------------------------------------
diff --git a/lib/win8metro/exec.js b/lib/win8metro/exec.js
index e03151d..992f2e8 100644
--- a/lib/win8metro/exec.js
+++ b/lib/win8metro/exec.js
@@ -35,7 +35,7 @@ var CommandProxy = {
"NetworkStatus":require('cordova/plugin/win8metro/NetworkStatusProxy')
};
-var Exec = function(success, fail, service, action, args) {
+module.exports = function(success, fail, service, action, args) {
if(CommandProxy[service] && CommandProxy[service][action]) {
@@ -60,12 +60,22 @@ var Exec = function(success, fail, service, action, args) {
};
-Exec.addCommandProxy = function(id,proxyObj) {
+// cordova.exec.addCommandProxy("Accelerometer",{getCurrentAcceleration: function(successCallback, errorCallback, options) {...},...);
+module.exports.addCommandProxy = function(id,proxyObj) {
CommandProxy[id] = proxyObj;
};
-module.exports = Exec;
+// cordova.exec.removeCommandProxy("Accelerometer");
+module.exports.removeCommandProxy = function(id) {
+
+ var proxy = CommandProxy[id];
+ delete CommandProxy[id];
+ CommandProxy[id] = null;
+ return proxy;
+};
+
+