ES5 block-scoped-var
This commit is contained in:
@@ -366,13 +366,13 @@ define(
|
|||||||
// done once and then email regex is run just on that element for each row
|
// done once and then email regex is run just on that element for each row
|
||||||
if (emailColumnPosition === null) {
|
if (emailColumnPosition === null) {
|
||||||
for (var column in rowData) {
|
for (var column in rowData) {
|
||||||
var email = detectAndCleanupEmail(rowData[column]);
|
var emailAddress = detectAndCleanupEmail(rowData[column]);
|
||||||
if (emailColumnPosition === null
|
if (emailColumnPosition === null
|
||||||
&& window.emailRegex.test(email)) {
|
&& window.emailRegex.test(emailAddress)) {
|
||||||
emailColumnPosition = column;
|
emailColumnPosition = column;
|
||||||
parsedEmails[email] = true; // add current e-mail to an object index
|
parsedEmails[emailAddress] = true; // add current e-mail to an object index
|
||||||
rowData[column] = email;
|
rowData[column] = emailAddress;
|
||||||
processedSubscribers[email] = rowData;
|
processedSubscribers[emailAddress] = rowData;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (emailColumnPosition === null
|
if (emailColumnPosition === null
|
||||||
@@ -882,6 +882,7 @@ define(
|
|||||||
];
|
];
|
||||||
var firstRowData = subscribersClone.subscribers[0][matchedColumn.index];
|
var firstRowData = subscribersClone.subscribers[0][matchedColumn.index];
|
||||||
var validationRule = false;
|
var validationRule = false;
|
||||||
|
var testedFormat;
|
||||||
// check if date exists
|
// check if date exists
|
||||||
if (firstRowData.trim() === '') {
|
if (firstRowData.trim() === '') {
|
||||||
subscribersClone.subscribers[0][matchedColumn.index] =
|
subscribersClone.subscribers[0][matchedColumn.index] =
|
||||||
@@ -893,9 +894,9 @@ define(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (var format in allowedDateFormats) {
|
for (var format in allowedDateFormats) {
|
||||||
var testedFormat = allowedDateFormats[format];
|
testedFormat = allowedDateFormats[format];
|
||||||
if (Moment(firstRowData, testedFormat, true).isValid()) {
|
if (Moment(firstRowData, testedFormat, true).isValid()) {
|
||||||
var validationRule = (typeof (testedFormat) === 'function') ?
|
validationRule = (typeof(testedFormat) === 'function') ?
|
||||||
'datetime' :
|
'datetime' :
|
||||||
testedFormat;
|
testedFormat;
|
||||||
// set validation on the column element
|
// set validation on the column element
|
||||||
|
Reference in New Issue
Block a user