MediaWiki:Common.js: Difference between revisions

From RevSpace
Jump to navigation Jump to search
No edit summary
No edit summary
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
/* Any JavaScript here will be loaded for all users on every page load. */
/* Any JavaScript here will be loaded for all users on every page load. */
$.getScript("/status/mqtt-status.js?2", function () {
    $("<div id=spacestatus>?</div>").appendTo($("#p-logo"));
    $("<div id=n><a href='/N'>n = <span id=checked-in>?</span></a></div>").appendTo($("#p-logo"));
    $("#spacestatus")
      .revspace("open", "dicht")
      .on("closing", function () { $(this).stop().animate({zoom: 4}, function () { $(this).delay(500).animate({zoom:1}) } ); })
      .on("opening", function () { $(this).stop().animate({zoom: 4}, function () { $(this).delay(500).animate({zoom:1}) } ); })
    ;
    $(".spacestatus").revspace("open", "gesloten");
});


<!-- Piwik -->
var nosummary = "No summary for hidden page";
var pkBaseURL = (("https:" == document.location.protocol) ? "https://p.sigio.nl/" : "http://p.sigio.nl/");
 
document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
$(function () {
</script><script type="text/javascript">
    if (! $("#firstHeading").text().match(/Hidden:/)) return;
try {
 
var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 2);
    $("#editform #wpSummary")
piwikTracker.trackPageView();
    .val(nosummary)
piwikTracker.enableLinkTracking();
    .change(function () { $(this).val(nosummary); })
} catch( err ) {}
    .hide();
<!-- End Piwik Tracking Code -->
 
    $("#wpSummaryLabel")
    .hide();
});
 
if ($("#kiekjes").length) {
    $.get("/kiekjes/latest?amount=8", function (data) {
        var photos = $("<div/>");
        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: '12.5%' })
                )
            );
        }
        $("#kiekjes").html(photos);
    });
}
 
// headings nummeren zoals in de toc
$(function() {
  $("a[href] .tocnumber").each(function() { $(this).html($(this).html() + "."); var id = $(this).parent().attr('href').replace(/^#/, ""); var h = document.getElementById(id); h.innerHTML = $(this).html() + " " + h.innerHTML;  });
})

Latest revision as of 19:38, 1 March 2022

/* Any JavaScript here will be loaded for all users on every page load. */
$.getScript("/status/mqtt-status.js?2", function () {
    $("<div id=spacestatus>?</div>").appendTo($("#p-logo"));
    $("<div id=n><a href='/N'>n = <span id=checked-in>?</span></a></div>").appendTo($("#p-logo"));
    $("#spacestatus")
       .revspace("open", "dicht")
       .on("closing", function () { $(this).stop().animate({zoom: 4}, function () { $(this).delay(500).animate({zoom:1}) } ); })
       .on("opening", function () { $(this).stop().animate({zoom: 4}, function () { $(this).delay(500).animate({zoom:1}) } ); })
    ;
    $(".spacestatus").revspace("open", "gesloten");
});

var nosummary = "No summary for hidden page";

$(function () { 
    if (! $("#firstHeading").text().match(/Hidden:/)) return;

    $("#editform #wpSummary")
    .val(nosummary)
    .change(function () { $(this).val(nosummary); })
    .hide();

    $("#wpSummaryLabel")
    .hide();
});

if ($("#kiekjes").length) {
    $.get("/kiekjes/latest?amount=8", function (data) {
        var photos = $("<div/>");
        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: '12.5%' })
                )
            );
        }
        $("#kiekjes").html(photos);
    });
}

// headings nummeren zoals in de toc
$(function() {
  $("a[href] .tocnumber").each(function() { $(this).html($(this).html() + "."); var id = $(this).parent().attr('href').replace(/^#/, ""); var h = document.getElementById(id); h.innerHTML = $(this).html() + " " + h.innerHTML;  });
})