mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-02-04 02:15:47 +00:00
no message
This commit is contained in:
@@ -47,6 +47,21 @@ function fixPlayer() {
|
||||
statusOverlay.style.padding = '1.5em 1.5em 5.5em 2.5em';
|
||||
}
|
||||
|
||||
var recommendationOverlay = document.getElementById('js-player-recommendations-overlay');
|
||||
if (recommendationOverlay != null) {
|
||||
recommendationOverlay.style.display = 'none';
|
||||
}
|
||||
|
||||
var adOverlay = document.getElementsByClassName('player-ad-overlay')[0];
|
||||
if (adOverlay != null) {
|
||||
adOverlay.style.display = 'none';
|
||||
}
|
||||
|
||||
var alertOverlay = document.getElementById('js-player-alert-container');
|
||||
if (alertOverlay != null) {
|
||||
alertOverlay.style.display = 'none';
|
||||
}
|
||||
|
||||
var video = document.getElementsByTagName('video')[0];
|
||||
video.setAttribute('webkit-playsinline', '');
|
||||
video.setAttribute('playsinline', '');
|
||||
|
||||
@@ -33,6 +33,8 @@ typedef enum
|
||||
@property (nonatomic, copy) void (^completionBlock)(NSArray *signals);
|
||||
@property (nonatomic, copy) void (^dismissalBlock)(void);
|
||||
|
||||
@property (nonatomic, copy) TGViewController *(^requestSearchController)(void);
|
||||
|
||||
@property (nonatomic, readonly) TGMediaAssetsPickerController *pickerController;
|
||||
|
||||
- (UIBarButtonItem *)rightBarButtonItem;
|
||||
|
||||
@@ -694,14 +694,13 @@
|
||||
|
||||
- (void)searchButtonPressed
|
||||
{
|
||||
__weak TGMediaAssetsController *weakSelf = self;
|
||||
if (false) {
|
||||
|
||||
if (self.requestSearchController) {
|
||||
_searchController = self.requestSearchController();
|
||||
}
|
||||
/*TGWebSearchController *searchController = [[TGWebSearchController alloc] initWithContext:[TGLegacyComponentsContext shared] forAvatarSelection:(_intent == TGMediaAssetsControllerSetProfilePhotoIntent) embedded:true];
|
||||
searchController.captionsEnabled = self.captionsEnabled;
|
||||
searchController.suggestionContext = self.suggestionContext;
|
||||
|
||||
|
||||
__weak TGWebSearchController *weakController = searchController;
|
||||
searchController.avatarCompletionBlock = ^(UIImage *image)
|
||||
{
|
||||
@@ -738,7 +737,7 @@
|
||||
};
|
||||
searchController.parentNavigationController = self;
|
||||
[searchController presentEmbeddedInController:self animated:true];
|
||||
|
||||
|
||||
_searchController = searchController;*/
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
|
||||
@class TGViewController;
|
||||
@class TGMenuSheetController;
|
||||
@class TGMediaAssetsController;
|
||||
|
||||
@interface TGMediaAvatarMenuMixin : NSObject
|
||||
|
||||
@property (nonatomic, copy) void (^didFinishWithImage)(UIImage *image);
|
||||
@property (nonatomic, copy) void (^didFinishWithDelete)(void);
|
||||
@property (nonatomic, copy) void (^didDismiss)(void);
|
||||
@property (nonatomic, copy) TGViewController *(^requestSearchController)(TGMediaAssetsController *);
|
||||
|
||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context parentController:(TGViewController *)parentController hasDeleteButton:(bool)hasDeleteButton saveEditedPhotos:(bool)saveEditedPhotos saveCapturedMedia:(bool)saveCapturedMedia;
|
||||
- (instancetype)initWithContext:(id<LegacyComponentsContext>)context parentController:(TGViewController *)parentController hasDeleteButton:(bool)hasDeleteButton personalPhoto:(bool)personalPhoto saveEditedPhotos:(bool)saveEditedPhotos saveCapturedMedia:(bool)saveCapturedMedia;
|
||||
|
||||
@@ -402,6 +402,15 @@
|
||||
if (strongController != nil && strongController.dismissalBlock != nil)
|
||||
strongController.dismissalBlock();
|
||||
};
|
||||
controller.requestSearchController = ^TGViewController *
|
||||
{
|
||||
__strong TGMediaAvatarMenuMixin *strongSelf = weakSelf;
|
||||
__strong TGMediaAssetsController *strongController = weakController;
|
||||
if (strongSelf == nil)
|
||||
return nil;
|
||||
|
||||
return strongSelf.requestSearchController(strongController);
|
||||
};
|
||||
presentBlock(controller);
|
||||
};
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ typedef enum {
|
||||
{
|
||||
__strong TGPhotoStickersView *strongSelf = weakSelf;
|
||||
if (strongSelf != nil)
|
||||
[strongSelf scrollToSection:index];
|
||||
[strongSelf scrollToSection:index == 1 ? 0 : index - 2];
|
||||
};
|
||||
[_wrapperView addSubview:_tabPanel];
|
||||
|
||||
@@ -404,7 +404,7 @@ typedef enum {
|
||||
|
||||
[_collectionView reloadData];
|
||||
|
||||
[_tabPanel setStickerPacks:_section == TGPhotoStickersViewSectionMasks ? _maskStickerPacks : _genericStickerPacks showRecent:_section == TGPhotoStickersViewSectionMasks ? (_recentStickers.count != 0) : (_recentMasks.count != 0) showFavorite:false showGroup:false showGroupLast:false showGifs:false showTrendingFirst:false showTrendingLast:false];
|
||||
[_tabPanel setStickerPacks:_section == TGPhotoStickersViewSectionMasks ? _maskStickerPacks : _genericStickerPacks showRecent:_section == TGPhotoStickersViewSectionMasks ? (_recentMasks.count != 0) : (_recentStickers.count != 0) showFavorite:false showGroup:false showGroupLast:false showGifs:false showTrendingFirst:false showTrendingLast:false];
|
||||
}
|
||||
|
||||
- (void)updateRecentDocuments
|
||||
|
||||
@@ -399,16 +399,35 @@
|
||||
|
||||
- (void)setCurrentStickerPackIndex:(NSUInteger)currentStickerPackIndex animated:(bool)animated
|
||||
{
|
||||
NSInteger section = currentStickerPackIndex + 1;
|
||||
NSInteger section = 0;
|
||||
NSInteger row = 0;
|
||||
|
||||
if (section >= 4)
|
||||
if (_style != TGStickerKeyboardViewPaintStyle && _style != TGStickerKeyboardViewPaintDarkStyle)
|
||||
{
|
||||
section = 4;
|
||||
row = currentStickerPackIndex - 4;
|
||||
section = currentStickerPackIndex + 1;
|
||||
|
||||
if (!_showGroup)
|
||||
row++;
|
||||
if (section >= 4 + _stickerPacks.count)
|
||||
{
|
||||
section = 5 + currentStickerPackIndex - _stickerPacks.count - 3;
|
||||
}
|
||||
else if (section >= 4)
|
||||
{
|
||||
section = 4;
|
||||
row = currentStickerPackIndex - 3;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (currentStickerPackIndex == 0)
|
||||
{
|
||||
section = 2;
|
||||
row = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
section = 4;
|
||||
row = currentStickerPackIndex - 1;
|
||||
}
|
||||
}
|
||||
|
||||
NSArray *selectedItems = [_collectionView indexPathsForSelectedItems];
|
||||
@@ -459,7 +478,11 @@
|
||||
- (void)scrollToTrendingButton {
|
||||
NSIndexPath *indexPath = [NSIndexPath indexPathForItem:_showGifs ? 1 : 0 inSection:0];
|
||||
if (_showTrendingLast) {
|
||||
indexPath = [NSIndexPath indexPathForItem:0 inSection:5];
|
||||
NSInteger item = 0;
|
||||
if ([self collectionView:_collectionView numberOfItemsInSection:5] > 2)
|
||||
item = 1;
|
||||
|
||||
indexPath = [NSIndexPath indexPathForItem:item inSection:5];
|
||||
}
|
||||
if (indexPath.section < [self numberOfSectionsInCollectionView:_collectionView] && indexPath.item < [self collectionView:_collectionView numberOfItemsInSection:indexPath.section]) {
|
||||
UICollectionViewLayoutAttributes *attributes = [_collectionLayout layoutAttributesForItemAtIndexPath:indexPath];
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
@property (nonatomic, strong) UIColor *placeholderColor;
|
||||
@property (nonatomic, strong) UIFont *placeholderFont;
|
||||
@property (nonatomic) CGFloat placeholderOffset;
|
||||
|
||||
@property (nonatomic) CGFloat leftInset;
|
||||
@property (nonatomic) CGFloat rightInset;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
else if (self.textAlignment == NSTextAlignmentRight)
|
||||
placeholderOrigin.x = rect.size.width - placeholderSize.width;
|
||||
|
||||
placeholderOrigin.y += TGRetinaPixel;
|
||||
placeholderOrigin.y += TGScreenPixel + _placeholderOffset;
|
||||
|
||||
[self.placeholder drawAtPoint:placeholderOrigin withFont:_placeholderFont];
|
||||
}
|
||||
@@ -38,7 +38,7 @@
|
||||
|
||||
- (CGRect)editingRectForBounds:(CGRect)bounds
|
||||
{
|
||||
return CGRectOffset([self textRectForBounds:bounds], 0.0f, TGRetinaPixel + _editingRectOffset);
|
||||
return CGRectOffset([self textRectForBounds:bounds], 0.0f, TGScreenPixel + _editingRectOffset);
|
||||
}
|
||||
|
||||
- (CGRect)placeholderRectForBounds:(CGRect)bounds
|
||||
|
||||
Reference in New Issue
Block a user