MediaWiki:Common.js: Difference between revisions
Appearance
![]() Cdjensen94 (talk | contribs) |
![]() Cdjensen94 (talk | contribs) |
||
Line 14: | Line 14: | ||
}); | }); | ||
$(function() { | |||
fetch('/api.php?action=query&meta=siteinfo&siprop=statistics&format=json') | fetch('/api.php?action=query&meta=siteinfo&siprop=statistics&format=json') | ||
.then(res => res.json()) | |||
.then(data => { | |||
const current = data.query.statistics.articles; | |||
const goal = 200; | |||
const left = goal - current; | |||
const el = document.getElementById("article-countdown"); | |||
if (el) { | |||
el.innerHTML = left > 0 | |||
? `🚧 Only <strong>${left}</strong> articles to go until 200!` | |||
: `🎯 We've reached 200 articles! Celebrate good times, c'mon!`; | |||
} | |||
}); | |||
}); |