mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-06-04 01:49:44 +00:00
merge of '08072a021136a28a193b28ee306b59bc5fb87d73'
and '8d83618a18c319c1db3843f81574c79ee5d52430' Monotone-Parent: 08072a021136a28a193b28ee306b59bc5fb87d73 Monotone-Parent: 8d83618a18c319c1db3843f81574c79ee5d52430 Monotone-Revision: 09c2ef621ffaea633516a58bf226554a1147b8de Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-05-21T15:37:21 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -60,17 +60,20 @@ String.prototype.asDate = function () {
|
||||
|
||||
String.prototype.asCSSIdentifier = function () {
|
||||
var substitutions = { '_': '_U_',
|
||||
'.': '_D_',
|
||||
'\\.': '_D_',
|
||||
'#': '_H_',
|
||||
'@': '_A_',
|
||||
'*': '_S_',
|
||||
'\\*': '_S_',
|
||||
':': '_C_',
|
||||
',': '_CO_',
|
||||
' ': '_SP_' };
|
||||
var newString = this;
|
||||
var re;
|
||||
|
||||
for (var key in substitutions)
|
||||
newString = newString.replace(key, substitutions[key]);
|
||||
for (var key in substitutions) {
|
||||
re = new RegExp(key, 'g');
|
||||
newString = newString.replace(re, substitutions[key]);
|
||||
}
|
||||
|
||||
return newString;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user