diff --git a/_includes/space-status.html b/_includes/space-status.html index c8530d2bd887b25abb1340191d96496c5bb93528..a0f9e17901452d451cbf8297c01ba4e1389b4176 100644 --- a/_includes/space-status.html +++ b/_includes/space-status.html @@ -1,7 +1,8 @@ <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <script> $(document).ready(function(){ - spaceopen(); + //spaceopen(); + bbbopen(); }); function spaceopen() { @@ -11,15 +12,31 @@ function spaceopen() { console.log(data); if(data.open) { console.log("OPEN"); - //$("#spaceopen").css( "border", "3px solid green" ); - //$("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/open.png' width='35'></div>Der Nbsp ist offen!<br><div style='text-align: right;'><a href='http://status.chaotikum.org/' target='_blank' style='color: #EAEAEA;'>Status</a></div>"); + $("#spaceopen").css( "border", "3px solid green" ); + $("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/open.png' width='35'></div>Der Nbsp ist offen!<br><div style='text-align: right;'><a href='http://status.chaotikum.org/' target='_blank' style='color: #EAEAEA;'>Status</a></div>"); } else { console.log("CLOSED"); - //$("#spaceopen").css( "border", "3px solid red" ); - // $("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/closed.png' width='35'></div>Der Nbsp ist geschlossen!<br><div style='text-align: right;'><a href='http://status.chaotikum.org/' target='_blank' style='color: #EAEAEA;'>Status</a></div>"); + $("#spaceopen").css( "border", "3px solid red" ); + $("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/closed.png' width='35'></div>Der Nbsp ist geschlossen!<br><div style='text-align: right;'><a href='http://status.chaotikum.org/' target='_blank' style='color: #EAEAEA;'>Status</a></div>"); } }); } + +function bbbopen() { + + $.get( "https://plaudern.chaotikum.org/status", function( data ) { + console.log(data); + if(data.participantCount > 1) { + console.log("OPEN"); + $("#spaceopen").css( "border", "3px solid green" ); + $("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/open.png' width='35'></div>Menschen unterhalten sich im BBB<br><div style='text-align: right;'><a href='https://plaudern.chaotikum.org/b/reakspace/' target='_blank' style='color: #EAEAEA;'>Schau Vorbei</a></div>"); + } else { + console.log("CLOSED"); + $("#spaceopen").css( "border", "3px solid red" ); + $("#spaceopen").html("<div style='float:left'><img src='{{ site.baseurl }}/assets/closed.png' width='35'></div>Derzeit ist niemand im BBB<br><div style='text-align: right;'><a href='https://plaudern.chaotikum.org/b/reakspace/' target='_blank' style='color: #EAEAEA;'>BBB</a></div>"); + } + }); +} </script> <div id="spacehint">