Browse Source

Allow strand to be inputted

pull/1/head
Ravi Shah 5 years ago
parent
commit
21d62ea4da
  1. 12
      www/app.html
  2. 8
      www/app.js
  3. 2
      www/bootstrap.js
  4. 5
      www/index.html
  5. 3
      www/index.js

12
www/app.html

@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>DNA Transcription &amp; Translation</title>
</head>
<body>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
<script src="./bootstrap.js"></script>
<h1>Hello</h1>
</body>
</html>

8
www/app.js

@ -0,0 +1,8 @@
import * as wasm from "wasm-dna-transcription-translation";
const urlParams = new URLSearchParams(window.location.search);
const strand = urlParams.get('strand');
console.log(strand)
wasm.main();

2
www/bootstrap.js

@ -3,3 +3,5 @@
// that no one else needs to worry about it again.
import("./index.js")
.catch(e => console.error("Error importing `index.js`:", e));
import("./app.js")
.catch(e => console.error("Error importing `app.js`:", e));

5
www/index.html

@ -7,5 +7,10 @@
<body>
<noscript>This page contains webassembly and javascript content, please enable javascript in your browser.</noscript>
<script src="./bootstrap.js"></script>
<h1>Please enter the DNA strand in the space below:</h1>
<form class="dna-input" action="app.html" method="get">
<input type="text" name="strand">
<input type="submit" value="Submit">
</form>
</body>
</html>

3
www/index.js

@ -1,3 +0,0 @@
import * as wasm from "wasm-dna-transcription-translation";
wasm.main();
Loading…
Cancel
Save