cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/4] ios commit: Add a notification so plugins will know when page loads occur.
Date Fri, 15 Feb 2013 19:12:04 GMT
Add a notification so plugins will know when page loads occur.


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

Branch: refs/heads/master
Commit: fa03d936de46bb695b2d7a2c5b16f6fc11a84630
Parents: 8bfa788
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Feb 14 20:29:27 2013 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Fri Feb 15 13:48:51 2013 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVPlugin.h         |    1 +
 CordovaLib/Classes/CDVPlugin.m         |    3 +++
 CordovaLib/Classes/CDVViewController.m |    2 ++
 3 files changed, 6 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fa03d936/CordovaLib/Classes/CDVPlugin.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPlugin.h b/CordovaLib/Classes/CDVPlugin.h
index 9317ad0..f5b50eb 100644
--- a/CordovaLib/Classes/CDVPlugin.h
+++ b/CordovaLib/Classes/CDVPlugin.h
@@ -23,6 +23,7 @@
 #import "NSMutableArray+QueueAdditions.h"
 #import "CDVCommandDelegate.h"
 
+#define CDVPageDidLoadNotification @"CDVPageDidLoadNotification"
 #define CDVPluginHandleOpenURLNotification @"CDVPluginHandleOpenURLNotification"
 #define CDVPluginResetNotification @"CDVPluginResetNotification"
 #define CDVLocalNotification @"CDVLocalNotification"

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fa03d936/CordovaLib/Classes/CDVPlugin.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPlugin.m b/CordovaLib/Classes/CDVPlugin.m
index c2ef4aa..a42d241 100644
--- a/CordovaLib/Classes/CDVPlugin.m
+++ b/CordovaLib/Classes/CDVPlugin.m
@@ -62,6 +62,9 @@
 
     // Added in 2.3.0
     // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveLocalNotification:)
name:CDVLocalNotification object:nil];
+
+    // Added in 2.5.0
+    // [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(pageDidLoad:)
name:CDVPageDidLoadNotification object:nil];
 }
 
 - (void)dispose

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fa03d936/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index 41d98d2..8cda743 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -551,6 +551,8 @@
     [self.webView stringByEvaluatingJavaScriptFromString:nativeReady];
 
     [self processOpenUrl];
+
+    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPageDidLoadNotification
object:nil]];
 }
 
 - (void)webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error


Mime
View raw message