-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
46 lines (42 loc) · 1.57 KB
/
Copy pathindex.html
File metadata and controls
46 lines (42 loc) · 1.57 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Audacity Label Track Convert</title>
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css"/>
<script src="wasm_exec.js"></script>
</head>
<body>
<script>
(async function loadAndRunGoWasm() {
const go = new Go();
const response = await fetch("main.wasm");
const buffer = await response.arrayBuffer();
const result = await WebAssembly.instantiate(buffer, go.importObject);
go.run(result.instance)
})()
function doConvert() {
const data = document.getElementById("data").value
if (data !== "") {
const result = window.convert(data)
document.getElementById("output").innerText = result
}
}
function copyToClipboard() {
/* Get the text field */
var output = document.getElementById("output");
/* Copy the text inside the text field */
navigator.clipboard.writeText(output.innerText);
}
</script>
<a class="github-fork-ribbon" target="_blank"
href="https://github.com/linuxsuren/audacity-label-plugin"
data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
<button type="button" onclick="doConvert()">Convert</button><br/>
<textarea id="data" style="margin: 0px;width: 100%;height: 100px;"></textarea>
<button onclick="copyToClipboard()">Copy</button>
<div id="output"></div>
</body>
</html>