Skip to content

Commit 69ddaf9

Browse files
Simone ManganelliSimone Manganelli
Simone Manganelli
authored and
Simone Manganelli
committed
restricted tooltips to 200 characters: 150 from the start of the URL, 50 from the end
1 parent f1d8c95 commit 69ddaf9

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Plugin/Plugin.m

+11-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,17 @@ - (id) initWithArguments:(NSDictionary *)arguments
169169

170170
// set tooltip
171171

172-
if ([self src]) [self setToolTip:[self src]];
172+
if ([self src]) {
173+
int srcLength = [[self src] length];
174+
if ([[self src] length] > 200) {
175+
NSString *srcStart = [[self src] substringToIndex:150];
176+
NSString *srcEnd = [[self src] substringFromIndex:(srcLength-50)];
177+
NSString *shortenedSrc = [NSString stringWithFormat:@"%@%@",srcStart,srcEnd];
178+
[self setToolTip:shortenedSrc];
179+
} else {
180+
[self setToolTip:[self src]];
181+
}
182+
}
173183

174184

175185
// Read in flashvars (needed to determine YouTube videos)

0 commit comments

Comments
 (0)