From bc50f913be4924dae5f88ea40bda783a558dc35f Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 24 Jan 2014 12:41:00 +0100 Subject: cleaned js-directory --- js/.main.js.swp | Bin 12288 -> 0 bytes js/cctv-control.js | 13 +++++-- js/cctv-control.js.bak | 55 +++++++++++++++++++++++++++ js/main.js | 100 ------------------------------------------------- js/main.js.bak | 55 --------------------------- 5 files changed, 65 insertions(+), 158 deletions(-) delete mode 100644 js/.main.js.swp create mode 100644 js/cctv-control.js.bak delete mode 100644 js/main.js delete mode 100644 js/main.js.bak diff --git a/js/.main.js.swp b/js/.main.js.swp deleted file mode 100644 index b3ba802..0000000 Binary files a/js/.main.js.swp and /dev/null differ diff --git a/js/cctv-control.js b/js/cctv-control.js index 09e978f..b85fa89 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -1,8 +1,15 @@ -// Small lib to -// -// +// 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 var cam = 0; diff --git a/js/cctv-control.js.bak b/js/cctv-control.js.bak new file mode 100644 index 0000000..7a12dce --- /dev/null +++ b/js/cctv-control.js.bak @@ -0,0 +1,55 @@ +var cam; + +function keyDown(event) { + if (event.keyCode == 49) { + var display = document.getElementById('screen'); + cam = 0; + display.innerHTML = '' + } + + if (event.keyCode == 50) { + var display = document.getElementById('screen'); + cam = 1; + display.innerHTML = '' + } + + if (event.keyCode == 51) { + var display = document.getElementById('screen'); + cam = 2; + display.innerHTML = '' + } + + if (event.keyCode == 52) { + var display = document.getElementById('screen'); + display.innerHTML = '' + } + + if (event.keyCode == 37) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam + "/control/left", false); + request.send(); + return false; + } + + if (event.keyCode == 38) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/up", false); + request.send(); + return false; + + } + if (event.keyCode == 39) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/right", false); + request.send(); + return false; + } + if (event.keyCode == 40) { + var request = new XMLHttpRequest(); + request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/down", false); + request.send(); + return false; + + } + +} diff --git a/js/main.js b/js/main.js deleted file mode 100644 index b85fa89..0000000 --- a/js/main.js +++ /dev/null @@ -1,100 +0,0 @@ -// 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 - - -var cam = 0; -var camHost = "172.22.80.56:8080"; -var controlHost = "172.22.80.56:8080"; - -//create event which is triggered when DOM is ready -window.onDomReady = initReady; - -//change from testbild to default cam when DOM is ready -window.onDomReady(changeCam); - -function initReady(fn) { - if(document.addEventListener) { - document.addEventListener("DOMContentLoaded", fn, false); - } -} - -//change currently displayed camera to the one in cam variable -function changeCam() { - var display = document.getElementById('screen'); - if (cam <= 7 && cam >= 0) { - display.innerHTML = ''; - } - else { - display.innerHTML = ''; - } -} - -//send control command to currently selected camera -function controlCam(direction) { - if (direction == "left" || direction == "right" || direction == "up" || direction == "down") { - var request = new XMLHttpRequest(); - request.open("get", "http://" + controlHost + "/cam/" + cam + "/control/" + direction + "left", false); - request.send(); - return false; - } - - -function keyDown(event) { - - switch(event.keyCode) { - case 49: // 1 - cam = 0; - changeCam(); - break; - case 50: // 2 - cam = 1; - changeCam(); - break; - case 51: // 3 - cam = 2; - changeCam(); - break; - case 52: // 4 - cam = 3; - changeCam(); - break; - case 53: // 5 - cam = 4; - changeCam(); - break; - case 54: // 6 - cam = 5; - changeCam(); - break; - case 55: // 7 - cam = 6; - changeCam(); - break; - case 56: // 8 - cam = 7; - changeCam(); - break; - case 37: // arrow left - controlCam("left"); - break; - case 38: // arrow up - controlCam("up"); - break; - case 39: // arrow right - controlCam("right"); - break; - case 40: // arrow down - controlCam("down"); - break; - } -} diff --git a/js/main.js.bak b/js/main.js.bak deleted file mode 100644 index 7a12dce..0000000 --- a/js/main.js.bak +++ /dev/null @@ -1,55 +0,0 @@ -var cam; - -function keyDown(event) { - if (event.keyCode == 49) { - var display = document.getElementById('screen'); - cam = 0; - display.innerHTML = '' - } - - if (event.keyCode == 50) { - var display = document.getElementById('screen'); - cam = 1; - display.innerHTML = '' - } - - if (event.keyCode == 51) { - var display = document.getElementById('screen'); - cam = 2; - display.innerHTML = '' - } - - if (event.keyCode == 52) { - var display = document.getElementById('screen'); - display.innerHTML = '' - } - - if (event.keyCode == 37) { - var request = new XMLHttpRequest(); - request.open("get", "http://172.22.80.56:8080/cam/" + cam + "/control/left", false); - request.send(); - return false; - } - - if (event.keyCode == 38) { - var request = new XMLHttpRequest(); - request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/up", false); - request.send(); - return false; - - } - if (event.keyCode == 39) { - var request = new XMLHttpRequest(); - request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/right", false); - request.send(); - return false; - } - if (event.keyCode == 40) { - var request = new XMLHttpRequest(); - request.open("get", "http://172.22.80.56:8080/cam/" + cam +"/control/down", false); - request.send(); - return false; - - } - -} -- cgit v1.2.1