Monotone-Parent: 62e39c3bdb32b49561def293946775b53c6ec7a8

Monotone-Revision: 0ead0c25d50f50af2ffad8629b1df6a8f33aabb2

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2009-01-16T15:33:07
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2009-01-16 15:33:07 +00:00
parent d2f68c3b48
commit 6d75e5a02b
3 changed files with 35 additions and 0 deletions
+3
View File
@@ -46,6 +46,9 @@
- (NSString *) jsonRepresentation;
- (NSString *) asCSSIdentifier;
/* bare email addresses */
- (NSString *) pureEMailAddress;
+16
View File
@@ -305,6 +305,22 @@ static NSMutableCharacterSet *urlStartChars = nil;
return [self doubleQuotedString];
}
- (NSString *) asCSSIdentifier
{
NSMutableString *cssIdentifier;
cssIdentifier = [NSMutableString stringWithString: self];
[cssIdentifier replaceString: @"." withString: @"_D_"];
[cssIdentifier replaceString: @"#" withString: @"_H_"];
[cssIdentifier replaceString: @"@" withString: @"_A_"];
[cssIdentifier replaceString: @"*" withString: @"_S_"];
[cssIdentifier replaceString: @":" withString: @"_C_"];
[cssIdentifier replaceString: @"," withString: @"_CO_"];
[cssIdentifier replaceString: @" " withString: @"_SP_"];
return cssIdentifier;
}
- (NSString *) pureEMailAddress
{
NSString *pureAddress;
@@ -58,6 +58,22 @@ String.prototype.asDate = function () {
return newDate;
};
String.prototype.asCSSIdentifier = function () {
var substitutions = { '.': '_D_',
'#': '_H_',
'@': '_A_',
'*': '_S_',
':': '_C_',
',': '_CO_',
' ': '_SP_' };
var newString = this;
for (var key in substitutions)
newString = newString.replace(key, substitutions[key]);
return newString;
}
Date.prototype.sogoDayName = function() {
var dayName = "";