mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-01-19 02:36:29 +00:00
Merge branch 'feature/webview-links' into develop
This commit is contained in:
@@ -393,9 +393,8 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
|
||||
[self configureWebCell:cell forAppVersion:appVersion];
|
||||
|
||||
BITWebTableViewCell *cell = [self webCellWithAppVersion:appVersion];
|
||||
[_cells addObject:cell];
|
||||
|
||||
if (breakAfterThisAppVersion) break;
|
||||
@@ -405,6 +404,12 @@
|
||||
[self showHidePreviousVersionsButton];
|
||||
}
|
||||
|
||||
- (BITWebTableViewCell *)webCellWithAppVersion:(BITAppVersionMetaInfo *)appVersion {
|
||||
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
|
||||
[self configureWebCell:cell forAppVersion:appVersion];
|
||||
return cell;
|
||||
}
|
||||
|
||||
- (void)showPreviousVersionAction {
|
||||
_showAllVersions = YES;
|
||||
BOOL showAllPending = NO;
|
||||
@@ -420,10 +425,8 @@
|
||||
continue; // skip already shown
|
||||
}
|
||||
}
|
||||
|
||||
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
|
||||
[self configureWebCell:cell forAppVersion:appVersion];
|
||||
[_cells addObject:cell];
|
||||
|
||||
[_cells addObject:[self webCellWithAppVersion:appVersion]];
|
||||
}
|
||||
[self.tableView reloadData];
|
||||
[self showHidePreviousVersionsButton];
|
||||
|
||||
@@ -155,16 +155,26 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIWebView
|
||||
#pragma mark - UIWebViewDelegate
|
||||
|
||||
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
|
||||
if(navigationType == UIWebViewNavigationTypeOther)
|
||||
return YES;
|
||||
|
||||
return NO;
|
||||
switch (navigationType) {
|
||||
case UIWebViewNavigationTypeLinkClicked:
|
||||
[self openURL:request.URL];
|
||||
return NO;
|
||||
break;
|
||||
case UIWebViewNavigationTypeOther:
|
||||
return YES;
|
||||
break;
|
||||
case UIWebViewNavigationTypeBackForward:
|
||||
case UIWebViewNavigationTypeFormResubmitted:
|
||||
case UIWebViewNavigationTypeFormSubmitted:
|
||||
case UIWebViewNavigationTypeReload:
|
||||
return NO;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (void)webViewDidFinishLoad:(UIWebView *)webView {
|
||||
if(_webViewContent)
|
||||
[self showWebView];
|
||||
@@ -181,6 +191,12 @@ body { font: 13px 'Helvetica Neue', Helvetica; color:#626262; word-wrap:break-wo
|
||||
self.webViewSize = CGSizeMake(fittingSize.width, [output integerValue]);
|
||||
}
|
||||
|
||||
#pragma mark - Helper
|
||||
|
||||
- (void)openURL:(NSURL *)URL {
|
||||
[[UIApplication sharedApplication] openURL:URL];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#endif /* HOCKEYSDK_FEATURE_UPDATES */
|
||||
|
||||
Reference in New Issue
Block a user