diff --git a/contrib/mobile/iOS/Onelab/AboutViewController.h b/contrib/mobile/iOS/Onelab/AboutViewController.h index f509cecc873a374bcadc4df4801d58e73b73558e..8df8225255c6ebaf639754553e291ec745987a1f 100644 --- a/contrib/mobile/iOS/Onelab/AboutViewController.h +++ b/contrib/mobile/iOS/Onelab/AboutViewController.h @@ -1,6 +1,6 @@ #import <UIKit/UIKit.h> -@interface AboutViewController : UIViewController +@interface AboutViewController : UIViewController <UIWebViewDelegate> @property (weak, nonatomic) IBOutlet UIWebView *aboutView; diff --git a/contrib/mobile/iOS/Onelab/AboutViewController.mm b/contrib/mobile/iOS/Onelab/AboutViewController.mm index cd6812230e8fc152ffc5c5b9585986834a6a7729..899719e5778a01128c6083eb00978172f2374196 100644 --- a/contrib/mobile/iOS/Onelab/AboutViewController.mm +++ b/contrib/mobile/iOS/Onelab/AboutViewController.mm @@ -19,10 +19,21 @@ return self; } +// this allows to open links in Safari, instead of opening them in the AboutViewController +-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType { + if ( inType == UIWebViewNavigationTypeLinkClicked ) { + [[UIApplication sharedApplication] openURL:[inRequest URL]]; + return NO; + } + + return YES; +} + - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. + self.aboutView.delegate = self; [self.aboutView loadHTMLString:[NSString stringWithFormat:@"<center><h3>Onelab/Mobile</h3>Version %@<p>Copyright (C) 2014 Christophe Geuzaine and Maxime Graulich, University of Liège</p><p>Visit <a href=\"http://onelab.info/\">http://onelab.info/</a> for more information</p><p>This version of Onelab/Mobile contains:</p><h3>Gmsh</h3>Version %s (<i>Build date:</i> %s)<p>Copyright (C) 1997-2014 Christophe Geuzaine and Jean-François Remacle</p><p><a href=\"http://geuz.org/gmsh/doc/CREDITS.txt\">Credits</a> and <a href=\"http://geuz.org/gmsh/doc/LICENSE.txt\">licensing information</a></p><p><i>Build options:</i> %s</p><p>Visit <a href=\"http://gmsh.info/\">http://gmsh.info</a> for more information</p><h3>GetDP</h3>Version %s (<i>Build date:</i> %s)<p>Copyright (C) 1997-2014 Patrick Dular and Christophe Geuzaine, University of Liège</p><p><a href=\"http://geuz.org/getdp/doc/CREDITS.txt\">Credits</a> and <a href=\"http://geuz.org/getdp/doc/LICENSE.txt\">licensing information</a></p><p><i>Build options:</i> %s</p><p>Visit <a href=\"http://getdp.info\">http://getdp.info</a> for more information</p></center>", [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"], GMSH_VERSION,