- (NSString *)prettyUid;
- (NSString *)userUid;
-
+- (NSString *)_colorizedUid:(NSString *)_uid;
- (NSString *)showHref;
- (NSString *)jsCode;
}
- (NSString *)prettyUid {
if([self->calendarUIDs objectAtIndex:0] == self->uid)
- return self->uid;
- return [NSString stringWithFormat:@", %@", self->uid];
+ return [self _colorizedUid:self->uid];
+ return [NSString stringWithFormat:@", %@", [self _colorizedUid:self->uid]];
}
+- (NSString *)_colorizedUid:(NSString *)_uid {
+ if([_uid isEqualToString:[self userUid]]) {
+ _uid = [NSString stringWithFormat:@"<span class=\""
+ @"anais_me\">%@</span>",
+ _uid];
+ }
+ return _uid;
+}
/* Href */
@" var dst = o.parentNode;\n"
@" var n = document.createElement('td');\n"
@" n.setAttribute('id', elemId);\n"
+ @" n.setAttribute('align', 'left');\n"
+ @" n.setAttribute('class', 'anais_uids');\n"
@" dst.replaceChild(n, o);\n"
@"}\n"
@"function clearUidList() {\n"
@" s = uid;\n"
@" e.setAttribute('value', s);\n"
@" var td = document.getElementById('anaisUIDList');\n"
- @" if(td.hasChildNodes())\n"
- @" uid = ', ' + uid;\n"
- @" var text = document.createTextNode(uid);\n"
- @" td.appendChild(text);\n"
+ @" var text;\n"
+ @" if(td.hasChildNodes()) {\n"
+ @" text = document.createTextNode(', ');\n"
+ @" td.appendChild(text);\n"
+ @" }\n"
+ @" text = document.createTextNode(uid);\n"
+ @" if(uid == '%@') {\n"
+ @" var span = document.createElement('span');\n"
+ @" span.setAttribute('class', 'anais_me');\n"
+ @" span.appendChild(text);\n"
+ @" td.appendChild(span);\n"
+ @" }\n"
+ @" else {\n"
+ @" td.appendChild(text);\n"
+ @" }\n"
@" td = document.getElementById('clearUidList');\n"
@" td.setAttribute('style', 'visibility:visible');\n"
@" td = document.getElementById('showUidList');\n"
@"";
return [NSString stringWithFormat:script,
- [self userUid]];
+ [self userUid], [self userUid]];
}
@end