cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject [07/50] [abbrv] ios commit: CB-8556 - handleOpenURL functionality to be removed to a plugin
Date Thu, 19 Mar 2015 16:55:56 GMT
CB-8556 - handleOpenURL functionality to be removed to a plugin


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

Branch: refs/heads/unplug-whitelist
Commit: 2eea1392923140ffefd1c994c383b52e1b9c4468
Parents: 962f47c
Author: Shazron Abdullah <shazron@apache.org>
Authored: Thu Mar 12 17:26:52 2015 -0700
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Thu Mar 12 17:26:52 2015 -0700

----------------------------------------------------------------------
 CordovaLib/Classes/CDVViewController.m | 48 -----------------------------
 1 file changed, 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2eea1392/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index e2887e4..79ed2f0 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -868,54 +868,6 @@
 
 // ///////////////////////
 
-- (void)onPageDidLoad:(NSNotification*)notification
-{
-    if (self.openURL) {
-        [self processOpenUrl:self.openURL pageLoaded:YES];
-    }
-}
-
-- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
-{
-    __weak CDVViewController* weakSelf = self;
-
-    dispatch_block_t handleOpenUrl = ^(void) {
-        NSString* jsString = [NSString stringWithFormat:@"if (typeof handleOpenURL === 'function')
{ handleOpenURL(\"%@\");}", url];
-        [_webViewEngine evaluateJavaScript:jsString
-                         completionHandler:^(id object, NSError* error) {
-            if (error == nil) {
-                weakSelf.openURL = nil;
-            }
-        }];
-    };
-
-    if (!pageLoaded) {
-        // query the webview for readystate
-        NSString* jsString = @"document.readystate";
-        [_webViewEngine evaluateJavaScript:jsString
-                         completionHandler:^(id object, NSError* error) {
-            if ((error == nil) && [object isKindOfClass:[NSString class]]) {
-                NSString* readyState = (NSString*)object;
-                BOOL ready = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
-                if (ready) {
-                    handleOpenUrl();
-                } else {
-                    weakSelf.openURL = url;
-                }
-            }
-        }];
-    } else {
-        handleOpenUrl();
-    }
-}
-
-- (void)processOpenUrl:(NSURL*)url
-{
-    [self processOpenUrl:url pageLoaded:NO];
-}
-
-// ///////////////////////
-
 - (void)dealloc
 {
     [CDVURLProtocol unregisterViewController:self];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message