From 7166321f6ab66c27e9d9275356db5f15a7f0ca4c Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Wed, 24 Apr 2013 12:07:40 +0000 Subject: [PATCH] js inhibit caching of sensor pic --- raspberry-kiosk/kiosk.html | 1 + raspberry-kiosk/kiosk.js | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/raspberry-kiosk/kiosk.html b/raspberry-kiosk/kiosk.html index e7e4c20..3c535c1 100644 --- a/raspberry-kiosk/kiosk.html +++ b/raspberry-kiosk/kiosk.html @@ -4,6 +4,7 @@ Realraum Kiosk Seite + diff --git a/raspberry-kiosk/kiosk.js b/raspberry-kiosk/kiosk.js index a4c31d6..29f7ba8 100644 --- a/raspberry-kiosk/kiosk.js +++ b/raspberry-kiosk/kiosk.js @@ -148,7 +148,7 @@ $(document).ready(function() loadGooglePlusEvents(); setInterval("updateAnwesenheitStatus()", 10*1000); setInterval("loadCalendar()", 123*1000); - setInterval("updateSensors()",125*1000); + setInterval("updateSensors()",145*1000); setInterval("loadGooglePlusEvents()", 1207*1000); }); @@ -212,16 +212,20 @@ function IsImageOk(img) { return true; } +var img_orig_src = {}; function reloadImg(element) { - //var image = document.getElementById("theText"); if(element.complete) { var new_image = new Image(); //set up the new image new_image.id = element.id; new_image.className = element.className; - new_image.src = element.src; + if (! img_orig_src[element.id]) + { + img_orig_src[element.id] = element.src; + } + 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); -- 1.7.10.4