mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-06 17:05:10 +00:00
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:
@@ -46,6 +46,9 @@
|
||||
|
||||
- (NSString *) jsonRepresentation;
|
||||
|
||||
- (NSString *) asCSSIdentifier;
|
||||
|
||||
|
||||
/* bare email addresses */
|
||||
- (NSString *) pureEMailAddress;
|
||||
|
||||
|
||||
@@ -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 = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user