'+stype+'
'+swhere+': '+svalue+'';
- });
+ sensorstd+='Temperatur';
+ $.each( data.sensors.temperature, function(s, sensorobj) {
+ sensorstd+=' '+sensorobj.location+': '+sensorobj.value.toFixed(2)+sensorobj.unit;
});
+ sensorstd+=' | ';
+ }
+ if (data.sensors.ext_illumination)
+ {
+ sensorstd+='Licht';
+ $.each( data.sensors.ext_illumination, function(s, sensorobj) {
+ sensorstd+=' '+sensorobj.location+': '+sensorobj.value;
+ });
+ sensorstd+=' | ';
+ }
+ if (data.sensors.door_locked)
+ {
+ sensorstd+='Eingangstür';
+ $.each( data.sensors.door_locked, function(s, sensorobj) {
+ var lockstatus="Auf";
+ if (sensorobj.value) { lockstatus = "Zu"; }
+ sensorstd+=' '+sensorobj.location+': '+lockstatus;
+ });
+ sensorstd+=' | ';
+ }
+ if (data.sensors.ext_door_ajar)
+ {
+ sensorstd+='Türkontakt';
+ $.each( data.sensors.ext_door_ajar, function(s, sensorobj) {
+ var lockstatus="Auf";
+ if (sensorobj.value) { lockstatus = "Zu"; }
+ sensorstd+=' '+sensorobj.location+': '+lockstatus;
+ });
+ sensorstd+=' | ';
+ }
+ if (data.sensors.ext_dust)
+ {
+ sensorstd+='Staub';
+ $.each( data.sensors.ext_dust, function(s, sensorobj) {
+ sensorstd+=' '+sensorobj.location+': '+sensorobj.value+sensorobj.unit+' | ';
+ });
+ sensorstd+='';
+
+ }
+ if (sensorstd != "")
+ {
+ sensorshtml='';
+ document.getElementById('sensor_status').innerHTML=sensorshtml;
}
- }
- if (sensorstd != "")
- {
- sensorshtml='';
- document.getElementById('sensor_status').innerHTML=sensorshtml;
}
}
@@ -139,19 +250,6 @@ function updateAnwesenheitStatus()
var jqxhr = $.getJSON(url, writeAnwesenheitStatus);
}
-$(document).ready(function()
-{
- updateDateClock(new Date());
- setInterval("clock()", 500);
- updateAnwesenheitStatus();
- loadCalendar();
- loadGooglePlusEvents();
- setInterval("updateAnwesenheitStatus()", 10*1000);
- setInterval("loadCalendar()", 123*1000);
- setInterval("updateSensors()",145*1000);
- setInterval("loadGooglePlusEvents()", 1207*1000);
-});
-
function updateDateClock(now)
{
var daynames = new Array('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa');
@@ -213,7 +311,7 @@ function IsImageOk(img) {
}
var img_orig_src = {};
-function reloadImg(element)
+function reloadImgAlt(element)
{
if(element.complete)
{
@@ -225,7 +323,7 @@ function reloadImg(element)
{
img_orig_src[element.id] = element.src;
}
- new_image.src = img_orig_src[element.id] + "&dt="+Math.floor(new Date().getTime() / 1000).toString();
+ new_image.src = img_orig_src[element.id] + "?dt="+Math.floor(new Date().getTime() / 1000).toString();
if (IsImageOk(new_image))
{
element.parentNode.insertBefore(new_image,element);
@@ -233,3 +331,24 @@ function reloadImg(element)
}
}
}
+function reloadImg(element)
+{
+ if (! img_orig_src[element.id])
+ {
+ img_orig_src[element.id] = element.src;
+ }
+ element.src = img_orig_src[element.id] + "?dt="+Math.floor(new Date().getTime() / 1000).toString();
+}
+
+$(document).ready(function()
+{
+ updateDateClock(new Date());
+ setInterval("clock()", 500);
+ updateAnwesenheitStatus();
+ loadCalendarKiosk();
+ loadGooglePlusEvents();
+ setInterval("updateAnwesenheitStatus()", 10*1000);
+ setInterval("loadCalendarKiosk()", 123*1000);
+ setInterval("updateSensors()",145*1000);
+ setInterval("loadGooglePlusEvents()", 1207*1000);
+});