Permalink
Browse files

restricted tooltips to 200 characters: 150 from the start of the URL,…

… 50 from the end
  • Loading branch information...
1 parent f1d8c95 commit 69ddaf9b5ba93516e0e388b3bf2d52166b957ce2 Simone Manganelli committed Jul 25, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 Plugin/Plugin.m
View
@@ -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)

0 comments on commit 69ddaf9

Please sign in to comment.