diff options
author | Florian <stayawake@lavabit.com> | 2014-02-16 03:13:55 +0100 |
---|---|---|
committer | Florian <stayawake@lavabit.com> | 2014-02-16 03:13:55 +0100 |
commit | dd2f70706cbf73715ec87765ef740047f65360f4 (patch) | |
tree | 941ed9f5d6f3aa739d9c7aca00b235d26bed10bf | |
parent | 2d6dde82eb2a5cee8e9676b42d53815dc7fa0be8 (diff) |
date is displayed in form and readonly
-rw-r--r-- | cam.html | 2 | ||||
-rw-r--r-- | js/cctv-control.js | 18 |
2 files changed, 19 insertions, 1 deletions
@@ -16,7 +16,7 @@ <p>Personalkennzeichnung</p> <input id="formName"><br> <p>Zeitpunkt</p> - <input id="formDate"><br> + <input id="formDate" readonly><br> <p>Analyse der Aufnahme</p> <textarea id="formAnalysis1"></textarea> <p>Bemerkungen zum Untersuchungsverlauf</p> diff --git a/js/cctv-control.js b/js/cctv-control.js index b4e6fa7..4732b30 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -131,12 +131,30 @@ function showForm() { display2 = document.getElementById("formImage"), stor = localStorage.getItem("snapShot"); + var d = new Date(); + + var date = d.getDay(); + date += '/'; + date += d.getMonth(); + date += '/'; + date += d.getFullYear(); + + var time = d.getHours(); + time += ':'; + time += d.getMinutes(); + time += ':'; + time += d.getSeconds(); + time += ' Uhr'; + //display loaded image if (stor) { display1.setAttribute("src", stor); display2.setAttribute("src", stor); } + //insert date in date-field + document.getElementById("formDate").value = date + ' ' + time; + //make form visible document.getElementById("form").style.visibility = 'visible'; formActive = 1; |