updated inappbrowser with latest native + js code

This commit is contained in:
Steven Gill
2013-06-13 15:49:11 -07:00
parent 9f8af5f464
commit 8c0c36d5bf
4 changed files with 42 additions and 5 deletions
+12 -3
View File
@@ -101,13 +101,13 @@
}
}
CDVInAppBrowserOptions* browserOptions = [CDVInAppBrowserOptions parseOptions:options];
[self.inAppBrowserViewController showLocationBar:browserOptions.location];
[self.inAppBrowserViewController showToolBar:browserOptions.toolbar];
if (browserOptions.closebuttoncaption != nil) {
[self.inAppBrowserViewController setCloseButtonTitle:browserOptions.closebuttoncaption];
}
// Set Presentation Style
UIModalPresentationStyle presentationStyle = UIModalPresentationFullScreen; // default
if (browserOptions.presentationstyle != nil) {
@@ -130,6 +130,7 @@
}
self.inAppBrowserViewController.modalTransitionStyle = transitionStyle;
// UIWebView options
self.inAppBrowserViewController.webView.scalesPageToFit = browserOptions.enableviewportscale;
self.inAppBrowserViewController.webView.mediaPlaybackRequiresUserAction = browserOptions.mediaplaybackrequiresuseraction;
@@ -138,13 +139,20 @@
self.inAppBrowserViewController.webView.keyboardDisplayRequiresUserAction = browserOptions.keyboarddisplayrequiresuseraction;
self.inAppBrowserViewController.webView.suppressesIncrementalRendering = browserOptions.suppressesincrementalrendering;
}
if (self.viewController.modalViewController != self.inAppBrowserViewController) {
if (! browserOptions.hidden) {
if (self.viewController.modalViewController != self.inAppBrowserViewController) {
[self.viewController presentModalViewController:self.inAppBrowserViewController animated:YES];
}
}
[self.inAppBrowserViewController navigateTo:url];
}
- (void)show:(CDVInvokedUrlCommand*)command
{
[self.viewController presentModalViewController:self.inAppBrowserViewController animated:YES];
}
- (void)openInCordovaWebView:(NSURL*)url withOptions:(NSString*)options
{
if ([self.commandDelegate URLIsWhitelisted:url]) {
@@ -764,6 +772,7 @@
self.allowinlinemediaplayback = NO;
self.keyboarddisplayrequiresuseraction = YES;
self.suppressesincrementalrendering = NO;
self.hidden = NO;
}
return self;