incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [28/29] ios commit: require syntax for firing events in ios
Date Fri, 16 Mar 2012 18:14:49 GMT
require syntax for firing events in ios


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

Branch: refs/heads/master
Commit: c00604c8365fc1d07a42dc1279511f3325c9d89f
Parents: 7afc28a
Author: Fil Maj <filip.maj@nitobi.com>
Authored: Thu Feb 23 10:23:32 2012 -0800
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Fri Mar 16 10:56:48 2012 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/c00604c8/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 92b9a4a..306a894 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -363,7 +363,7 @@
 {
     // Share session key with the WebView by setting Cordova.sessionKey
     // TODO: wtf is the sessionKey ?
-    NSString *sessionKeyScript = [NSString stringWithFormat:@"Cordova.sessionKey = \"%@\";",
self.sessionKey];
+    NSString *sessionKeyScript = [NSString stringWithFormat:@"sessionKey = \"%@\";", self.sessionKey];
     [theWebView stringByEvaluatingJavaScriptFromString:sessionKeyScript];
 	
     NSDictionary *deviceProperties = [ self deviceProperties];
@@ -928,7 +928,8 @@ static NSString* cdvVersion;
 - (void) onAppWillResignActive:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationWillResignActive");
-    [self.webView stringByEvaluatingJavaScriptFromString:@"Cordova.fireDocumentEvent('resign');"];
+    // TODO: uhh, wut? pause/resume not enough?
+    [self.webView stringByEvaluatingJavaScriptFromString:@"require('cordova').fireDocumentEvent('resign');"];
 }
 
 /*
@@ -939,14 +940,15 @@ static NSString* cdvVersion;
 - (void) onAppWillEnterForeground:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationWillEnterForeground");
-    [self.webView stringByEvaluatingJavaScriptFromString:@"Cordova.fireDocumentEvent('resume');"];
+    [self.webView stringByEvaluatingJavaScriptFromString:@"require('cordova').fireDocumentEvent('resume');"];
 }
 
 // This method is called to let your application know that it moved from the inactive to
active state. 
 - (void) onAppDidBecomeActive:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationDidBecomeActive");
-    [self.webView stringByEvaluatingJavaScriptFromString:@"Cordova.fireDocumentEvent('active');"];
+    // TODO: uhh, wut? pause/resume not enough?
+    [self.webView stringByEvaluatingJavaScriptFromString:@"require('cordova').fireDocumentEvent('active');"];
 }
 
 /*
@@ -956,7 +958,7 @@ static NSString* cdvVersion;
 - (void) onAppDidEnterBackground:(NSNotification*)notification
 {
     //NSLog(@"%@",@"applicationDidEnterBackground");
-    [self.webView stringByEvaluatingJavaScriptFromString:@"Cordova.fireDocumentEvent('pause');"];
+    [self.webView stringByEvaluatingJavaScriptFromString:@"require('cordova').fireDocumentEvent('pause');"];
 }
 
 // ///////////////////////


Mime
View raw message