cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nikhi...@apache.org
Subject js commit: CB-8674: Creates a 'cordova.env' object, and then on Windows hangs the activation arguments off of cordova.env.args.
Date Wed, 06 May 2015 19:35:32 GMT
Repository: cordova-js
Updated Branches:
  refs/heads/master d810710c1 -> f86227b8f


CB-8674: Creates a 'cordova.env' object, and then on Windows hangs the
activation arguments off of cordova.env.args.

This should allow plugins to capture the activation arguments even though
the 'activated' event fires before plugins load on Windows.

This closes #108


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

Branch: refs/heads/master
Commit: f86227b8fe80a13d8db35a7478c798782aee1b17
Parents: d810710
Author: Rob Paveza <Rob.Paveza@microsoft.com>
Authored: Fri May 1 14:58:46 2015 -0700
Committer: Nikhil Khandelwal <nikhilkh@microsoft.com>
Committed: Wed May 6 12:34:25 2015 -0700

----------------------------------------------------------------------
 src/cordova.js          | 1 +
 src/windows/platform.js | 6 ++++++
 2 files changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f86227b8/src/cordova.js
----------------------------------------------------------------------
diff --git a/src/cordova.js b/src/cordova.js
index 1ef3478..7e4377c 100644
--- a/src/cordova.js
+++ b/src/cordova.js
@@ -101,6 +101,7 @@ var cordova = {
     version:PLATFORM_VERSION_BUILD_LABEL,
     platformVersion:PLATFORM_VERSION_BUILD_LABEL,
     platformId:platform.id,
+    env:{},
     /**
      * Methods to add/remove your own addEventListener hijacking on document + window.
      */

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f86227b8/src/windows/platform.js
----------------------------------------------------------------------
diff --git a/src/windows/platform.js b/src/windows/platform.js
index 2807505..be72cd3 100644
--- a/src/windows/platform.js
+++ b/src/windows/platform.js
@@ -41,9 +41,15 @@ module.exports = {
             var resumingHandler = function resumingHandler() {
                 cordova.fireDocumentEvent('resume',null,true);
             };
+            
+            var activationHandler = function activationHandler(e) {
+                cordova.env = (cordova.env || { });
+                cordova.env.args = e.detail;
+            };
 
             app.addEventListener("checkpoint", checkpointHandler);
             Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler,
false);
+            app.addEventListener('activated', activationHandler);
             app.start();
         };
 


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


Mime
View raw message