This commit is contained in:
dayanch96
2024-02-20 15:52:36 +03:00
parent 3e67c85de9
commit 74baf844be
7 changed files with 36 additions and 24 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ endif
DEBUG=0 DEBUG=0
FINALPACKAGE=1 FINALPACKAGE=1
ARCHS = arm64 ARCHS = arm64
PACKAGE_VERSION = 2.6 PACKAGE_VERSION = 2.6.1
TARGET := iphone:clang:latest:13.0 TARGET := iphone:clang:latest:13.0
include $(THEOS)/makefiles/common.mk include $(THEOS)/makefiles/common.mk
+1
View File
@@ -290,6 +290,7 @@ int kPivotIndex;
@interface ASDisplayNode : NSObject @interface ASDisplayNode : NSObject
@property (atomic, assign, readonly) ASNodeAncestryEnumerator *supernodes; @property (atomic, assign, readonly) ASNodeAncestryEnumerator *supernodes;
@property (atomic, copy, readwrite) NSArray *yogaChildren;
@end @end
@interface ELMContainerNode : ASDisplayNode @interface ELMContainerNode : ASDisplayNode
+29 -18
View File
@@ -641,6 +641,26 @@ static BOOL isOverlayShown = YES;
%property (nonatomic, strong) NSString *copiedComment; %property (nonatomic, strong) NSString *copiedComment;
%end %end
%hook ASDisplayNode
- (void)didLoad {
%orig;
ASTextNode *textNode = (ASTextNode *)self;
if (kCopyCommentText && [[self valueForKey:@"_accessibilityIdentifier"] isEqualToString:@"id.comment.content.label"]) {
NSString *comment = textNode.attributedText.string;
NSMutableArray *allObjects = self.supernodes.allObjects;
for (ELMContainerNode *containerNode in allObjects) {
if ([containerNode.description containsString:@"id.ui.comment_cell"] && comment) {
containerNode.copiedComment = comment;
break;
}
}
}
}
%end
%hook _ASDisplayView %hook _ASDisplayView
- (void)setKeepalive_node:(id)arg1 { - (void)setKeepalive_node:(id)arg1 {
%orig; %orig;
@@ -662,19 +682,6 @@ static BOOL isOverlayShown = YES;
break; break;
} }
} }
if ([[self description] containsString:@"id.comment.content.label"]) {
ASTextNode *textNode = (ASTextNode *)self.keepalive_node;
ASDisplayNode *displayNode = (ASDisplayNode *)self.keepalive_node;
NSMutableArray *allObjects = displayNode.supernodes.allObjects;
for (ELMContainerNode *containerNode in allObjects) {
if ([containerNode.description containsString:@"id.ui.comment_cell"]) {
containerNode.copiedComment = textNode.attributedText.string;
break;
}
}
}
} }
%new %new
@@ -764,13 +771,17 @@ static BOOL isOverlayShown = YES;
- (void)copyComment:(UILongPressGestureRecognizer *)sender { - (void)copyComment:(UILongPressGestureRecognizer *)sender {
if (sender.state == UIGestureRecognizerStateBegan) { if (sender.state == UIGestureRecognizerStateBegan) {
ELMContainerNode *containerNode = (ELMContainerNode *)self.keepalive_node; ELMContainerNode *containerNode = (ELMContainerNode *)self.keepalive_node;
[UIPasteboard generalPasteboard].string = containerNode.copiedComment; NSString *comment = containerNode.copiedComment;
if (comment) {
[UIPasteboard generalPasteboard].string = comment;
UIResponder *responder = self.nextResponder; UIResponder *responder = self.nextResponder;
while (responder && ![responder isKindOfClass:[UIViewController class]]) responder = responder.nextResponder; while (responder && ![responder isKindOfClass:[UIViewController class]]) responder = responder.nextResponder;
if (responder) [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Copied") firstResponder:responder] send]; if (responder) [[%c(YTToastResponderEvent) eventWithMessage:LOC(@"Copied") firstResponder:responder] send];
} }
} }
}
%end %end
// Remove Tabs // Remove Tabs
@@ -901,7 +912,7 @@ BOOL isTabSelected = NO;
- (void)layoutSubviews { - (void)layoutSubviews {
%orig; %orig;
if ([self.panelIdentifier.identifierString isEqualToString:@"video-description-ep-identifier"]) { if (kCopyVideoInfo && [self.panelIdentifier.identifierString isEqualToString:@"video-description-ep-identifier"]) {
YTQTMButton *copyInfoButton = [%c(YTQTMButton) iconButton]; YTQTMButton *copyInfoButton = [%c(YTQTMButton) iconButton];
copyInfoButton.accessibilityLabel = LOC(@"CopyVideoInfo"); copyInfoButton.accessibilityLabel = LOC(@"CopyVideoInfo");
[copyInfoButton setTag:999]; [copyInfoButton setTag:999];
@@ -911,12 +922,12 @@ BOOL isTabSelected = NO;
[copyInfoButton setTranslatesAutoresizingMaskIntoConstraints:false]; [copyInfoButton setTranslatesAutoresizingMaskIntoConstraints:false];
[copyInfoButton addTarget:self action:@selector(didTapCopyInfoButton:) forControlEvents:UIControlEventTouchUpInside]; [copyInfoButton addTarget:self action:@selector(didTapCopyInfoButton:) forControlEvents:UIControlEventTouchUpInside];
if (kCopyVideoInfo && self.headerView && self.headerView.closeButton && ![self.headerView viewWithTag:999]) { if (self.headerView && ![self.headerView viewWithTag:999]) {
[self.headerView addSubview:copyInfoButton]; [self.headerView addSubview:copyInfoButton];
[NSLayoutConstraint activateConstraints:@[ [NSLayoutConstraint activateConstraints:@[
[copyInfoButton.trailingAnchor constraintEqualToAnchor:self.headerView.closeButton.leadingAnchor], [copyInfoButton.trailingAnchor constraintEqualToAnchor:self.headerView.trailingAnchor constant:-48],
[copyInfoButton.centerYAnchor constraintEqualToAnchor:self.headerView.closeButton.centerYAnchor], [copyInfoButton.centerYAnchor constraintEqualToAnchor:self.headerView.centerYAnchor],
[copyInfoButton.widthAnchor constraintEqualToConstant:40.0], [copyInfoButton.widthAnchor constraintEqualToConstant:40.0],
[copyInfoButton.heightAnchor constraintEqualToConstant:40.0], [copyInfoButton.heightAnchor constraintEqualToConstant:40.0],
]]; ]];
@@ -192,7 +192,7 @@
"French" = "Localisation française"; "French" = "Localisation française";
"Spanish" = "Localisation espagnole"; "Spanish" = "Localisation espagnole";
"Japanese" = "Localisation japonaise"; "Japanese" = "Localisation japonaise";
"Vietnamese" = "Vietnamese localization"; "Vietnamese" = "Localisation vietnamienne";
"Advanced" = "Mode avancé"; "Advanced" = "Mode avancé";
"AdvancedModeReminder" = "Voulez-vous activer le mode avancé pour YTLite ?\n\nCe mode offre plus de 50 options supplémentaires pour personnaliser et optimiser votre expérience YouTube. Vous pouvez l'activer/désactiver ultérieurement depuis Paramètres → %@ → %@ → %@."; "AdvancedModeReminder" = "Voulez-vous activer le mode avancé pour YTLite ?\n\nCe mode offre plus de 50 options supplémentaires pour personnaliser et optimiser votre expérience YouTube. Vous pouvez l'activer/désactiver ultérieurement depuis Paramètres → %@ → %@ → %@.";
"ClearCache" = "Effacer le cache"; "ClearCache" = "Effacer le cache";
@@ -192,7 +192,7 @@
"French" = "Французская локализация"; "French" = "Французская локализация";
"Spanish" = "Испанская локализация"; "Spanish" = "Испанская локализация";
"Japanese" = "Японская локализация"; "Japanese" = "Японская локализация";
"Vietnamese" = "Vietnamese localization"; "Vietnamese" = "Вьетнамская локализация";
"Advanced" = "Расширенный режим"; "Advanced" = "Расширенный режим";
"AdvancedModeReminder" = "Хотите ли вы активировать расширенный режим настроек YTLite?\n\nДанный режим добавляет более 50 опций для тонкой настройки YouTube. Вы всегда сможете включить/отключить расширенный режим перейдя в Настройки → %@ → %@ → %@."; "AdvancedModeReminder" = "Хотите ли вы активировать расширенный режим настроек YTLite?\n\nДанный режим добавляет более 50 опций для тонкой настройки YouTube. Вы всегда сможете включить/отключить расширенный режим перейдя в Настройки → %@ → %@ → %@.";
"ClearCache" = "Очистить кеш"; "ClearCache" = "Очистить кеш";
Binary file not shown.
Binary file not shown.