cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [2/3] cordova-windows git commit: add same activated channel and activationContext for non-browserify workflows
Date Tue, 14 Jul 2015 23:41:27 GMT
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 <purplecabbage@gmail.com>
Authored: Fri Jun 26 18:03:15 2015 -0700
Committer: Jesse MacFadyen <purplecabbage@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


Mime
View raw message