incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From purplecabb...@apache.org
Subject [9/9] js commit: add pause and resume event
Date Wed, 17 Oct 2012 20:38:34 GMT
add pause and resume event

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/7beb8c2f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/tree/7beb8c2f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/diff/7beb8c2f

Branch: refs/heads/master
Commit: 7beb8c2f9a01c4376deab4e729829592284bbb93
Parents: 58d3798
Author: wangmingfeng <mingfengwang01@gmail.com>
Authored: Wed Oct 10 11:44:19 2012 +0800
Committer: wangmingfeng <mingfengwang01@gmail.com>
Committed: Wed Oct 10 11:44:19 2012 +0800

----------------------------------------------------------------------
 lib/windows8/platform.js |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-js/blob/7beb8c2f/lib/windows8/platform.js
----------------------------------------------------------------------
diff --git a/lib/windows8/platform.js b/lib/windows8/platform.js
index 5d50b9d..cd59c3b 100644
--- a/lib/windows8/platform.js
+++ b/lib/windows8/platform.js
@@ -5,7 +5,19 @@ var cordova = require('cordova'),
 module.exports = {
     id: "windows8",
     initialize:function() {
+        var app = WinJS.Application;
+                
+        app.addEventListener("checkpoint", checkpointHandler);
+        function checkpointHandler(eventArgs) {
+            cordova.fireDocumentEvent('pause');
+        };
 
+        Windows.UI.WebUI.WebUIApplication.addEventListener("resuming", resumingHandler, false);
+        function resumingHandler() {
+            cordova.fireDocumentEvent('resume');
+        }
+
+        app.start();
     },
     objects: {
         navigator: {


Mime
View raw message