Changeset 99d222a in orbit for iOS


Ignore:
Timestamp:
08/29/13 06:22:36 (6 years ago)
Author:
Steve Castellotti <sc@…>
Branches:
master, Servo, Tab_Interface, pyramid
Children:
5d87396
Parents:
2e79fbc
Message:

Support:

  • all results open in Safari
Location:
iOS/Orbit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • iOS/Orbit/Orbit/controllers/SupportViewController.m

    r2e79fbc r99d222a  
    1515- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil 
    1616{ 
    17     self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 
    18     if (self) { 
    19         // Custom initialization 
    20     } 
    21     return self; 
     17   self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; 
     18   if (self) { 
     19      // Custom initialization 
     20   } 
     21   return self; 
    2222} 
    2323 
    2424- (void)viewDidLoad 
    2525{ 
    26     [super viewDidLoad]; 
    27     [self loadSupportSite]; 
     26   [super viewDidLoad]; 
     27   [self loadSupportSite]; 
    2828} 
    2929 
    30 //UIWebView *description; 
    31 //@synthesize description; 
    3230 
    3331#define BASEURL [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]] 
    3432- (void) loadSupportSite 
    3533{ 
    36 //    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://puzzlebox.info/forums/forumdisplay.php?fid=4"]]]; 
    37 //    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://orbit.puzzlebox.info/contact"]]]; 
    38  
    39 //   [description loadHTMLString:string baseURL:nil]; 
    40 //   description.delegate = self; 
     34   //    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://puzzlebox.info/forums/forumdisplay.php?fid=4"]]]; 
     35   //    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://orbit.puzzlebox.info/contact"]]]; 
     36    
    4137    
    4238   NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"support" ofType:@"html"]; 
     
    5147 
    5248-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType { 
     49    
     50   // Launch clicked links in Safari 
    5351   if ( inType == UIWebViewNavigationTypeLinkClicked ) { 
    5452      [[UIApplication sharedApplication] openURL:[inRequest URL]]; 
     
    5654   } 
    5755    
     56   // Launch form results in Safari 
     57   if ( inType == UIWebViewNavigationTypeFormSubmitted ) { 
     58      [[UIApplication sharedApplication] openURL:[inRequest URL]]; 
     59      return NO; 
     60   } 
     61    
    5862   return YES; 
     63    
    5964} 
    6065 
    61  
    62 //-(BOOL) webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType { 
    63 //   if ( inType == UIWebViewNavigationTypeLinkClicked ) { 
    64 //      NSURL *url = [inRequest URL]; 
    65 //      if ([[url absoluteString] rangeOfString:@"tracker"].location == NSNotFound) { 
    66 //         [[UIApplication sharedApplication] openURL:[inRequest URL]]; 
    67 //         return NO; 
    68 //      } 
    69 //   } 
    70 //   return YES; 
    71 //} 
    7266 
    7367 
     
    7670- (void)webViewDidFinishLoad:(UIWebView *)webView 
    7771{ 
    78     retryButton.hidden = YES; 
    79     status.hidden = YES; 
     72   retryButton.hidden = YES; 
     73   status.hidden = YES; 
    8074} 
    8175 
    8276- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error 
    8377{ 
    84     UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Connected" message:@"Unable to view support since you have no internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
    85     [alert show]; 
    86     retryButton.hidden = NO; 
    87     status.hidden = NO; 
    88     status.text = @"Unable to load support site"; 
     78   UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Connected" message:@"Unable to view support since you have no internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; 
     79   [alert show]; 
     80   retryButton.hidden = NO; 
     81   status.hidden = NO; 
     82   status.text = @"Unable to load support site"; 
    8983} 
    9084 
     
    9286 
    9387- (IBAction) retryButtonPressed:(id) sender { 
    94     retryButton.hidden = YES; 
    95     status.text = @"Loading support website..."; 
    96     [self loadSupportSite]; 
     88   retryButton.hidden = YES; 
     89   status.text = @"Loading support website..."; 
     90   [self loadSupportSite]; 
    9791} 
    9892 
Note: See TracChangeset for help on using the changeset viewer.