summaryrefslogtreecommitdiff
path: root/web/static/dartboat.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/static/dartboat.js')
-rw-r--r--web/static/dartboat.js16
1 files changed, 14 insertions, 2 deletions
diff --git a/web/static/dartboat.js b/web/static/dartboat.js
index 87c6020..07c8997 100644
--- a/web/static/dartboat.js
+++ b/web/static/dartboat.js
@@ -198,7 +198,8 @@ function drawVisit(visit_no, p1_pts, p1_rem, p2_pts, p2_rem, p2_darts) {
e.scrollTop = e.scrollHeight;
}
-function setDelay(val) {
+function setDelay(val, update_opts = true) {
+ if (update_opts) localStorage.setItem('dartboat_delay', val);
Module.ccall('set_delay', null, ['number'], [val]);
}
@@ -206,7 +207,8 @@ function updateDelay(val) {
document.getElementById('delay').value = val;
}
-function setStdev(val) {
+function setStdev(val, update_opts = true) {
+ if (update_opts) localStorage.setItem('dartboat_stdev', val);
Module.ccall('set_stdev', null, ['number', 'number'], [val, val]);
}
@@ -214,6 +216,16 @@ function updateStdev(val) {
document.getElementById('stdev').value = val;
}
+function read_opts() {
+ let val;
+
+ if ((val = localStorage.getItem('dartboat_delay')))
+ setDelay(val, false);
+
+ if ((val = localStorage.getItem('dartboat_stdev')))
+ setStdev(val, false);
+}
+
function modal(id) {
document.getElementById(id).style.display = 'block';
}