incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Git at Apache <...@git.apache.org>
Subject incubator-cordova-ios pull request: openInSafari
Date Sun, 20 May 2012 14:40:47 GMT
GitHub user RandyMcMillan opened a pull request:

    https://github.com/apache/incubator-cordova-ios/pull/19

    openInSafari

    https://issues.apache.org/jira/browse/CB-362
    
    Adding
    
    -(BOOL)webView:(UIWebView *)webView
    shouldStartLoadWithRequest:(NSURLRequest *)request
    navigationType:(UIWebViewNavigationType)navigationType;
    {
        NSURL *requestURL =[ [ request URL ] retain ];
        if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [
    requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL
    scheme ] isEqualToString: @"mailto" ])
            && ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) {
            return ![ [ UIApplication sharedApplication ] openURL: [
    requestURL autorelease ] ];
        }
        [ requestURL release ];
        return YES;
    }
    
    to the MainViewController.m works like a charm.
    
    Maybe i'm misinterpreting the issue.
    
    
    Additionally
    
    
    
    -(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request
navigationType:(UIWebViewNavigationType)navigationType; 
    {
        NSURL *requestURL =[ [ request URL ] retain ]; 
        if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [ requestURL scheme
] isEqualToString: @"https" ] || [ [ requestURL scheme ] isEqualToString: @"mailto" ]) 
            && ( navigationType == UIWebViewNavigationTypeLinkClicked || navigationType
== UIWebViewNavigationTypeOther ) ) { 
            return ![ [ UIApplication sharedApplication ] openURL: [ requestURL autorelease
] ]; 
        } 
        [ requestURL release ]; 
        return YES; 
    }
    
    
    the 
    
    || navigationType == UIWebViewNavigationTypeOther maybe be added. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/RandyMcMillan/incubator-cordova-ios openInSafari

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-cordova-ios/pull/19.patch

----
commit 4d619e4d7e388bdfa9146a59b08abe76f890648b
Author: RandyMcMillan <randy.lee.mcmillan@gmail.com>
Date:   2012-05-20T07:37:24-07:00

    openInSafari
    
    https://issues.apache.org/jira/browse/CB-362
    
    Adding
    
    -(BOOL)webView:(UIWebView *)webView
    shouldStartLoadWithRequest:(NSURLRequest *)request
    navigationType:(UIWebViewNavigationType)navigationType;
    {
        NSURL *requestURL =[ [ request URL ] retain ];
        if ( ( [ [ requestURL scheme ] isEqualToString: @"http" ] || [ [
    requestURL scheme ] isEqualToString: @"https" ] || [ [ requestURL
    scheme ] isEqualToString: @"mailto" ])
            && ( navigationType == UIWebViewNavigationTypeLinkClicked ) ) {
            return ![ [ UIApplication sharedApplication ] openURL: [
    requestURL autorelease ] ];
        }
        [ requestURL release ];
        return YES;
    }
    
    to the MainViewController.m works like a charm.
    
    Maybe i'm misinterpreting the issue.

----


Mime
View raw message