Skip to content
Snippets Groups Projects
Commit d0b7b6e6 authored by Lukas Ruge's avatar Lukas Ruge
Browse files

only show avatars if space open

parent 9f5b1785
No related branches found
No related tags found
No related merge requests found
Pipeline #9306 passed
...@@ -46,6 +46,8 @@ applyToggle('.list--nav', '.button', 640) ...@@ -46,6 +46,8 @@ applyToggle('.list--nav', '.button', 640)
</script> </script>
<script> <script>
var space_is_open = false;
$(document).ready(function(){ $(document).ready(function(){
spaceopen(); spaceopen();
nextevent(); nextevent();
...@@ -57,6 +59,7 @@ function spaceopen() { ...@@ -57,6 +59,7 @@ function spaceopen() {
$.get( "https://status.nobreakspace.org/spaceapi.json", function( data ) { $.get( "https://status.nobreakspace.org/spaceapi.json", function( data ) {
if(data.open) { if(data.open) {
space_is_open = true;
$("#spaceopen").css( "border", "3px solid green" ); $("#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='https://status.nobreakspace.org' target='_blank' style='color: #EAEAEA;'>Status</a></div>"); $("#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='https://status.nobreakspace.org' target='_blank' style='color: #EAEAEA;'>Status</a></div>");
$("#spaceopenmobile").css( "border", "3px solid green" ); $("#spaceopenmobile").css( "border", "3px solid green" );
...@@ -93,6 +96,7 @@ function shuffleArray(array) { ...@@ -93,6 +96,7 @@ function shuffleArray(array) {
} }
function presence() { function presence() {
if(space_is_open) {
$.getJSON( "{{site.presence_service}}", function( data ) { $.getJSON( "{{site.presence_service}}", function( data ) {
console.log(data) console.log(data)
shuffleArray(data); shuffleArray(data);
...@@ -115,6 +119,7 @@ function presence() { ...@@ -115,6 +119,7 @@ function presence() {
$("#presence_mobile" ).append('<img class="gravatar" src="https://chaotikum.org/assets/presence/plusplus.png" style="margin-left: -5px;"/>'); $("#presence_mobile" ).append('<img class="gravatar" src="https://chaotikum.org/assets/presence/plusplus.png" style="margin-left: -5px;"/>');
} }
}); });
}
} }
</script> </script>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment