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

46
dev/External/ko.js vendored
View file

@ -811,7 +811,7 @@
'parseOnBlur': true,
'allowDragAndDrop': true,
'focusCallback': fFocusCallback,
'inputDelimiters': [',', ';'],
'inputDelimiters': [',', ';', '\n'],
'autoCompleteSource': fAutoCompleteSource,
// 'elementHook': function (oEl, oItem) {
// if (oEl && oItem)
@ -821,23 +821,53 @@
// }
// },
'parseHook': function (aInput) {
return _.map(aInput, function (sInputValue) {
var aResult = [];
_.each(aInput, function (sInputValue) {
var
aM = null,
aValues = [],
sValue = Utils.trim(sInputValue),
oEmail = null
;
if ('' !== sValue)
{
oEmail = new EmailModel();
oEmail.mailsoParse(sValue);
return [oEmail.toLine(false), oEmail];
aM = sValue.match(/[@]/g);
if (aM && 0 < aM.length)
{
sValue = sValue.replace(/[\r\n]+/g, '; ').replace(/[\s]+/g, ' ');
aValues = EmailModel.splitHelper(sValue, ';');
_.each(aValues, function (sV) {
oEmail = new EmailModel();
oEmail.mailsoParse(sV);
if (oEmail.email)
{
aResult.push([oEmail.toLine(false), oEmail]);
}
else
{
aResult.push(['', null]);
}
});
}
else
{
aResult.push([sInputValue, null]);
}
}
else
{
aResult.push([sInputValue, null]);
}
return [sValue, null];
});
return aResult;
},
'change': _.bind(function (oEvent) {
$oEl.data('EmailsTagsValue', oEvent.target.value);