MediaWiki:Common.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
var script = document.createElement("script"); script.setAttribute("async", ""); script.src = "https://www.googletagmanager.com/gtag/js?id=G-7H19MR0RZG"; document.head.appendChild(script); window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-7H19MR0RZG'); // Recently Added Profiles Widget mw.loader.using('mediawiki.api').then(function () { var api = new mw.Api(); api.get({ action: 'query', list: 'recentchanges', rcnamespace: 0, // Main namespace only rctype: 'new', rclimit: 5, rcprop: 'title|timestamp', format: 'json' }).done(function (data) { var container = document.getElementById('recent-pages'); if (!container) return; var html = '<ul>'; data.query.recentchanges.forEach(function (page) { var title = page.title; var url = mw.util.getUrl(title); html += '<li><a href="' + url + '">' + title + '</a></li>'; }); html += '</ul>'; container.innerHTML = html; }).fail(function () { var container = document.getElementById('recent-pages'); if (container) { container.innerHTML = 'Unable to load recent pages.'; } }); });