cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zasp...@apache.org
Subject js commit: ubuntu: port to oxide
Date Mon, 15 Dec 2014 13:36:39 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/master c3d61481b -> ab3fc0f59


ubuntu: port to oxide


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

Branch: refs/heads/master
Commit: ab3fc0f59dbba0cc402d40a26276675f05924ae1
Parents: c3d6148
Author: Maxim Ermilov <maxim.ermilov@canonical.com>
Authored: Fri Dec 12 16:28:50 2014 +0300
Committer: Maxim Ermilov <maxim.ermilov@canonical.com>
Committed: Mon Dec 15 16:36:13 2014 +0300

----------------------------------------------------------------------
 src/ubuntu/exec.js | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/ab3fc0f5/src/ubuntu/exec.js
----------------------------------------------------------------------
diff --git a/src/ubuntu/exec.js b/src/ubuntu/exec.js
index e6e476d..1c3e04c 100644
--- a/src/ubuntu/exec.js
+++ b/src/ubuntu/exec.js
@@ -59,6 +59,7 @@ cordova.callbackWithoutRemove = function() {
     if (typeof(callbackRef) == "function") callbackRef.apply(this, parameters);
 };
 
+var _initialized = false;
 function ubuntuExec(success, fail, service, action, args) {
     if (callbackId % 2) {
         callbackId++;
@@ -72,6 +73,13 @@ function ubuntuExec(success, fail, service, action, args) {
     args.unshift(ecId);
     args.unshift(scId);
 
-    navigator.qt.postMessage(JSON.stringify({messageType: "callPluginFunction", plugin: service,
func: action, params: args}));
+    if (!_initialized) {
+        _initialized = true;
+        window.oxide.addMessageHandler("EXECUTE", function (msg) {
+            eval(msg.args.code);
+        });
+    }
+
+    window.oxide.sendMessage("from-cordova", {messageType: "callPluginFunction", plugin:
service, func: action, params: args});
 }
 module.exports = ubuntuExec;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message