mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-09-17 09:10:30 +00:00
Add copy link to Feedback UI
This commit is contained in:
parent
3383f3a657
commit
423bc7ece7
@ -477,6 +477,35 @@
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BITAttributedLabelDelegate
|
||||
|
||||
- (void)attributedLabel:(BITAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
|
||||
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
|
||||
UIActionSheet *linkAction = [[UIActionSheet alloc] initWithTitle:[url absoluteString]
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCancel")
|
||||
destructiveButtonTitle:nil
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionOpen"), BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCopy"), nil
|
||||
];
|
||||
[linkAction setTag:1];
|
||||
[linkAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
|
||||
[linkAction showInView:self.view];
|
||||
[linkAction release];
|
||||
} else {
|
||||
UIAlertView *linkAction = [[UIAlertView alloc] initWithTitle:[url absoluteString]
|
||||
message:nil
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCancel")
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionOpen"), BITHockeyLocalizedString(@"HockeyFeedbackListLinkActionCopy"), nil
|
||||
];
|
||||
|
||||
[linkAction setTag:1];
|
||||
[linkAction show];
|
||||
[linkAction release];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - UIAlertViewDelegate
|
||||
|
||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||
@ -489,7 +518,12 @@
|
||||
[self deleteAllMessages];
|
||||
}
|
||||
} else {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:alertView.title]];
|
||||
if (buttonIndex == [alertView firstOtherButtonIndex]) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:alertView.title]];
|
||||
} else {
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.URL = [NSURL URLWithString:alertView.title];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -506,35 +540,12 @@
|
||||
[self deleteAllMessages];
|
||||
}
|
||||
} else {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:actionSheet.title]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#pragma mark - BITAttributedLabelDelegate
|
||||
|
||||
- (void)attributedLabel:(BITAttributedLabel *)label didSelectLinkWithURL:(NSURL *)url {
|
||||
if (UI_USER_INTERFACE_IDIOM() != UIUserInterfaceIdiomPad) {
|
||||
UIActionSheet *linkAction = [[UIActionSheet alloc] initWithTitle:[url absoluteString]
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListCancelOpenLink")
|
||||
destructiveButtonTitle:nil
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListOpenLinkInSafari"), nil
|
||||
];
|
||||
[linkAction setTag:1];
|
||||
[linkAction setActionSheetStyle:UIActionSheetStyleBlackTranslucent];
|
||||
[linkAction showInView:self.view];
|
||||
[linkAction release];
|
||||
} else {
|
||||
UIAlertView *linkAction = [[UIAlertView alloc] initWithTitle:[url absoluteString]
|
||||
message:nil
|
||||
delegate:self
|
||||
cancelButtonTitle:BITHockeyLocalizedString(@"HockeyFeedbackListCancelOpenLink")
|
||||
otherButtonTitles:BITHockeyLocalizedString(@"HockeyFeedbackListOpenLinkInSafari"), nil];
|
||||
|
||||
[linkAction setTag:1];
|
||||
[linkAction show];
|
||||
[linkAction release];
|
||||
if (buttonIndex == [actionSheet destructiveButtonIndex]) {
|
||||
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:actionSheet.title]];
|
||||
} else {
|
||||
UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
|
||||
pasteboard.URL = [NSURL URLWithString:actionSheet.title];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,13 +177,16 @@
|
||||
"HockeyFeedbackListDeleteAllCancel" = "Cancel";
|
||||
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
/* Open/Copy Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
|
||||
/* UIActivity */
|
||||
|
@ -176,11 +176,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
@ -177,11 +177,15 @@
|
||||
|
||||
/* Open Link In Safari Action Sheet / Alert View */
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListCancelOpenLink" = "Cancel";
|
||||
/* Button Title to cancel */
|
||||
"HockeyFeedbackListLinkActionCancel" = "Cancel";
|
||||
|
||||
/* Button Title to Open the Link */
|
||||
"HockeyFeedbackListLinkActionOpen" = "Open";
|
||||
|
||||
/* Button Title to Copy the Link */
|
||||
"HockeyFeedbackListLinkActionCopy" = "Copy";
|
||||
|
||||
/* Title for the Action Sheet */
|
||||
"HockeyFeedbackListOpenLinkInSafari" = "Open Link in Safari";
|
||||
|
||||
/* UIActivity */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user