Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
validator.genesys-pgr.org
Commits
62669fb0
Commit
62669fb0
authored
Apr 19, 2018
by
Matija Obreza
Browse files
Don't autodetect CSV settings on paste event
parent
53291234
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/main/webapp/WEB-INF/jsp/index.jsp
View file @
62669fb0
...
...
@@ -376,7 +376,7 @@
console
.
log
(
'
Not enough data for auto-detection len=
'
,
area
.
value
.
length
);
return
;
}
var
lines
=
area
.
value
.
replace
(
/
\r\n
/g
,
"
\n
"
).
split
(
"
\n
"
);
var
lines
=
area
.
value
.
substr
(
0
,
5000
).
replace
(
/
\r\n
/g
,
"
\n
"
).
split
(
"
\n
"
);
var
separator
=
CSVAutodetector
.
detectSeparator
(
lines
);
var
quote
=
CSVAutodetector
.
detectQuoteChar
(
lines
,
separator
);
var
escape
=
CSVAutodetector
.
detectEscapeChar
(
lines
,
separator
,
quote
);
...
...
@@ -385,7 +385,8 @@
CSVAutodetector
.
autoSelectOptions
(
separator
,
quote
,
escape
,
decimalMark
);
};
document
.
getElementById
(
"
autodetectCsv
"
).
addEventListener
(
"
click
"
,
autodetectSettings
);
document
.
getElementById
(
"
csvText
"
).
addEventListener
(
"
paste
"
,
function
(
e
)
{
setTimeout
(
autodetectSettings
,
10
);
});
// Do NOT autodetect CSV on paste!
// document.getElementById("csvText").addEventListener("paste", function(e) { setTimeout(autodetectSettings, 10); });
});
</script>
</body>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment