From e92d63f5e363a20b67b0a53ae1e470b8ad0e0918 Mon Sep 17 00:00:00 2001 From: Florian Date: Fri, 7 Feb 2014 15:22:41 +0100 Subject: display no of active camera as overlay --- js/cctv-control.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/cctv-control.js b/js/cctv-control.js index da49ca2..c79346d 100644 --- a/js/cctv-control.js +++ b/js/cctv-control.js @@ -13,8 +13,8 @@ var cam = 0; -var camHost = "172.22.80.56:8080"; -var controlHost = "172.22.80.56:8080"; +var camHost = "127.0.0.1:8080"; +var controlHost = "127.0.0.1:8080"; //create event which is triggered when DOM is ready window.onDomReady = initReady; @@ -32,7 +32,9 @@ function initReady(fn) { function changeCam() { var display = document.getElementById('screen'); if (cam <= 7 && cam >= 0) { - display.innerHTML = ''; + camDisplay = cam + 1; + display.innerHTML = '

' + camDisplay + '

'; + display.innerHTML += ''; } else { display.innerHTML = ''; @@ -43,7 +45,7 @@ function changeCam() { 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.open("get", "http://" + controlHost + "/cam/" + cam + "/control/" + direction, false); request.send(); return false; } -- cgit v1.2.1