Skip to content

Commit

Permalink
restricted tooltips to 200 characters: 150 from the start of the URL,…
Browse files Browse the repository at this point in the history
… 50 from the end
  • Loading branch information
Simone Manganelli authored and Simone Manganelli committed Jul 25, 2009
1 parent f1d8c95 commit 69ddaf9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Plugin/Plugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,17 @@ - (id) initWithArguments:(NSDictionary *)arguments

// set tooltip

if ([self src]) [self setToolTip:[self src]];
if ([self src]) {
int srcLength = [[self src] length];
if ([[self src] length] > 200) {
NSString *srcStart = [[self src] substringToIndex:150];
NSString *srcEnd = [[self src] substringFromIndex:(srcLength-50)];
NSString *shortenedSrc = [NSString stringWithFormat:@"%@%@",srcStart,srcEnd];
[self setToolTip:shortenedSrc];
} else {
[self setToolTip:[self src]];
}
}


// Read in flashvars (needed to determine YouTube videos)
Expand Down

0 comments on commit 69ddaf9

Please sign in to comment.