1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
// CCTV Control
//
// Author: Florian Raemisch
// Email: olf@subsignal.org
//
// cctv-control is a webinterface to control and view
// mjpeg encoded videos by cctv cameras which are
// proxied by mjpegplexer. camera control is possible
// with arrow-keys, if mjpegplexer is configured
// properly.
//
// This Software is licensed under the GPL Version 3, 29 June 2007
//create event which is triggered when DOM is ready
window.onDomReady = initReady;
//change from testbild to default cam when DOM is ready
window.onDomReady(initViewer);
function initReady(fn) {
if(document.addEventListener) {
document.addEventListener("DOMContentLoaded", fn, false);
}
}
function initViewer() {
//load contents from localStorage
var display = document.getElementById("camImage"),
page = document.getElementById("page"),
formName = localStorage.getItem("formName"),
formDate = localStorage.getItem("formDate"),
formAnalysis1 = localStorage.getItem("formAnalysis1"),
formAnalysis2 = localStorage.getItem("formAnalysis2"),
formAnalysis3 = localStorage.getItem("formAnalysis3"),
stor = localStorage.getItem("snapShot");
//display loaded data
if (stor) {
display.setAttribute("src", stor);
page.innerHTML += '<p>' + formName + '</p>';
page.innerHTML += '<p>' + formDate + '</p>';
page.innerHTML += '<p>' + formAnalysis1 + '</p>';
page.innerHTML += '<p>' + formAnalysis2 + '</p>';
page.innerHTML += '<p>' + formAnalysis3 + '</p>';
}
//commented out for debugging and layouting purposes
print();
//reset localStorage to default values
//localStorage.setItem("formName", "Untersucher");
//localStorage.setItem("formDate", "Datum");
//localStorage.setItem("formAnalysis1", "Dein Bericht 1");
//localStorage.setItem("formAnalysis2", "Dein Bericht 2");
//localStorage.setItem("formAnalysis3", "Dein Bericht 3"):
//commented out for debugging and layouting purposes
window.close();
}
|