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 2015/07/15 01:41:27 UTC

[2/3] cordova-windows git commit: add same activated channel and activationContext for non-browserify workflows

add same activated channel and activationContext for non-browserify workflows


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

Branch: refs/heads/master
Commit: 007daf931bb67f5c1e4be6ae506941b640355b80
Parents: 44c8ae7
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Jun 26 18:03:15 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Jun 26 18:03:15 2015 -0700

----------------------------------------------------------------------
 template/www/cordova.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/007daf93/template/www/cordova.js
----------------------------------------------------------------------
diff --git a/template/www/cordova.js b/template/www/cordova.js
index 6f6743b..324dd24 100644
--- a/template/www/cordova.js
+++ b/template/www/cordova.js
@@ -1297,6 +1297,12 @@ module.exports = {
             modulemapper = require('cordova/modulemapper');
 
         modulemapper.clobbers('cordova/exec/proxy', 'cordova.commandProxy');
+
+        // we will make sure we get this channel, and remove this once
+        // other platforms catch up.
+        if(!channel.onActivated) {
+            channel.onActivated = cordova.addDocumentEventHandler('activated');)
+        }
         channel.onNativeReady.fire();
 
         var onWinJSReady = function () {
@@ -1309,7 +1315,18 @@ module.exports = {
                 cordova.fireDocumentEvent('resume',null,true);
             };
 
+            // activation args are available via the activated event
+            // OR cordova.require('cordova/platform').activationContext
+            // activationContext:{type: actType, args: args};
+            var activationHandler = function (e) {
+                var args = e.detail.arguments;
+                var actType = e.detail.type;
+                platform.activationContext = { type: actType, args: args };
+                cordova.fireDocumentEvent('activated', platform.activationContext, true);
+            };
+
             app.addEventListener("checkpoint", checkpointHandler);
+            app.addEventListener("activated", activationHandler, false);
             Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
             app.start();
         };


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