MediaWiki:Common.js: verschil tussen versies

Uit Hackerspace Bitlair

kGeen bewerkingssamenvatting
kGeen bewerkingssamenvatting
 
(24 tussenliggende versies door 2 gebruikers niet weergegeven)
Regel 3: Regel 3:
jQuery.ajax({
jQuery.ajax({
     method: 'GET',
     method: 'GET',
     url:    'https://bitlair.nl/statejson.php',
     url:    'https://bitlair.nl/spaceapi.json',
}).done(function(res) {
}).done(function(res) {
     $("<div id=spacestatus>"+(res.state.open ? "open" : "gesloten")+"</div>").appendTo($("#p-logo"));
     let state_str = res.state.open ? "open" : "closed";
    jQuery("<div id=spacestatus class="+state_str+"></div>").appendTo(jQuery("#p-logo"));
    document.querySelector('.mw-wiki-logo').style.backgroundImage = `url("https://bitlair.nl/resources/assets/bitlair-${state_str}.gif")`
});
});


jQuery('<iframe height="400" allowfullscreen style="width:100%; border:none" src="https://bitlair.github.io/tour/?config=space3.json"></iframe>')
    .appendTo(jQuery('#tour3'));
jQuery('<iframe height="400" allowfullscreen style="width:100%; border:none" src="https://bitlair.github.io/tour/?config=tour.json"></iframe>')
    .appendTo(jQuery('#tour4'));


 
let $photos = $("#fotos");
 
if ($photos.length) {
/*
    $.get("/fotos/latest?amount=6", data => {
$.getScript("/status/mqtt-status.js", function () {
        for (var i in data.latest) {
    $("<div id=spacestatus>?</div>").appendTo($("#p-logo"));
            var item = data.latest[i];
    $("#spacestatus")
            $photos
      .revspace()
                .append($("<a>")
      .on("closing", function () { $(this).stop().animate({zoom: 4}, function () { $(this).delay(500).animate({zoom:1}) } ); })
                    .attr({ href: item.url })
      .on("opening", function () { $(this).stop().animate({zoom: 4}, function () { $(this).delay(500).animate({zoom:1}) } ); })
                    .append(
     ;
                        $("<img>")
});
                            .attr({ src: item.thumbnail })
*/
                            .css({ width: '100%' })
                    )
                )
                .css({ 'clear': 'both' });
        }
     });
}

Huidige versie van 8 jan 2026 22:55

/* Any JavaScript here will be loaded for all users on every page load. */

jQuery.ajax({
    method: 'GET',
    url:    'https://bitlair.nl/spaceapi.json',
}).done(function(res) {
    let state_str = res.state.open ? "open" : "closed";
    jQuery("<div id=spacestatus class="+state_str+"></div>").appendTo(jQuery("#p-logo"));
    document.querySelector('.mw-wiki-logo').style.backgroundImage = `url("https://bitlair.nl/resources/assets/bitlair-${state_str}.gif")`
});

jQuery('<iframe height="400" allowfullscreen style="width:100%; border:none" src="https://bitlair.github.io/tour/?config=space3.json"></iframe>')
    .appendTo(jQuery('#tour3'));
jQuery('<iframe height="400" allowfullscreen style="width:100%; border:none" src="https://bitlair.github.io/tour/?config=tour.json"></iframe>')
    .appendTo(jQuery('#tour4'));

let $photos = $("#fotos");
if ($photos.length) {
    $.get("/fotos/latest?amount=6", data => {
        for (var i in data.latest) {
            var item = data.latest[i];
            $photos
                .append($("<a>")
                    .attr({ href: item.url })
                    .append(
                        $("<img>")
                            .attr({ src: item.thumbnail })
                            .css({ width: '100%' })
                    )
                )
                .css({ 'clear': 'both' });
        }
    });
}