You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/01/16 01:18:45 UTC

ios commit: [CB-2071] InAppBrowser: allow UIWebView settings like main CordovaWebView

Updated Branches:
  refs/heads/master 013dd00cc -> 25390650f


[CB-2071] InAppBrowser: allow UIWebView settings like main CordovaWebView


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/25390650
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/25390650
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/25390650

Branch: refs/heads/master
Commit: 25390650f7696c9afbb5bf71f704ae3334133e2d
Parents: 013dd00
Author: Shazron Abdullah <sh...@apache.org>
Authored: Tue Jan 15 16:18:26 2013 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Tue Jan 15 16:18:38 2013 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVInAppBrowser.h |    6 ++++++
 CordovaLib/Classes/CDVInAppBrowser.m |   14 +++++++++++++-
 2 files changed, 19 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/25390650/CordovaLib/Classes/CDVInAppBrowser.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVInAppBrowser.h b/CordovaLib/Classes/CDVInAppBrowser.h
index fb3d485..ed0beaf 100644
--- a/CordovaLib/Classes/CDVInAppBrowser.h
+++ b/CordovaLib/Classes/CDVInAppBrowser.h
@@ -69,6 +69,12 @@
 @property (nonatomic, copy) NSString* presentationstyle;
 @property (nonatomic, copy) NSString* transitionstyle;
 
+@property (nonatomic, assign) BOOL enableviewportscale;
+@property (nonatomic, assign) BOOL mediaplaybackrequiresuseraction;
+@property (nonatomic, assign) BOOL allowinlinemediaplayback;
+@property (nonatomic, assign) BOOL keyboarddisplayrequiresuseraction;
+@property (nonatomic, assign) BOOL suppressesincrementalrendering;
+
 + (CDVInAppBrowserOptions*)parseOptions:(NSString*)options;
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/25390650/CordovaLib/Classes/CDVInAppBrowser.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVInAppBrowser.m b/CordovaLib/Classes/CDVInAppBrowser.m
index df36026..c8afa34 100644
--- a/CordovaLib/Classes/CDVInAppBrowser.m
+++ b/CordovaLib/Classes/CDVInAppBrowser.m
@@ -125,6 +125,13 @@
     }
     self.inAppBrowserViewController.modalTransitionStyle = transitionStyle;
 
+    // UIWebView options
+    self.inAppBrowserViewController.webView.scalesPageToFit = browserOptions.enableviewportscale;
+    self.inAppBrowserViewController.webView.mediaPlaybackRequiresUserAction = browserOptions.mediaplaybackrequiresuseraction;
+    self.inAppBrowserViewController.webView.allowsInlineMediaPlayback = browserOptions.allowinlinemediaplayback;
+    self.inAppBrowserViewController.webView.keyboardDisplayRequiresUserAction = browserOptions.keyboarddisplayrequiresuseraction;
+    self.inAppBrowserViewController.webView.suppressesIncrementalRendering = browserOptions.suppressesincrementalrendering;
+
     if (self.viewController.modalViewController != self.inAppBrowserViewController) {
         [self.viewController presentModalViewController:self.inAppBrowserViewController animated:YES];
     }
@@ -234,7 +241,6 @@
         [self.view sendSubviewToBack:self.webView];
 
         self.webView.delegate = self;
-        self.webView.scalesPageToFit = TRUE;
         self.webView.backgroundColor = [UIColor whiteColor];
 
         self.webView.clearsContextBeforeDrawing = YES;
@@ -482,6 +488,12 @@
     if (self = [super init]) {
         // default values
         self.location = YES;
+
+        self.enableviewportscale = NO;
+        self.mediaplaybackrequiresuseraction = NO;
+        self.allowinlinemediaplayback = NO;
+        self.keyboarddisplayrequiresuseraction = YES;
+        self.suppressesincrementalrendering = NO;
     }
 
     return self;