Monotone-Parent: 584371c66b4989feaab5012db26f19d8ed7cd7ad

Monotone-Revision: 72a4f60ec4a14476e485da2ce400df860572fa48

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2010-01-05T22:34:35
Monotone-Branch: ca.inverse.sogo
This commit is contained in:
Wolfgang Sourdeau
2010-01-05 22:34:35 +00:00
parent 7c3b61134a
commit aa7e1d2f5a
15 changed files with 987 additions and 241 deletions
@@ -59,21 +59,14 @@ String.prototype.asDate = function () {
return newDate;
};
String.prototype.asCSSIdentifier = function () {
var substitutions = { '_': '_U_',
'\\.': '_D_',
'#': '_H_',
'@': '_A_',
'\\*': '_S_',
':': '_C_',
',': '_CO_',
' ': '_SP_' };
var newString = this;
var re;
String.prototype.asCSSIdentifier = function() {
var characters = [ '_' , '\\.', '#' , '@' , '\\*', ':' , ',' , ' ' ];
var escapeds = [ '_U_', '_D_', '_H_', '_A_', '_S_', '_C_', '_CO_', '_SP_' ];
for (var key in substitutions) {
re = new RegExp(key, 'g');
newString = newString.replace(re, substitutions[key]);
var newString = this;
for (var i = 0; i < characters.length; i++) {
var re = new RegExp(characters[i], 'g');
newString = newString.replace(re, escapeds[i]);
}
return newString;