aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRahiel Kasim <rahielkasim@gmail.com>2017-09-13 15:47:27 +0200
committerRahiel Kasim <rahielkasim@gmail.com>2017-09-13 15:47:27 +0200
commitc1b425fede913977ac9b2809674ba643f61c8adb (patch)
treefdc20b0be9b890c0adcc6c85f3bce8120c8549b4
parentd423436736f3e570222a6ec2ba6206e0f228ead1 (diff)
configurable location of the worker script
-rw-r--r--index.html1
-rw-r--r--renderer.ts3
2 files changed, 3 insertions, 1 deletions
diff --git a/index.html b/index.html
index 3f4ab9e..1cd7b80 100644
--- a/index.html
+++ b/index.html
@@ -28,6 +28,7 @@
<br><br>
<div id="model"></div>
+ <span id="workerPath" style="display:none">worker.js</span>
<script src="renderer.js"></script>
</div>
</body>
diff --git a/renderer.ts b/renderer.ts
index 7607964..f675010 100644
--- a/renderer.ts
+++ b/renderer.ts
@@ -5,6 +5,7 @@ let color = require("tinycolor2");
let app;
let worker = new Worker("");
+let workerPath = (<HTMLSpanElement>document.getElementById("workerPath")).textContent;
let button = document.getElementById("start");
button.onclick = start;
@@ -14,7 +15,7 @@ function start() {
app.destroy(true);
}
worker.terminate();
- worker = new Worker("worker.js");
+ worker = new Worker(workerPath);
let config = (<HTMLInputElement>document.getElementById("config")).value;
let latticeSize = parseInt((<HTMLInputElement>document.getElementById("latticeSize")).value);