A lot small fixes

This commit is contained in:
RainLoop Team 2015-06-04 22:02:31 +04:00
parent 4457cdbc23
commit 09334159c2
38 changed files with 1496 additions and 239 deletions

View file

@ -36,6 +36,49 @@
return oEmailModel.initByJson(oJsonEmail) ? oEmailModel : null;
};
/**
* @static
* @param {string} sLine
* @param {string=} sDelimiter = ';'
* @return {Array}
*/
EmailModel.splitHelper = function (sLine, sDelimiter)
{
sDelimiter = sDelimiter || ';';
sLine = sLine.replace(/[\r\n]+/g, '; ').replace(/[\s]+/g, ' ');
var
iIndex = 0,
iLen = sLine.length,
bAt = false,
sChar = '',
sResult = ''
;
for (; iIndex < iLen; iIndex++)
{
sChar = sLine.charAt(iIndex);
switch (sChar)
{
case '@':
bAt = true;
break;
case ' ':
if (bAt)
{
bAt = false;
sResult += sDelimiter;
}
break;
}
sResult += sChar;
}
return sResult.split(sDelimiter);
};
/**
* @type {string}
*/