Widget:ClubStatus: Unterschied zwischen den Versionen

aus dem Wiki des Entropia e.V., CCC Karlsruhe
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
 
(7 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1: Zeile 1:
<noinclude>
<noinclude>
__NOTOC__
__NOTOC__
 
{{#widget:ClubStatus}}
</noinclude>
</noinclude><includeonly><script>
 
<includeonly>
<span class="club-status"></span>
<script>
(() => {
(() => {
   const OPENED_CLASS = 'club-status-opened';
   const OPENED_CLASS = 'widget-clubstatus__type--opened';
   const CLOSED_CLASS = 'club-status-closed';
   const CLOSED_CLASS = 'widget-clubstatus__type--closed';


   const clubStatusMarker = document.querySelector('.club-status');
   const clubStatusMarker = document.querySelector('#widget-clubstatus');


   function setClubStatus(isOpen, lastChange) {
   function setClubStatus(isOpen, lastChange) {
Zeile 30: Zeile 26:


   function updateClubStatus() {
   function updateClubStatus() {
     fetch('api/entropia-club-status-json-api.php')
     fetch('/api/entropia-club-status-json-api.php')
       .then(response => response.json())
       .then(response => response.json())
       .then(data => setClubStatus(data["isOpen"], data["lastChange"]));
       .then(data => setClubStatus(data["isOpen"], data["lastChange"]));
Zeile 39: Zeile 35:
   updateClubStatus();
   updateClubStatus();
})();
})();
</script>
</script></includeonly>
</includeonly>

Aktuelle Version vom 14. März 2024, 12:10 Uhr