Return-Path: X-Original-To: apmail-cordova-commits-archive@www.apache.org Delivered-To: apmail-cordova-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E02D7176F3 for ; Thu, 19 Mar 2015 16:56:25 +0000 (UTC) Received: (qmail 59213 invoked by uid 500); 19 Mar 2015 16:55:51 -0000 Delivered-To: apmail-cordova-commits-archive@cordova.apache.org Received: (qmail 59143 invoked by uid 500); 19 Mar 2015 16:55:51 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 58771 invoked by uid 99); 19 Mar 2015 16:55:51 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Mar 2015 16:55:51 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D4284E1935; Thu, 19 Mar 2015 16:55:50 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ian@apache.org To: commits@cordova.apache.org Date: Thu, 19 Mar 2015 16:55:56 -0000 Message-Id: <54458fcc48ff46e5ae4152a54cc0340a@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/50] [abbrv] ios commit: CB-8556 - handleOpenURL functionality to be removed to a plugin 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 Authored: Thu Mar 12 17:26:52 2015 -0700 Committer: Shazron Abdullah 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