From c7c87eccc2d7deb05826ead8d15f4ddbb5ce4908 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 7 Feb 2014 18:18:50 +0100 Subject: added localstorage test file --- cam.html | 2 +- js/load-local-storage.js | 38 ++++++++++++++++++++++++++++++++++++++ test.html | 12 ++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 js/load-local-storage.js create mode 100644 test.html diff --git a/cam.html b/cam.html index 60aed46..507835f 100644 --- a/cam.html +++ b/cam.html @@ -7,7 +7,7 @@
- +
diff --git a/js/load-local-storage.js b/js/load-local-storage.js new file mode 100644 index 0000000..b3c26e8 --- /dev/null +++ b/js/load-local-storage.js @@ -0,0 +1,38 @@ +// 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 + + +window.onDomReady = initReady; + + +window.onDomReady(loadImg); + + +function initReady(fn) { + if(document.addEventListener) { + document.addEventListener("DOMContentLoaded", fn, false); + } +} + + +function loadImg() { + + var display = document.getElementById("storImage"), + stor = localStorage.getItem("snapShot") + + if (stor) { + display.setAttribute("src", stor); + } + + +} diff --git a/test.html b/test.html new file mode 100644 index 0000000..0e19695 --- /dev/null +++ b/test.html @@ -0,0 +1,12 @@ + + + + + + + +
+ +
+ + -- cgit v1.2.1