From 56458c44514c00f883ff3a7cb113f634219d60c3 Mon Sep 17 00:00:00 2001 From: lukas Date: Fri, 17 Jan 2025 02:36:10 +0100 Subject: [PATCH] fix missing link create datastores on the first page. --- index.html | 15 +++++++++++++++ sample_intake.html | 21 +++++++++------------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/index.html b/index.html index 40cf074..ddffd6e 100644 --- a/index.html +++ b/index.html @@ -11,6 +11,9 @@

first set up your microscope and sample preparation

setup your microscope and camera here
add a sample preparation protocol
+

then you can start taking in samples

+ setup your microscope and camera here
+

then you can start observing

filamentous and protozoa
nematodes
@@ -21,3 +24,15 @@ + diff --git a/sample_intake.html b/sample_intake.html index 3f18d37..94a814a 100644 --- a/sample_intake.html +++ b/sample_intake.html @@ -14,7 +14,7 @@

Add Sample

-
+
- +
@@ -97,14 +97,6 @@ var db; let openRequest = indexedDB.open("my_db"); - openRequest.onupgradeneeded = function() { - db = openRequest.result; - db.createObjectStore("microscope_setup", {autoIncrement : true}); - db.createObjectStore("prep_protocol", {autoIncrement : true}); - db.createObjectStore("sample", {autoIncrement : true}); - - }; - openRequest.onerror = function() { console.error("Error", openRequest.error); }; @@ -113,8 +105,11 @@ db = openRequest.result; // continue working with database using db object }; - function add(e){ - e.preventDefault(); + + const form = document.getElementById("sample"); + form.addEventListener("submit", add); + + function add(event){ let sample = { "Name" : document.getElementById("Name").value, "Type" : document.getElementById("Type").value, @@ -133,6 +128,8 @@ console.log("something went wrong"); // Don't forget to handle errors! }; + event.preventDefault(); + }