mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
A lot small fixes
This commit is contained in:
parent
4457cdbc23
commit
09334159c2
38 changed files with 1496 additions and 239 deletions
|
|
@ -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}
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue