From 7d31ebb8b60e02344f98a67c97c8cf5805c31c32 Mon Sep 17 00:00:00 2001 From: Christian 'VOID' Elberfeld <elberfeld@web.de> Date: Sat, 23 Nov 2013 23:42:14 +0100 Subject: [PATCH] alte werte ausfiltern / link auf statische seite --- widget/status_jsonly.php | 57 ++++++++++++++++++++++------------------ 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/widget/status_jsonly.php b/widget/status_jsonly.php index da1acbc..00c5651 100644 --- a/widget/status_jsonly.php +++ b/widget/status_jsonly.php @@ -19,32 +19,37 @@ function queryWankerStatus() { jQuery.getJSON("/api/status",function(result) { - - if (result != null && result.tuerOffen != null) + + if ( result.age < 600) { - if (result.tuerOffen == 1) - { - jQuery("#wankerTuerOffen").html("<font color=\"00cc00\">Offen</font>"); - } - else - { - jQuery("#wankerTuerOffen").html("<font color=\"cc0000\">Geschlossen</font>"); - } - } + + if (result != null && result.tuerOffen != null) + { + if (result.tuerOffen == 1) + { + jQuery("#wankerTuerOffen").html("<font color=\"00cc00\">Offen</font>"); + } + else + { + jQuery("#wankerTuerOffen").html("<font color=\"cc0000\">Geschlossen</font>"); + } + } - if (result != null && result.tempLounge != null && result.tempLounge) - { - var tempLounge = (result.tempLounge / 10) + "°C"; - - jQuery("#wankerTempLounge").html(tempLounge); - } + if (result != null && result.tempLounge != null && result.tempLounge) + { + var tempLounge = (result.tempLounge / 10) + "°C"; + + jQuery("#wankerTempLounge").html(tempLounge); + } - if (result != null && result.tempWerkstatt != null && result.tempWerkstatt) - { - var tempWerkstatt = (result.tempWerkstatt / 10) + "°C"; - - jQuery("#wankerTempWerkstatt").html(tempWerkstatt); - } + if (result != null && result.tempWerkstatt != null && result.tempWerkstatt) + { + var tempWerkstatt = (result.tempWerkstatt / 10) + "°C"; + + jQuery("#wankerTempWerkstatt").html(tempWerkstatt); + } + + } }); @@ -58,8 +63,8 @@ jQuery(document).ready(function() { </script> <ul> - <li><span class="zonenstatus">Status: <span id="wankerTuerOffen" class="wankerClosed">Unbekannt</span></span></li> - <li><span class="zonenstatus">Lounge: <span id="wankerTempLounge">--</span></span></li> - <li><span class="zonenstatus">Werkstatt: <span id="wankerTempWerkstatt">--</span></span></li> + <li><a class="zonenstatus" href="/api/static">Status: <span id="wankerTuerOffen" class="wankerClosed">Unbekannt</span></a></li> + <li><a class="zonenstatus" href="/api/static">Lounge: <span id="wankerTempLounge">--</span></a></li> + <li><a class="zonenstatus" href="/api/static">Werkstatt: <span id="wankerTempWerkstatt">--</span></a></li> </ul> <!-- /WARPZONE status --> \ No newline at end of file -- GitLab