summaryrefslogtreecommitdiff
path: root/UICaboodle
diff options
context:
space:
mode:
Diffstat (limited to 'UICaboodle')
-rw-r--r--UICaboodle/BrowserView.h1
-rw-r--r--UICaboodle/BrowserView.mm18
2 files changed, 18 insertions, 1 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h
index e2da3c0..22a4f10 100644
--- a/UICaboodle/BrowserView.h
+++ b/UICaboodle/BrowserView.h
@@ -38,6 +38,7 @@
- (bool) webView:(WebView *)view shouldRunJavaScriptAlertPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
- (bool) webView:(WebView *)view shouldRunJavaScriptConfirmPanelWithMessage:(NSString *)message initiatedByFrame:(WebFrame *)frame;
- (bool) webView:(WebView *)view shouldRunJavaScriptTextInputPanelWithPrompt:(NSString *)prompt defaultText:(NSString *)text initiatedByFrame:(WebFrame *)frame;
+- (void) webViewUpdateViewSettings:(UIWebView *)view;
@end
@interface CYWebView : UIWebView
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm
index e446d60..705c7e1 100644
--- a/UICaboodle/BrowserView.mm
+++ b/UICaboodle/BrowserView.mm
@@ -376,6 +376,14 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
}
// }}}
+- (void) _updateViewSettings {
+ [super _updateViewSettings];
+
+ id<CYWebViewDelegate> delegate([self delegate]);
+ if ([delegate respondsToSelector:@selector(webViewUpdateViewSettings:)])
+ [delegate webViewUpdateViewSettings:self];
+}
+
+ (void) initialize {
if (Class $UIWebViewWebViewDelegate = objc_getClass("UIWebViewWebViewDelegate")) {
class_addMethod($UIWebViewWebViewDelegate, @selector(webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:), (IMP) &$UIWebViewWebViewDelegate$webView$decidePolicyForNewWindowAction$request$newFrameName$decisionListener$, "v28@0:4@8@12@16@20@24");
@@ -552,9 +560,17 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se
closer_ = [function retain];
}
+- (void) _setViewportWidth {
+ [[webview_ _documentView] setViewportSize:CGSizeMake(width_, UIWebViewGrowsAndShrinksToFitHeight) forDocumentTypes:0x10];
+}
+
- (void) setViewportWidth:(float)width {
width_ = width != 0 ? width : [[self class] defaultWidth];
- [[webview_ _documentView] setViewportSize:CGSizeMake(width_, UIWebViewGrowsAndShrinksToFitHeight) forDocumentTypes:0x10];
+ [self _setViewportWidth];
+}
+
+- (void) webViewUpdateViewSettings:(UIWebView *)view {
+ [self _setViewportWidth];
}
- (void) _openMailToURL:(NSURL *)url {