You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/03/06 02:38:26 UTC

[3/3] mac commit: Successful firing of deviceready (works with a hacked cordova.osx.js search for TODO:)

Updated Branches:
  refs/heads/master 9aac186a9 -> 15c646370


Successful firing of deviceready (works with a hacked cordova.osx.js search for TODO:)


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

Branch: refs/heads/master
Commit: 15c646370c477d301d35099281db4cd2c61d5a36
Parents: 9aac186
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue Mar 5 17:38:20 2013 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue Mar 5 17:38:20 2013 -0800

----------------------------------------------------------------------
 CordovaMac/CordovaMac/CDVBridge.m       |    2 +-
 CordovaMac/CordovaMac/WebViewDelegate.m |    7 +
 CordovaMac/www/cordova.osx.js           | 5793 ++++++++++++++++++++++++++
 CordovaMac/www/index.html               |   42 +-
 4 files changed, 5809 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/15c64637/CordovaMac/CordovaMac/CDVBridge.m
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/CDVBridge.m b/CordovaMac/CordovaMac/CDVBridge.m
index f9ac368..e0ce358 100644
--- a/CordovaMac/CordovaMac/CDVBridge.m
+++ b/CordovaMac/CordovaMac/CDVBridge.m
@@ -125,7 +125,7 @@
     NSArray* arguments = [self convertWebScriptObjectToNSArray:webScriptObject];
 #pragma unused(arguments)
     
-	NSLog(@"TODO: flesh out exec to dispatch the commands, possibly re-use iOS code");
+	NSLog(@"TODO: [%@.%@] flesh out exec to dispatch the commands, possibly re-use iOS code", service, action);
 }
 
 #pragma mark WebScripting Protocol

http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/15c64637/CordovaMac/CordovaMac/WebViewDelegate.m
----------------------------------------------------------------------
diff --git a/CordovaMac/CordovaMac/WebViewDelegate.m b/CordovaMac/CordovaMac/WebViewDelegate.m
index 6bf5434..52934bc 100644
--- a/CordovaMac/CordovaMac/WebViewDelegate.m
+++ b/CordovaMac/CordovaMac/WebViewDelegate.m
@@ -41,6 +41,13 @@
     [windowScriptObject setValue:self.bridge forKey:@"cordovabridge"];
 }
 
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+    id win = [sender windowScriptObject];
+    NSString* nativeReady = @"try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}";
+    [win evaluateWebScript:nativeReady];
+}
+
 /* This logs all errors from Javascript, nifty */
 - (void) webView:(WebView*)webView addMessageToConsole:(NSDictionary*)message
 {