Revert merge from inverse

https://github.com/Zentyal/sogo/pull/150

Because the login on web with the use of outlook is broken after
including the DomainLessLogin feature
This commit is contained in:
Jesús García Sáez
2015-07-28 12:37:33 +02:00
parent 72cbd9a45f
commit 3dc8cc78ea
41 changed files with 284 additions and 767 deletions

View File

@@ -73,10 +73,6 @@ String.prototype.decodeEntities = function() {
});
};
String.prototype.unescapeHTMLEntities = function() {
return this.unescapeHTML().replace(/"/g,'"');
};
String.prototype.asDate = function () {
var newDate;
var date = this.split("/");
@@ -98,39 +94,20 @@ String.prototype.asDate = function () {
return newDate;
};
RegExp.escape = function(text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
}
var css_invalid_characters = [ '_' , '.', '#' , '@' , '*', ':' , ';' , ',' , ' ',
'(', ')', '[', ']', '{', '}',
"'", '"', '&', '+' ];
var css_escape_characters = [ '_U_', '_D_', '_H_', '_A_', '_S_', '_C_', '_SC_', '_CO_', '_SP_',
'_LP_', '_RP_', '_LS_', '_RQ_', '_LC_', '_RC_',
'_SQ_', '_DQ_', '_AM_', '_P_' ];
String.prototype.asCSSIdentifier = function() {
var characters = [ '_' , '\\.', '#' , '@' , '\\*', ':' , ',' , ' '
, "'", '&', '\\+' ];
var escapeds = [ '_U_', '_D_', '_H_', '_A_', '_S_', '_C_', '_CO_',
'_SP_', '_SQ_', '_AM_', '_P_' ];
var newString = this;
for (var i = 0; i < css_invalid_characters.length; i++) {
var re = new RegExp(RegExp.escape(css_invalid_characters[i]), 'g');
newString = newString.replace(re, css_escape_characters[i]);
for (var i = 0; i < characters.length; i++) {
var re = new RegExp(characters[i], 'g');
newString = newString.replace(re, escapeds[i]);
}
if (/^\d/.test(newString))
if (/^\d+/.test(newString)) {
newString = '_' + newString;
return newString;
};
String.prototype.fromCSSIdentifier = function() {
var newString = this;
if (/^_\d/.test(newString))
newString = newString.substring(1);
for (var i = 0; i < css_escape_characters.length; i++) {
var re = new RegExp(css_escape_characters[i], 'g');
newString = newString.replace(re, css_invalid_characters[i]);
}
return newString;