-
Notifications
You must be signed in to change notification settings - Fork 0
/
convert.js
54 lines (44 loc) · 1.39 KB
/
convert.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function copyToClipboard(message) {
navigator.clipboard.writeText(message).then(
() => { },
() => {
alert("Couldn't copy text to clipboard!");
}
);
}
function handleCopyToClipboardClick() {
toCopy = document.getElementById('output').innerHTML;
copyToClipboard(toCopy);
}
function handleConvertClick() {
var lines = input.value;
lines = lines.split("\n");
for (var i = 0; i < lines.length; i++) {
var line = lines[i];
line = line.split(" ");
line = line.filter(e => e);
console.log(line);
line = line.join("\t");
console.log(line);
lines[i] = line;
}
lines = lines.join("\n");
output.value = lines;
}
const input = document.getElementById("input");
const output = document.getElementById("output");
const copy_to_clipboard_button = document.getElementById("copy_to_clipboard_button");
//convert.addEventListener('click', handleConvertClick);
copy_to_clipboard_button.addEventListener('click', handleCopyToClipboardClick);
$("#copy_to_clipboard_button").click(function () {
$('#circle').animate(
{ width: "100%"}, 400, function () {
$('#circle').animate(
{ opacity: "0" }, 300, function () {
circle.style.opacity = "100%";
circle.style.width = "0";
}
)
}
)
});