Clean up whitespace (mainly due to no newline at eof warning)

This commit is contained in:
Andrew Grieve 2014-06-04 14:22:41 -04:00
parent 75cadab5ee
commit eb704f8212
2 changed files with 24 additions and 22 deletions

View File

@ -98,4 +98,5 @@
@property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate; @property (nonatomic, weak) id <CDVScreenOrientationDelegate> orientationDelegate;
@end @end

View File

@ -73,7 +73,7 @@
if ([[url host] isEqualToString:@"itunes.apple.com"]) { if ([[url host] isEqualToString:@"itunes.apple.com"]) {
return YES; return YES;
} }
return NO; return NO;
} }
@ -90,7 +90,7 @@
if (url != nil) { if (url != nil) {
NSURL* baseUrl = [self.webView.request URL]; NSURL* baseUrl = [self.webView.request URL];
NSURL* absoluteUrl = [[NSURL URLWithString:url relativeToURL:baseUrl] absoluteURL]; NSURL* absoluteUrl = [[NSURL URLWithString:url relativeToURL:baseUrl] absoluteURL];
if ([self isSystemUrl:absoluteUrl]) { if ([self isSystemUrl:absoluteUrl]) {
target = kInAppBrowserTargetSystem; target = kInAppBrowserTargetSystem;
} }
@ -187,7 +187,7 @@
} }
} }
} }
// UIWebView options // UIWebView options
self.inAppBrowserViewController.webView.scalesPageToFit = browserOptions.enableviewportscale; self.inAppBrowserViewController.webView.scalesPageToFit = browserOptions.enableviewportscale;
self.inAppBrowserViewController.webView.mediaPlaybackRequiresUserAction = browserOptions.mediaplaybackrequiresuseraction; self.inAppBrowserViewController.webView.mediaPlaybackRequiresUserAction = browserOptions.mediaplaybackrequiresuseraction;
@ -196,7 +196,7 @@
self.inAppBrowserViewController.webView.keyboardDisplayRequiresUserAction = browserOptions.keyboarddisplayrequiresuseraction; self.inAppBrowserViewController.webView.keyboardDisplayRequiresUserAction = browserOptions.keyboarddisplayrequiresuseraction;
self.inAppBrowserViewController.webView.suppressesIncrementalRendering = browserOptions.suppressesincrementalrendering; self.inAppBrowserViewController.webView.suppressesIncrementalRendering = browserOptions.suppressesincrementalrendering;
} }
[self.inAppBrowserViewController navigateTo:url]; [self.inAppBrowserViewController navigateTo:url];
if (!browserOptions.hidden) { if (!browserOptions.hidden) {
[self show:nil]; [self show:nil];
@ -213,9 +213,9 @@
NSLog(@"Tried to show IAB while already shown"); NSLog(@"Tried to show IAB while already shown");
return; return;
} }
_previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle; _previousStatusBarStyle = [UIApplication sharedApplication].statusBarStyle;
CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc] CDVInAppBrowserNavigationController* nav = [[CDVInAppBrowserNavigationController alloc]
initWithRootViewController:self.inAppBrowserViewController]; initWithRootViewController:self.inAppBrowserViewController];
nav.orientationDelegate = self.inAppBrowserViewController; nav.orientationDelegate = self.inAppBrowserViewController;
@ -439,7 +439,7 @@
// Don't recycle the ViewController since it may be consuming a lot of memory. // Don't recycle the ViewController since it may be consuming a lot of memory.
// Also - this is required for the PDF/User-Agent bug work-around. // Also - this is required for the PDF/User-Agent bug work-around.
self.inAppBrowserViewController = nil; self.inAppBrowserViewController = nil;
_previousStatusBarStyle = -1; _previousStatusBarStyle = -1;
if (IsAtLeastiOSVersion(@"7.0")) { if (IsAtLeastiOSVersion(@"7.0")) {
@ -477,7 +477,7 @@
BOOL toolbarIsAtBottom = ![_browserOptions.toolbarposition isEqualToString:kInAppBrowserToolbarBarPositionTop]; BOOL toolbarIsAtBottom = ![_browserOptions.toolbarposition isEqualToString:kInAppBrowserToolbarBarPositionTop];
webViewBounds.size.height -= _browserOptions.location ? FOOTER_HEIGHT : TOOLBAR_HEIGHT; webViewBounds.size.height -= _browserOptions.location ? FOOTER_HEIGHT : TOOLBAR_HEIGHT;
self.webView = [[UIWebView alloc] initWithFrame:webViewBounds]; self.webView = [[UIWebView alloc] initWithFrame:webViewBounds];
self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight); self.webView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
[self.view addSubview:self.webView]; [self.view addSubview:self.webView];
@ -519,7 +519,7 @@
float toolbarY = toolbarIsAtBottom ? self.view.bounds.size.height - TOOLBAR_HEIGHT : 0.0; float toolbarY = toolbarIsAtBottom ? self.view.bounds.size.height - TOOLBAR_HEIGHT : 0.0;
CGRect toolbarFrame = CGRectMake(0.0, toolbarY, self.view.bounds.size.width, TOOLBAR_HEIGHT); CGRect toolbarFrame = CGRectMake(0.0, toolbarY, self.view.bounds.size.width, TOOLBAR_HEIGHT);
self.toolbar = [[UIToolbar alloc] initWithFrame:toolbarFrame]; self.toolbar = [[UIToolbar alloc] initWithFrame:toolbarFrame];
self.toolbar.alpha = 1.000; self.toolbar.alpha = 1.000;
self.toolbar.autoresizesSubviews = YES; self.toolbar.autoresizesSubviews = YES;
@ -535,7 +535,7 @@
CGFloat labelInset = 5.0; CGFloat labelInset = 5.0;
float locationBarY = toolbarIsAtBottom ? self.view.bounds.size.height - FOOTER_HEIGHT : self.view.bounds.size.height - LOCATIONBAR_HEIGHT; float locationBarY = toolbarIsAtBottom ? self.view.bounds.size.height - FOOTER_HEIGHT : self.view.bounds.size.height - LOCATIONBAR_HEIGHT;
self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelInset, locationBarY, self.view.bounds.size.width - labelInset, LOCATIONBAR_HEIGHT)]; self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelInset, locationBarY, self.view.bounds.size.width - labelInset, LOCATIONBAR_HEIGHT)];
self.addressLabel.adjustsFontSizeToFitWidth = NO; self.addressLabel.adjustsFontSizeToFitWidth = NO;
self.addressLabel.alpha = 1.000; self.addressLabel.alpha = 1.000;
@ -549,13 +549,13 @@
self.addressLabel.enabled = YES; self.addressLabel.enabled = YES;
self.addressLabel.hidden = NO; self.addressLabel.hidden = NO;
self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail; self.addressLabel.lineBreakMode = NSLineBreakByTruncatingTail;
if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumScaleFactor:")]) { if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumScaleFactor:")]) {
[self.addressLabel setValue:@(10.0/[UIFont labelFontSize]) forKey:@"minimumScaleFactor"]; [self.addressLabel setValue:@(10.0/[UIFont labelFontSize]) forKey:@"minimumScaleFactor"];
} else if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumFontSize:")]) { } else if ([self.addressLabel respondsToSelector:NSSelectorFromString(@"setMinimumFontSize:")]) {
[self.addressLabel setValue:@(10.0) forKey:@"minimumFontSize"]; [self.addressLabel setValue:@(10.0) forKey:@"minimumFontSize"];
} }
self.addressLabel.multipleTouchEnabled = NO; self.addressLabel.multipleTouchEnabled = NO;
self.addressLabel.numberOfLines = 1; self.addressLabel.numberOfLines = 1;
self.addressLabel.opaque = NO; self.addressLabel.opaque = NO;
@ -668,7 +668,7 @@
if (show) { if (show) {
self.toolbar.hidden = NO; self.toolbar.hidden = NO;
CGRect webViewBounds = self.view.bounds; CGRect webViewBounds = self.view.bounds;
if (locationbarVisible) { if (locationbarVisible) {
// locationBar at the bottom, move locationBar up // locationBar at the bottom, move locationBar up
// put toolBar at the bottom // put toolBar at the bottom
@ -682,7 +682,7 @@
webViewBounds.size.height -= TOOLBAR_HEIGHT; webViewBounds.size.height -= TOOLBAR_HEIGHT;
self.toolbar.frame = toolbarFrame; self.toolbar.frame = toolbarFrame;
} }
if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop]) { if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop]) {
toolbarFrame.origin.y = 0; toolbarFrame.origin.y = 0;
webViewBounds.origin.y += toolbarFrame.size.height; webViewBounds.origin.y += toolbarFrame.size.height;
@ -691,7 +691,7 @@
toolbarFrame.origin.y = (webViewBounds.size.height + LOCATIONBAR_HEIGHT); toolbarFrame.origin.y = (webViewBounds.size.height + LOCATIONBAR_HEIGHT);
} }
[self setWebViewFrame:webViewBounds]; [self setWebViewFrame:webViewBounds];
} else { } else {
self.toolbar.hidden = YES; self.toolbar.hidden = YES;
@ -725,7 +725,7 @@
[CDVUserAgentUtil releaseLock:&_userAgentLockToken]; [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
[super viewDidUnload]; [super viewDidUnload];
} }
- (UIStatusBarStyle)preferredStatusBarStyle - (UIStatusBarStyle)preferredStatusBarStyle
{ {
return UIStatusBarStyleDefault; return UIStatusBarStyleDefault;
@ -735,7 +735,7 @@
{ {
[CDVUserAgentUtil releaseLock:&_userAgentLockToken]; [CDVUserAgentUtil releaseLock:&_userAgentLockToken];
self.currentURL = nil; self.currentURL = nil;
if ((self.navigationDelegate != nil) && [self.navigationDelegate respondsToSelector:@selector(browserExit)]) { if ((self.navigationDelegate != nil) && [self.navigationDelegate respondsToSelector:@selector(browserExit)]) {
[self.navigationDelegate browserExit]; [self.navigationDelegate browserExit];
} }
@ -774,14 +774,14 @@
{ {
[self.webView goForward]; [self.webView goForward];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
{ {
if (IsAtLeastiOSVersion(@"7.0")) { if (IsAtLeastiOSVersion(@"7.0")) {
[[UIApplication sharedApplication] setStatusBarStyle:[self preferredStatusBarStyle]]; [[UIApplication sharedApplication] setStatusBarStyle:[self preferredStatusBarStyle]];
} }
[self rePositionViews]; [self rePositionViews];
[super viewWillAppear:animated]; [super viewWillAppear:animated];
} }
@ -982,7 +982,7 @@
if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) { if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(supportedInterfaceOrientations)]) {
return [self.orientationDelegate supportedInterfaceOrientations]; return [self.orientationDelegate supportedInterfaceOrientations];
} }
return 1 << UIInterfaceOrientationPortrait; return 1 << UIInterfaceOrientationPortrait;
} }
@ -991,9 +991,10 @@
if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotateToInterfaceOrientation:)]) { if ((self.orientationDelegate != nil) && [self.orientationDelegate respondsToSelector:@selector(shouldAutorotateToInterfaceOrientation:)]) {
return [self.orientationDelegate shouldAutorotateToInterfaceOrientation:interfaceOrientation]; return [self.orientationDelegate shouldAutorotateToInterfaceOrientation:interfaceOrientation];
} }
return YES; return YES;
} }
@end @end