added localstorage test file

This commit is contained in:
Florian 2014-02-07 18:18:50 +01:00
parent e75c7a5cb2
commit c7c87eccc2
3 changed files with 51 additions and 1 deletions

View File

@ -7,7 +7,7 @@
</head>
<body onkeydown="keyDown(event)">
<div id="screen">
<img src="img/testbild.gif" class="fullscreen">
<img src="img/testbild.gif" id="camImage">
</div>
</body>
</html>

38
js/load-local-storage.js Normal file
View File

@ -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);
}
}

12
test.html Normal file
View File

@ -0,0 +1,12 @@
<!DOCTYPE HTML>
<html lang=en>
<head>
<meta charset="utf-8">
<script src="js/load-local-storage.js" type="text/javascript"></script>
</head>
<body>
<div id="screen">
<img src="about:blank" id="storImage">
</div>
</body>
</html>